-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #18815 from gastaldi/compare_ext
- Loading branch information
Showing
3 changed files
with
36 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
...ols-common/src/test/java/io/quarkus/platform/catalog/processor/ProcessedCategoryTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package io.quarkus.platform.catalog.processor; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
import io.quarkus.registry.catalog.Extension; | ||
import io.quarkus.registry.catalog.json.JsonCategory; | ||
import io.quarkus.registry.catalog.json.JsonExtension; | ||
import java.util.List; | ||
import org.junit.jupiter.api.Test; | ||
|
||
class ProcessedCategoryTest { | ||
|
||
@Test | ||
void should_sort_extensions_ignoring_case() { | ||
Extension zipFile = createExtension("Camel Zip File"); | ||
Extension gRPC = createExtension("Camel gRPC"); | ||
Extension iCal = createExtension("Camel iCal"); | ||
Extension univocityParser = createExtension("Camel univocityParser"); | ||
ProcessedCategory category = new ProcessedCategory(new JsonCategory(), List.of( | ||
zipFile, | ||
gRPC, | ||
iCal, | ||
univocityParser)); | ||
assertThat(category.getSortedExtensions()).containsExactly(gRPC, iCal, univocityParser, zipFile); | ||
} | ||
|
||
private Extension createExtension(String name) { | ||
JsonExtension extension = new JsonExtension(); | ||
extension.setGroupId("org.foo"); | ||
extension.setArtifactId("bar-" + name); | ||
extension.setName(name); | ||
return extension; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters