Fix test when Bad Request
This commit is contained in:
parent
12b77eff17
commit
a05771ced7
1 changed files with 3 additions and 7 deletions
|
@ -58,20 +58,16 @@ class SchemaRegistryServiceTests extends AbstractBaseTest {
|
||||||
* It should create a new schema w/o submitting a schemaType field to Schema Registry
|
* It should create a new schema w/o submitting a schemaType field to Schema Registry
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
void shouldCreateNewSchemaWhenSchemaTypeNotPresents() {
|
void shouldBeBadRequestIfNoSchemaType() {
|
||||||
String schema = "{\"subject\":\"%s\",\"schema\":\"{\\\"type\\\": \\\"string\\\"}\"}";
|
String schema = "{\"subject\":\"%s\",\"schema\":\"{\\\"type\\\": \\\"string\\\"}\"}";
|
||||||
|
|
||||||
SchemaSubject actualResponse = webTestClient
|
webTestClient
|
||||||
.post()
|
.post()
|
||||||
.uri("/api/clusters/{clusterName}/schemas", LOCAL)
|
.uri("/api/clusters/{clusterName}/schemas", LOCAL)
|
||||||
.contentType(MediaType.APPLICATION_JSON)
|
.contentType(MediaType.APPLICATION_JSON)
|
||||||
.body(BodyInserters.fromValue(schema.formatted(subject)))
|
.body(BodyInserters.fromValue(schema.formatted(subject)))
|
||||||
.exchange()
|
.exchange()
|
||||||
.expectStatus().isEqualTo(HttpStatus.OK)
|
.expectStatus().isBadRequest();
|
||||||
.expectBody(SchemaSubject.class).returnResult().getResponseBody();
|
|
||||||
|
|
||||||
Assertions.assertNotNull(actualResponse);
|
|
||||||
Assertions.assertEquals(SchemaType.AVRO, actualResponse.getSchemaType());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
Loading…
Add table
Reference in a new issue