-
Notifications
You must be signed in to change notification settings - Fork 271
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding "artifactType" as a filter option when searching. Fixes #5535
- Loading branch information
1 parent
0ce36c2
commit cdd12d2
Showing
12 changed files
with
126 additions
and
45 deletions.
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
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
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
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
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
44 changes: 44 additions & 0 deletions
44
app/src/test/java/io/apicurio/registry/noprofile/VersionSearchTest.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,44 @@ | ||
package io.apicurio.registry.noprofile; | ||
|
||
import io.apicurio.registry.AbstractResourceTestBase; | ||
import io.apicurio.registry.rest.client.models.VersionSearchResults; | ||
import io.apicurio.registry.types.ArtifactType; | ||
import io.apicurio.registry.types.ContentTypes; | ||
import io.apicurio.registry.utils.tests.TestUtils; | ||
import io.quarkus.test.junit.QuarkusTest; | ||
import org.junit.jupiter.api.Assertions; | ||
import org.junit.jupiter.api.Test; | ||
|
||
@QuarkusTest | ||
public class VersionSearchTest extends AbstractResourceTestBase { | ||
|
||
@Test | ||
void testFilterByArtifactType() throws Exception { | ||
String groupId = TestUtils.generateGroupId(); | ||
|
||
createArtifact(groupId, "avro-artifact", ArtifactType.AVRO, "{}", ContentTypes.APPLICATION_JSON); | ||
createArtifactVersion(groupId, "avro-artifact", "{ }", ContentTypes.APPLICATION_JSON); | ||
createArtifact(groupId, "json-artifact", ArtifactType.JSON, "{}", ContentTypes.APPLICATION_JSON); | ||
|
||
VersionSearchResults results = clientV3.search().versions().get(config -> { | ||
config.queryParameters.groupId = groupId; | ||
}); | ||
Assertions.assertNotNull(results); | ||
Assertions.assertEquals(3, results.getCount()); | ||
|
||
results = clientV3.search().versions().get(config -> { | ||
config.queryParameters.groupId = groupId; | ||
config.queryParameters.artifactType = ArtifactType.AVRO; | ||
}); | ||
Assertions.assertNotNull(results); | ||
Assertions.assertEquals(2, results.getCount()); | ||
|
||
results = clientV3.search().versions().get(config -> { | ||
config.queryParameters.groupId = groupId; | ||
config.queryParameters.artifactType = ArtifactType.JSON; | ||
}); | ||
Assertions.assertNotNull(results); | ||
Assertions.assertEquals(1, results.getCount()); | ||
|
||
} | ||
} |
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
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
Oops, something went wrong.