|
18 | 18 |
|
19 | 19 | import io.apicurio.registry.client.auth.VertXAuthFactory;
|
20 | 20 | import io.apicurio.registry.rest.client.RegistryClient;
|
21 |
| -import io.apicurio.registry.rest.client.models.ArtifactContent; |
| 21 | +import io.apicurio.registry.rest.client.models.CreateArtifact; |
| 22 | +import io.apicurio.registry.rest.client.models.CreateVersion; |
22 | 23 | import io.apicurio.registry.rest.client.models.Rule;
|
23 | 24 | import io.apicurio.registry.rest.client.models.RuleType;
|
| 25 | +import io.apicurio.registry.rest.client.models.VersionContent; |
24 | 26 | import io.kiota.http.vertx.VertXRequestAdapter;
|
25 | 27 |
|
26 | 28 | import java.util.UUID;
|
@@ -70,9 +72,14 @@ public void run() {
|
70 | 72 | for (int idx = 0; idx < numArtifacts; idx++) {
|
71 | 73 | System.out.println("Iteration: " + idx);
|
72 | 74 | String artifactId = UUID.randomUUID().toString();
|
73 |
| - ArtifactContent content = new ArtifactContent(); |
74 |
| - content.setContent(simpleAvro.replace("userInfo", "userInfo" + threadId + numArtifacts)); |
75 |
| - client.groups().byGroupId("default").artifacts().post(content, config -> { |
| 75 | + CreateArtifact createArtifact = new CreateArtifact(); |
| 76 | + createArtifact.setArtifactId("city"); |
| 77 | + createArtifact.setType("JSON"); |
| 78 | + createArtifact.setFirstVersion(new CreateVersion()); |
| 79 | + createArtifact.getFirstVersion().setContent(new VersionContent()); |
| 80 | + createArtifact.getFirstVersion().getContent().setContent(simpleAvro.replace("userInfo", "userInfo" + threadId + numArtifacts)); |
| 81 | + createArtifact.getFirstVersion().getContent().setContentType("application/json"); |
| 82 | + client.groups().byGroupId("default").artifacts().post(createArtifact, config -> { |
76 | 83 | config.headers.add("X-Registry-ArtifactId", artifactId);
|
77 | 84 | });
|
78 | 85 | Rule rule = new Rule();
|
|
0 commit comments