Skip to content

Commit 7d99ccb

Browse files
committed
Fix broken tests
1 parent dab4c91 commit 7d99ccb

1 file changed

Lines changed: 18 additions & 18 deletions

File tree

spring-cloud-schema-registry-server/src/test/java/org/springframework/cloud/schema/registry/server/SchemaRegistryServerAvroTests.java

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ public void testUnsupportedFormat() {
154154
fail("Expects: " + HttpStatus.BAD_REQUEST + " error");
155155
}
156156
catch (HttpClientErrorException.BadRequest badRequest) {
157-
assertThat(badRequest.getMessage()).isEqualTo("400 : [Format not supported: Invalid format, supported types are: avro]");
157+
assertThat(badRequest.getMessage()).isEqualTo("400 : \"Format not supported: Invalid format, supported types are: avro\"");
158158
}
159159

160160
}
@@ -167,7 +167,7 @@ public void testInvalidSchema() {
167167
fail("Expects: " + HttpStatus.BAD_REQUEST + " error");
168168
}
169169
catch (HttpClientErrorException.BadRequest badRequest) {
170-
assertThat(badRequest.getMessage()).isEqualTo("400 : [Invalid Schema: No type: {}]");
170+
assertThat(badRequest.getMessage()).isEqualTo("400 : \"Invalid Schema: No type: {}\"");
171171
}
172172

173173
}
@@ -181,8 +181,8 @@ public void testInvalidSchemaGh22() {
181181
fail("Expects: " + HttpStatus.BAD_REQUEST + " error");
182182
}
183183
catch (HttpClientErrorException.BadRequest badRequest) {
184-
assertThat(badRequest.getMessage()).isEqualTo("400 : [Invalid Schema: \"SomeType\" is not a defined name. " +
185-
"The type of the \"field\" field must be a defined name or a {\"type\": ...} expression.]");
184+
assertThat(badRequest.getMessage()).isEqualTo("400 : \"Invalid Schema: \"SomeType\" is not a defined name. " +
185+
"The type of the \"field\" field must be a defined name or a {\"type\": ...} expression.\"");
186186
}
187187

188188
}
@@ -226,7 +226,7 @@ public void testFindByIdNotFound() {
226226
fail("Expects: " + HttpStatus.NOT_FOUND + " error");
227227
}
228228
catch (HttpClientErrorException.NotFound notFound) {
229-
assertThat(notFound.getMessage()).isEqualTo("404 : [Schema not found: Could not find Schema by id: 2]");
229+
assertThat(notFound.getMessage()).isEqualTo("404 : \"Schema not found: Could not find Schema by id: 2\"");
230230
}
231231
}
232232

@@ -271,8 +271,8 @@ public void testSchemaDeletionBySubjectFormatVersion() {
271271
this.client.getForEntity(subjectFormatVersionUri, Schema.class);
272272
}
273273
catch (HttpClientErrorException.NotFound notFound) {
274-
assertThat(notFound.getMessage()).isEqualTo("404 : [Schema not found: Could not find Schema by " +
275-
"subject: user, format: avro, version 1]");
274+
assertThat(notFound.getMessage()).isEqualTo("404 : \"Schema not found: Could not find Schema by " +
275+
"subject: user, format: avro, version 1\"");
276276
}
277277

278278
}
@@ -293,8 +293,8 @@ public void testSchemaDeletionBySubjectFormatVersionNotFound() {
293293
this.client.exchange(new RequestEntity<>(HttpMethod.DELETE, subjectFormatVersionUri), Void.class);
294294
}
295295
catch (HttpClientErrorException.NotFound notFound) {
296-
assertThat(notFound.getMessage()).isEqualTo("404 : [Schema not found: Could not find Schema by " +
297-
"subject: user, format: avro, version 100]");
296+
assertThat(notFound.getMessage()).isEqualTo("404 : \"Schema not found: Could not find Schema by " +
297+
"subject: user, format: avro, version 100\"");
298298
}
299299

300300
}
@@ -311,8 +311,8 @@ public void testSchemaDeletionBySubjectFormatVersionNotAllowed() {
311311
this.client.exchange(new RequestEntity<>(HttpMethod.DELETE, versionUri), Void.class);
312312
}
313313
catch (HttpClientErrorException.MethodNotAllowed methodNotAllowed) {
314-
assertThat(methodNotAllowed.getMessage()).isEqualTo("405 : [Schema deletion is not permitted: Not permitted " +
315-
"deletion of Schema by subject: user, format: avro, version 1]");
314+
assertThat(methodNotAllowed.getMessage()).isEqualTo("405 : \"Schema deletion is not permitted: Not permitted " +
315+
"deletion of Schema by subject: user, format: avro, version 1\"");
316316
}
317317

318318
}
@@ -332,8 +332,8 @@ public void testSchemaDeletionById() {
332332
fail("Expects: " + HttpStatus.NOT_FOUND + " error");
333333
}
334334
catch (HttpClientErrorException.NotFound notFound) {
335-
assertThat(notFound.getMessage()).isEqualTo("404 : [Schema not found: Could not find Schema by subject: " +
336-
"user, format: avro, version 1]");
335+
assertThat(notFound.getMessage()).isEqualTo("404 : \"Schema not found: Could not find Schema by subject: " +
336+
"user, format: avro, version 1\"");
337337
}
338338

339339
}
@@ -351,7 +351,7 @@ public void testSchemaDeletionByIdNotFound() {
351351
fail("Expects: " + HttpStatus.NOT_FOUND + " error");
352352
}
353353
catch (HttpClientErrorException.NotFound notFound) {
354-
assertThat(notFound.getMessage()).isEqualTo("404 : [Schema not found: Could not find Schema by id: 2]");
354+
assertThat(notFound.getMessage()).isEqualTo("404 : \"Schema not found: Could not find Schema by id: 2\"");
355355
}
356356

357357
}
@@ -370,8 +370,8 @@ public void testSchemaDeletionByIdNotAllowed() {
370370
fail("Expects: " + HttpStatus.METHOD_NOT_ALLOWED + " error");
371371
}
372372
catch (HttpClientErrorException.MethodNotAllowed methodNotAllowed) {
373-
assertThat(methodNotAllowed.getMessage()).isEqualTo("405 : [Schema deletion is not permitted: Not " +
374-
"permitted deletion of Schema by id: 1]");
373+
assertThat(methodNotAllowed.getMessage()).isEqualTo("405 : \"Schema deletion is not permitted: Not " +
374+
"permitted deletion of Schema by id: 1\"");
375375
}
376376

377377
}
@@ -441,8 +441,8 @@ public void testSchemaDeletionBySubjectNotAllowed() {
441441
fail("Expects: " + HttpStatus.METHOD_NOT_ALLOWED + " error");
442442
}
443443
catch (HttpClientErrorException.MethodNotAllowed methodNotAllowed) {
444-
assertThat(methodNotAllowed.getMessage()).isEqualTo("405 : [Schema deletion is not permitted: " +
445-
"Not permitted deletion of Schema by subject: user]");
444+
assertThat(methodNotAllowed.getMessage()).isEqualTo("405 : \"Schema deletion is not permitted: " +
445+
"Not permitted deletion of Schema by subject: user\"");
446446
}
447447

448448
}

0 commit comments

Comments
 (0)