diff --git a/src/test/java/com/michelin/ns4kafka/integration/SchemaIntegrationTest.java b/src/test/java/com/michelin/ns4kafka/integration/SchemaIntegrationTest.java index 6a502f95..f70665eb 100644 --- a/src/test/java/com/michelin/ns4kafka/integration/SchemaIntegrationTest.java +++ b/src/test/java/com/michelin/ns4kafka/integration/SchemaIntegrationTest.java @@ -768,47 +768,6 @@ void shouldRegisterSameSchemaTwice() { assertEquals("ns1-subject3-value", schemaAfterPostOnRegistry.subject()); } - @Test - void shouldRegisterSameSchemaTwice2() { - Schema schema = Schema.builder() - .metadata(Metadata.builder() - .name("ns1-subject3-value") - .build()) - .spec(Schema.SchemaSpec.builder() - .schema( - "{\"namespace\":\"com.michelin.kafka.producer.showcase.avro\",\"type\":\"record\"," - + "\"name\":\"PersonAvro\",\"fields\":[{\"name\":\"firstName\",\"type\":[\"null\",\"string\"]," - + "\"default\":null,\"doc\":\"First name of the person\"}," - + "{\"name\":\"lastName\",\"type\":[\"null\",\"string\"],\"default\":null," - + "\"doc\":\"Last name of the person\"},{\"name\":\"dateOfBirth\",\"type\":[\"null\"," - + "{\"type\":\"long\",\"logicalType\":\"timestamp-millis\"}],\"default\":null," - + "\"doc\":\"Date of birth of the person\"}]}") - .build()) - .build(); - - // Apply schema - var createResponse = ns4KafkaClient - .toBlocking() - .exchange(HttpRequest - .create(HttpMethod.POST, "/api/namespaces/ns1/schemas") - .bearerAuth(token) - .body(schema), Schema.class); - - assertEquals("created", createResponse.header("X-Ns4kafka-Result")); - - // Get all schemas - var getResponse = ns4KafkaClient - .toBlocking() - .exchange(HttpRequest - .create(HttpMethod.GET, "/api/namespaces/ns1/schemas") - .bearerAuth(token), Argument.listOf(SchemaList.class)); - - assertTrue(getResponse.getBody().isPresent()); - assertTrue(getResponse.getBody().get() - .stream() - .anyMatch(schemaList -> schemaList.getMetadata().getName().equals("ns1-subject3-value"))); - } - @Test void shouldDeleteSchema() { Schema schemaV1 = Schema.builder() @@ -845,9 +804,7 @@ void shouldDeleteSchema() { + "\"name\":\"PersonAvro\",\"fields\":[{\"name\":\"firstName\",\"type\":[\"null\",\"string\"]," + "\"default\":null,\"doc\":\"First name of the person\"}," + "{\"name\":\"lastName\",\"type\":[\"null\",\"string\"],\"default\":null," - + "\"doc\":\"Last name of the person\"},{\"name\":\"dateOfBirth\",\"type\":[\"null\"," - + "{\"type\":\"long\",\"logicalType\":\"timestamp-millis\"}],\"default\":null," - + "\"doc\":\"Date of birth of the person\"}]}") + + "\"doc\":\"Last name of the person\"}]}") .build()) .build(); @@ -867,9 +824,7 @@ void shouldDeleteSchema() { .schema( "{\"namespace\":\"com.michelin.kafka.producer.showcase.avro\",\"type\":\"record\"," + "\"name\":\"PersonAvro\",\"fields\":[{\"name\":\"firstName\",\"type\":[\"null\",\"string\"]," - + "\"default\":null,\"doc\":\"First name of the person\"}," - + "{\"name\":\"lastName\",\"type\":[\"null\",\"string\"],\"default\":null," - + "\"doc\":\"Last name of the person\"}]}") + + "\"default\":null,\"doc\":\"First name of the person\"}]}") .build()) .build(); @@ -890,10 +845,8 @@ void shouldDeleteSchema() { "{\"namespace\":\"com.michelin.kafka.producer.showcase.avro\",\"type\":\"record\"," + "\"name\":\"PersonAvro\",\"fields\":[{\"name\":\"firstName\",\"type\":[\"null\",\"string\"]," + "\"default\":null,\"doc\":\"First name of the person\"}," - + "{\"name\":\"lastName\",\"type\":[\"null\",\"string\"],\"default\":null," - + "\"doc\":\"Last name of the person\"},{\"name\":\"dateOfBirth\",\"type\":[\"null\"," - + "{\"type\":\"long\",\"logicalType\":\"timestamp-millis\"}],\"default\":null," - + "\"doc\":\"Date of birth of the person\"}]}") + + "{\"name\":\"age\",\"type\":[\"null\",\"string\"],\"default\":null," + + "\"doc\":\"Age of the person\"}]}") .build()) .build();