Skip to content

Commit

Permalink
Renamed the confluent and ibm rest compatibility endpoints (#249)
Browse files Browse the repository at this point in the history
* renamed "/confluent" endpoint to "/ccompat" endpoint

* renamed "/cibm" endpoint to "/ibmcompat" endpoint
  • Loading branch information
EricWittmann authored Feb 3, 2020
1 parent 2c54f20 commit b7f2f41
Show file tree
Hide file tree
Showing 30 changed files with 78 additions and 70 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
/**
* @author Ales Justin
*/
@Path("/confluent/compatibility")
@Path("/ccompat/compatibility")
@Consumes({RestConstants.JSON, RestConstants.SR})
@Produces({RestConstants.JSON, RestConstants.SR})
@Interceptors({ResponseErrorLivenessCheck.class, ResponseTimeoutReadinessCheck.class})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
/**
* @author Ales Justin
*/
@Path("/confluent/config")
@Path("/ccompat/config")
@Consumes({RestConstants.JSON, RestConstants.SR})
@Produces({RestConstants.JSON, RestConstants.SR})
@Interceptors({ResponseErrorLivenessCheck.class, ResponseTimeoutReadinessCheck.class})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
/**
* @author Ales Justin
*/
@Path("/confluent/mode")
@Path("/ccompat/mode")
@Consumes({RestConstants.JSON, RestConstants.SR})
@Produces({RestConstants.JSON, RestConstants.SR})
@Interceptors({ResponseErrorLivenessCheck.class, ResponseTimeoutReadinessCheck.class})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
/**
* @author Ales Justin
*/
@Path("/confluent/schemas")
@Path("/ccompat/schemas")
@Consumes({RestConstants.JSON, RestConstants.SR})
@Produces({RestConstants.JSON, RestConstants.SR})
@Interceptors({ResponseErrorLivenessCheck.class, ResponseTimeoutReadinessCheck.class})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
/**
* @author Ales Justin
*/
@Path("/confluent/subjects/{subject}/versions")
@Path("/ccompat/subjects/{subject}/versions")
@Consumes({RestConstants.JSON, RestConstants.SR})
@Produces({RestConstants.JSON, RestConstants.SR})
@Interceptors({ResponseErrorLivenessCheck.class, ResponseTimeoutReadinessCheck.class})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
/**
* @author Ales Justin
*/
@Path("/confluent/subjects")
@Path("/ccompat/subjects")
@Consumes({RestConstants.JSON, RestConstants.SR})
@Produces({RestConstants.JSON, RestConstants.SR})
@Interceptors({ResponseErrorLivenessCheck.class, ResponseTimeoutReadinessCheck.class})
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
package io.apicurio.registry.cibm.api;

import io.apicurio.registry.cibm.model.AnyOfStateModificationEnabledModification;
import io.apicurio.registry.cibm.model.NewSchema;
import io.apicurio.registry.cibm.model.NewSchemaVersion;
import io.apicurio.registry.cibm.model.Schema;
import io.apicurio.registry.cibm.model.SchemaInfo;
import io.apicurio.registry.cibm.model.SchemaListItem;
import io.apicurio.registry.metrics.RestMetricsApply;
import io.apicurio.registry.storage.ArtifactNotFoundException;
import org.eclipse.microprofile.metrics.annotation.ConcurrentGauge;
import org.eclipse.microprofile.metrics.annotation.Counted;
import org.eclipse.microprofile.metrics.annotation.Timed;
package io.apicurio.registry.ibmcompat.api;

import static io.apicurio.registry.metrics.MetricIDs.REST_CONCURRENT_REQUEST_COUNT;
import static io.apicurio.registry.metrics.MetricIDs.REST_CONCURRENT_REQUEST_COUNT_DESC;
import static io.apicurio.registry.metrics.MetricIDs.REST_GROUP_TAG;
import static io.apicurio.registry.metrics.MetricIDs.REST_REQUEST_COUNT;
import static io.apicurio.registry.metrics.MetricIDs.REST_REQUEST_COUNT_DESC;
import static io.apicurio.registry.metrics.MetricIDs.REST_REQUEST_RESPONSE_TIME;
import static io.apicurio.registry.metrics.MetricIDs.REST_REQUEST_RESPONSE_TIME_DESC;
import static org.eclipse.microprofile.metrics.MetricUnits.MILLISECONDS;

import java.util.List;

import javax.inject.Inject;
import javax.validation.Valid;
Expand All @@ -31,12 +30,21 @@
import javax.ws.rs.core.Context;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.SecurityContext;
import java.util.List;

import static io.apicurio.registry.metrics.MetricIDs.*;
import static org.eclipse.microprofile.metrics.MetricUnits.MILLISECONDS;
import org.eclipse.microprofile.metrics.annotation.ConcurrentGauge;
import org.eclipse.microprofile.metrics.annotation.Counted;
import org.eclipse.microprofile.metrics.annotation.Timed;

import io.apicurio.registry.ibmcompat.model.AnyOfStateModificationEnabledModification;
import io.apicurio.registry.ibmcompat.model.NewSchema;
import io.apicurio.registry.ibmcompat.model.NewSchemaVersion;
import io.apicurio.registry.ibmcompat.model.Schema;
import io.apicurio.registry.ibmcompat.model.SchemaInfo;
import io.apicurio.registry.ibmcompat.model.SchemaListItem;
import io.apicurio.registry.metrics.RestMetricsApply;
import io.apicurio.registry.storage.ArtifactNotFoundException;

@Path("/cibm")
@Path("/ibmcompat")
@RestMetricsApply
@Counted(name = REST_REQUEST_COUNT, description = REST_REQUEST_COUNT_DESC, tags = {"group=" + REST_GROUP_TAG, "metric=" + REST_REQUEST_COUNT})
@ConcurrentGauge(name = REST_CONCURRENT_REQUEST_COUNT, description = REST_CONCURRENT_REQUEST_COUNT_DESC, tags = {"group=" + REST_GROUP_TAG, "metric=" + REST_CONCURRENT_REQUEST_COUNT})
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package io.apicurio.registry.cibm.api;

import io.apicurio.registry.cibm.model.AnyOfStateModificationEnabledModification;
import io.apicurio.registry.cibm.model.NewSchema;
import io.apicurio.registry.cibm.model.NewSchemaVersion;
import io.apicurio.registry.cibm.model.Schema;
import io.apicurio.registry.cibm.model.SchemaInfo;
import io.apicurio.registry.cibm.model.SchemaListItem;
package io.apicurio.registry.ibmcompat.api;

import io.apicurio.registry.ibmcompat.model.AnyOfStateModificationEnabledModification;
import io.apicurio.registry.ibmcompat.model.NewSchema;
import io.apicurio.registry.ibmcompat.model.NewSchemaVersion;
import io.apicurio.registry.ibmcompat.model.Schema;
import io.apicurio.registry.ibmcompat.model.SchemaInfo;
import io.apicurio.registry.ibmcompat.model.SchemaListItem;
import io.apicurio.registry.storage.ArtifactNotFoundException;

import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
package io.apicurio.registry.cibm.api.impl;

import io.apicurio.registry.cibm.api.ApiService;
import io.apicurio.registry.cibm.model.AnyOfStateModificationEnabledModification;
import io.apicurio.registry.cibm.model.NewSchema;
import io.apicurio.registry.cibm.model.NewSchemaVersion;
import io.apicurio.registry.cibm.model.Schema;
import io.apicurio.registry.cibm.model.SchemaInfo;
import io.apicurio.registry.cibm.model.SchemaListItem;
import io.apicurio.registry.cibm.model.SchemaVersion;
package io.apicurio.registry.ibmcompat.api.impl;

import io.apicurio.registry.rules.RuleApplicationType;
import io.apicurio.registry.rules.RulesService;
import io.apicurio.registry.storage.ArtifactMetaDataDto;
Expand All @@ -16,6 +8,14 @@
import io.apicurio.registry.storage.StoredArtifact;
import io.apicurio.registry.types.ArtifactType;
import io.apicurio.registry.content.ContentHandle;
import io.apicurio.registry.ibmcompat.api.ApiService;
import io.apicurio.registry.ibmcompat.model.AnyOfStateModificationEnabledModification;
import io.apicurio.registry.ibmcompat.model.NewSchema;
import io.apicurio.registry.ibmcompat.model.NewSchemaVersion;
import io.apicurio.registry.ibmcompat.model.Schema;
import io.apicurio.registry.ibmcompat.model.SchemaInfo;
import io.apicurio.registry.ibmcompat.model.SchemaListItem;
import io.apicurio.registry.ibmcompat.model.SchemaVersion;
import io.apicurio.registry.types.Current;
import io.apicurio.registry.util.ArtifactIdGenerator;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.apicurio.registry.cibm.model;
package io.apicurio.registry.ibmcompat.model;

/**
* @author Ales Justin
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.apicurio.registry.cibm.model;
package io.apicurio.registry.ibmcompat.model;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonValue;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.apicurio.registry.cibm.model;
package io.apicurio.registry.ibmcompat.model;

import com.fasterxml.jackson.annotation.JsonProperty;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.apicurio.registry.cibm.model;
package io.apicurio.registry.ibmcompat.model;

import com.fasterxml.jackson.annotation.JsonProperty;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.apicurio.registry.cibm.model;
package io.apicurio.registry.ibmcompat.model;

import com.fasterxml.jackson.annotation.JsonProperty;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.apicurio.registry.cibm.model;
package io.apicurio.registry.ibmcompat.model;

import com.fasterxml.jackson.annotation.JsonProperty;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.apicurio.registry.cibm.model;
package io.apicurio.registry.ibmcompat.model;

import com.fasterxml.jackson.annotation.JsonProperty;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.apicurio.registry.cibm.model;
package io.apicurio.registry.ibmcompat.model;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonValue;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.apicurio.registry.cibm.model;
package io.apicurio.registry.ibmcompat.model;

import com.fasterxml.jackson.annotation.JsonProperty;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.apicurio.registry.cibm.model;
package io.apicurio.registry.ibmcompat.model;

import com.fasterxml.jackson.annotation.JsonProperty;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.apicurio.registry.cibm.model;
package io.apicurio.registry.ibmcompat.model;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonValue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
public class ConfluentClientTest extends AbstractResourceTestBase {

private SchemaRegistryClient buildClient() {
return new CachedSchemaRegistryClient("http://localhost:8081/confluent", 3);
return new CachedSchemaRegistryClient("http://localhost:8081/ccompat", 3);
}

@Test
Expand Down
2 changes: 1 addition & 1 deletion app/src/test/java/io/apicurio/registry/SerdeMixTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
public class SerdeMixTest extends AbstractResourceTestBase {

private SchemaRegistryClient buildClient() {
return new CachedSchemaRegistryClient("http://localhost:8081/confluent", 3);
return new CachedSchemaRegistryClient("http://localhost:8081/ccompat", 3);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public class SubjectsResourceTest extends AbstractResourceTestBase {
@Test
public void testListSubjectsEndpoint() {
given()
.when().contentType(CT_JSON).get("/confluent/subjects")
.when().contentType(CT_JSON).get("/ccompat/subjects")
.then()
.statusCode(200)
.body(anything());
Expand Down
4 changes: 2 additions & 2 deletions app/src/test/java/io/apicurio/registry/cluster/ClusterIT.java
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ public void testConfluent() throws Exception {
Properties properties = getClusterProperties();
Assumptions.assumeTrue(properties != null);

SchemaRegistryClient client1 = new CachedSchemaRegistryClient("http://localhost:8080/confluent", 3);
SchemaRegistryClient client2 = new CachedSchemaRegistryClient("http://localhost:8081/confluent", 3);
SchemaRegistryClient client1 = new CachedSchemaRegistryClient("http://localhost:8080/ccompat", 3);
SchemaRegistryClient client2 = new CachedSchemaRegistryClient("http://localhost:8081/ccompat", 3);

String subject = UUID.randomUUID().toString();
Schema schema = new Schema.Parser().parse("{\"type\":\"record\",\"name\":\"myrecord1\",\"fields\":[{\"name\":\"f1\",\"type\":\"string\"}]}");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package io.apicurio.registry.cibm;
package io.apicurio.registry.ibmcompat;

import io.apicurio.registry.AbstractResourceTestBase;
import io.quarkus.test.junit.QuarkusTest;
Expand All @@ -25,7 +25,7 @@
public class IBMClientTest extends AbstractResourceTestBase {

private SchemaRegistryRestAPIClient buildClient() throws Exception {
return new SchemaRegistryRestAPIClient("http://localhost:8081/cibm", "<API_KEY>", true);
return new SchemaRegistryRestAPIClient("http://localhost:8081/ibmcompat", "<API_KEY>", true);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* (C) Copyright IBM Corp. 2019 All Rights Reserved.
*
*/
package io.apicurio.registry.cibm;
package io.apicurio.registry.ibmcompat;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public static Producer<Object, Object> createProducer(String keySerializer, Stri
props.put(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, valueSerializer);
// Schema Registry location.
if (valueSerializer.contains("confluent")) {
props.put(KafkaAvroSerializerConfig.SCHEMA_REGISTRY_URL_CONFIG, "http://" + RegistryFacade.REGISTRY_URL + ":" + RegistryFacade.REGISTRY_PORT + "/confluent");
props.put(KafkaAvroSerializerConfig.SCHEMA_REGISTRY_URL_CONFIG, "http://" + RegistryFacade.REGISTRY_URL + ":" + RegistryFacade.REGISTRY_PORT + "/ccompat");
props.put(KafkaAvroSerializerConfig.VALUE_SUBJECT_NAME_STRATEGY, artifactIdStrategy);
} else {
props.put(AbstractKafkaSerDe.REGISTRY_URL_CONFIG_PARAM, "http://" + RegistryFacade.REGISTRY_URL + ":" + RegistryFacade.REGISTRY_PORT);
Expand All @@ -91,7 +91,7 @@ public static Consumer<Long, GenericRecord> createConsumer(String keyDeserialize
props.put(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG, valueDeserializer);
//Schema registry location.
if (valueDeserializer.contains("confluent")) {
props.put(KafkaAvroSerializerConfig.SCHEMA_REGISTRY_URL_CONFIG, "http://" + RegistryFacade.REGISTRY_URL + ":" + RegistryFacade.REGISTRY_PORT + "/confluent");
props.put(KafkaAvroSerializerConfig.SCHEMA_REGISTRY_URL_CONFIG, "http://" + RegistryFacade.REGISTRY_URL + ":" + RegistryFacade.REGISTRY_PORT + "/ccompat");
} else {
props.put(AbstractKafkaSerDe.REGISTRY_URL_CONFIG_PARAM, "http://" + RegistryFacade.REGISTRY_URL + ":" + RegistryFacade.REGISTRY_PORT);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,18 +192,18 @@ public static HashMap<String, String> getFieldsFromResponse(JsonPath jsonPath) {
// ================================================================================

public static Response getAllSchemas(int returnCode) {
return BaseHttpUtils.postRequest(RestConstants.JSON, "", "/confluent/subjects", returnCode);
return BaseHttpUtils.postRequest(RestConstants.JSON, "", "/ccompat/subjects", returnCode);
}

public static Response getLatestVersionSchema(String nameOfSchema) {
return BaseHttpUtils.postRequest(RestConstants.JSON, "", "/confluent/subjects/" + nameOfSchema + "/versions/latest", 200);
return BaseHttpUtils.postRequest(RestConstants.JSON, "", "/ccompat/subjects/" + nameOfSchema + "/versions/latest", 200);
}

public static Response createSchema(String schemeDefinition, String schemaName, int returnCode) {
return BaseHttpUtils.postRequest(RestConstants.JSON, schemeDefinition, "/confluent/subjects/" + schemaName + "/versions", returnCode);
return BaseHttpUtils.postRequest(RestConstants.JSON, schemeDefinition, "/ccompat/subjects/" + schemaName + "/versions", returnCode);
}

public static Response updateSchemaMetadata(String schemaName, String metadata, int returnCode) {
return putRequest(RestConstants.JSON, metadata, "/confluent/subjects/" + schemaName + "/meta", returnCode);
return putRequest(RestConstants.JSON, metadata, "/ccompat/subjects/" + schemaName + "/meta", returnCode);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,14 @@ public static Response deleteAllGlobalRules(String artifactId) {
// ================================================

public static Response testCompatibility(String body, String schemaName, int returnCode) {
return BaseHttpUtils.rulesPostRequest(RestConstants.SR, body, "/confluent/compatibility/subjects/" + schemaName + "/versions/latest", returnCode);
return BaseHttpUtils.rulesPostRequest(RestConstants.SR, body, "/ccompat/compatibility/subjects/" + schemaName + "/versions/latest", returnCode);
}

public static Response createGlobalCompatibilityConfig(String typeOfCompatibility) {
return BaseHttpUtils.putRequest(RestConstants.SR, "{\"compatibility\":\"" + typeOfCompatibility + "\"}", "/confluent/config", 200);
return BaseHttpUtils.putRequest(RestConstants.SR, "{\"compatibility\":\"" + typeOfCompatibility + "\"}", "/ccompat/config", 200);
}

public static Response getGlobalCompatibilityConfig() {
return BaseHttpUtils.getRequest(RestConstants.JSON, "/confluent/config", 204);
return BaseHttpUtils.getRequest(RestConstants.JSON, "/ccompat/config", 204);
}
}
2 changes: 1 addition & 1 deletion tests/src/test/java/io/apicurio/tests/BaseIT.java
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ static void beforeAll() throws Exception {
RestAssured.baseURI = "http://" + RegistryFacade.REGISTRY_URL + ":" + RegistryFacade.REGISTRY_PORT;
LOGGER.info("Registry app is running on {}:{}", RegistryFacade.REGISTRY_URL, RegistryFacade.REGISTRY_PORT);
RestAssured.defaultParser = Parser.JSON;
confluentService = new CachedSchemaRegistryClient("http://" + RegistryFacade.REGISTRY_URL + ":" + RegistryFacade.REGISTRY_PORT + "/confluent", 3);
confluentService = new CachedSchemaRegistryClient("http://" + RegistryFacade.REGISTRY_URL + ":" + RegistryFacade.REGISTRY_PORT + "/ccompat", 3);
apicurioService = RegistryClient.create("http://" + RegistryFacade.REGISTRY_URL + ":" + RegistryFacade.REGISTRY_PORT);

clearAllConfluentSubjects();
Expand Down

0 comments on commit b7f2f41

Please sign in to comment.