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
|
||||
*/
|
||||
@Test
|
||||
void shouldCreateNewSchemaWhenSchemaTypeNotPresents() {
|
||||
void shouldBeBadRequestIfNoSchemaType() {
|
||||
String schema = "{\"subject\":\"%s\",\"schema\":\"{\\\"type\\\": \\\"string\\\"}\"}";
|
||||
|
||||
SchemaSubject actualResponse = webTestClient
|
||||
webTestClient
|
||||
.post()
|
||||
.uri("/api/clusters/{clusterName}/schemas", LOCAL)
|
||||
.contentType(MediaType.APPLICATION_JSON)
|
||||
.body(BodyInserters.fromValue(schema.formatted(subject)))
|
||||
.exchange()
|
||||
.expectStatus().isEqualTo(HttpStatus.OK)
|
||||
.expectBody(SchemaSubject.class).returnResult().getResponseBody();
|
||||
|
||||
Assertions.assertNotNull(actualResponse);
|
||||
Assertions.assertEquals(SchemaType.AVRO, actualResponse.getSchemaType());
|
||||
.expectStatus().isBadRequest();
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
Loading…
Add table
Reference in a new issue