@@ -151,7 +151,8 @@ public void unsupportedFormat() {
151
151
fail ("Expects: " + HttpStatus .BAD_REQUEST + " error" );
152
152
}
153
153
catch (HttpClientErrorException .BadRequest badRequest ) {
154
- assertThat (badRequest .getMessage ()).isEqualTo ("400 on POST request for \" http://localhost:8990\" : \" Format not supported: Invalid format, supported types are: avro\" " );
154
+ assertThat (badRequest .getMessage ()).contains ("Format not supported: Invalid format, supported types are: avro" );
155
+ assertThat (badRequest .getMessage ()).contains ("400" );
155
156
}
156
157
157
158
}
@@ -164,7 +165,8 @@ public void invalidSchema() {
164
165
fail ("Expects: " + HttpStatus .BAD_REQUEST + " error" );
165
166
}
166
167
catch (HttpClientErrorException .BadRequest badRequest ) {
167
- assertThat (badRequest .getMessage ()).isEqualTo ("400 on POST request for \" http://localhost:8990\" : \" Invalid Schema: No type: {}\" " );
168
+ assertThat (badRequest .getMessage ()).contains ("\" Invalid Schema: No type: {}\" " );
169
+ assertThat (badRequest .getMessage ()).contains ("400" );
168
170
}
169
171
170
172
}
@@ -178,8 +180,8 @@ public void invalidSchemaGh22() {
178
180
fail ("Expects: " + HttpStatus .BAD_REQUEST + " error" );
179
181
}
180
182
catch (HttpClientErrorException .BadRequest badRequest ) {
181
- assertThat (badRequest .getMessage ()).isEqualTo ( "400 on POST request for \" http://localhost:8990 \" : " +
182
- " \" Invalid Schema: \" SomeType \" is not a defined name. The type of the \" field \" field must be a defined name or a { \" type \" : ...} expression. \" " );
183
+ assertThat (badRequest .getMessage ()).contains ( " \" Invalid Schema: \" SomeType \" is not a defined name" );
184
+ assertThat ( badRequest . getMessage ()). contains ( "400 " );
183
185
}
184
186
185
187
}
@@ -223,8 +225,8 @@ public void findByIdNotFound() {
223
225
fail ("Expects: " + HttpStatus .NOT_FOUND + " error" );
224
226
}
225
227
catch (HttpClientErrorException .NotFound notFound ) {
226
- assertThat (notFound .getMessage ()).isEqualTo ( "404 on GET request for \" http://localhost:8990/schemas/2 \" : " +
227
- " \" Schema not found: Could not find Schema by id: 2 \" " );
228
+ assertThat (notFound .getMessage ()).contains ( "Could not find Schema by id: 2" );
229
+ assertThat ( notFound . getMessage ()). contains ( "404 " );
228
230
}
229
231
}
230
232
@@ -269,8 +271,8 @@ public void schemaDeletionBySubjectFormatVersion() {
269
271
this .client .getForEntity (subjectFormatVersionUri , Schema .class );
270
272
}
271
273
catch (HttpClientErrorException .NotFound notFound ) {
272
- assertThat (notFound .getMessage ()).isEqualTo ("404 on GET request for \" http://localhost:8990/user/avro/v1 \" : " +
273
- " \" Schema not found: Could not find Schema by subject: user, format: avro, version 1\" " );
274
+ assertThat (notFound .getMessage ()).contains ("404" );
275
+ assertThat ( notFound . getMessage ()). contains ( " Schema not found: Could not find Schema by subject: user, format: avro, version 1" );
274
276
}
275
277
276
278
}
@@ -291,8 +293,8 @@ public void schemaDeletionBySubjectFormatVersionNotFound() {
291
293
this .client .exchange (new RequestEntity <>(HttpMethod .DELETE , subjectFormatVersionUri ), Void .class );
292
294
}
293
295
catch (HttpClientErrorException .NotFound notFound ) {
294
- assertThat (notFound .getMessage ()).isEqualTo ("404 on DELETE request for \" http://localhost:8990/user/avro/v100 \" : " +
295
- " \" Schema not found: Could not find Schema by subject: user, format: avro, version 100\" " );
296
+ assertThat (notFound .getMessage ()).contains ("404" );
297
+ assertThat ( notFound . getMessage ()). contains ( " Schema not found: Could not find Schema by subject: user, format: avro, version 100" );
296
298
}
297
299
298
300
}
@@ -309,8 +311,8 @@ public void schemaDeletionBySubjectFormatVersionNotAllowed() {
309
311
this .client .exchange (new RequestEntity <>(HttpMethod .DELETE , versionUri ), Void .class );
310
312
}
311
313
catch (HttpClientErrorException .MethodNotAllowed methodNotAllowed ) {
312
- assertThat (methodNotAllowed .getMessage ()).isEqualTo ("405 on DELETE request for \" http://localhost:8990/user/avro/v1 \" : " +
313
- " \" Schema deletion is not permitted: Not permitted deletion of Schema by subject: user, format: avro, version 1\" " );
314
+ assertThat (methodNotAllowed .getMessage ()).contains ("405" );
315
+ assertThat ( methodNotAllowed . getMessage ()). contains ( " Schema deletion is not permitted: Not permitted deletion of Schema by subject: user, format: avro, version 1" );
314
316
}
315
317
316
318
}
@@ -330,8 +332,8 @@ public void schemaDeletionById() {
330
332
fail ("Expects: " + HttpStatus .NOT_FOUND + " error" );
331
333
}
332
334
catch (HttpClientErrorException .NotFound notFound ) {
333
- assertThat (notFound .getMessage ()).isEqualTo ( "404 on GET request for \" http://localhost:8990/ user/ avro/v1 \" : " +
334
- " \" Schema not found: Could not find Schema by subject: user, format: avro, version 1 \" " );
335
+ assertThat (notFound .getMessage ()).contains ( "Schema not found: Could not find Schema by subject: user, format: avro, version 1 \" " );
336
+ assertThat ( notFound . getMessage ()). contains ( "404 " );
335
337
}
336
338
337
339
}
@@ -349,7 +351,8 @@ public void schemaDeletionByIdNotFound() {
349
351
fail ("Expects: " + HttpStatus .NOT_FOUND + " error" );
350
352
}
351
353
catch (HttpClientErrorException .NotFound notFound ) {
352
- assertThat (notFound .getMessage ()).isEqualTo ("404 on DELETE request for \" http://localhost:8990/schemas/2\" : \" Schema not found: Could not find Schema by id: 2\" " );
354
+ assertThat (notFound .getMessage ()).contains ("Schema not found: Could not find Schema by id: 2\" " );
355
+ assertThat (notFound .getMessage ()).contains ("404" );
353
356
}
354
357
355
358
}
@@ -368,8 +371,8 @@ public void schemaDeletionByIdNotAllowed() {
368
371
fail ("Expects: " + HttpStatus .METHOD_NOT_ALLOWED + " error" );
369
372
}
370
373
catch (HttpClientErrorException .MethodNotAllowed methodNotAllowed ) {
371
- assertThat (methodNotAllowed .getMessage ()).isEqualTo ( "405 on DELETE request for \" http://localhost:8990/schemas/1 \" : " +
372
- " \" Schema deletion is not permitted: Not permitted deletion of Schema by id: 1 \" " );
374
+ assertThat (methodNotAllowed .getMessage ()).contains ( "Not permitted deletion of Schema by id: 1" );
375
+ assertThat ( methodNotAllowed . getMessage ()). contains ( "405 " );
373
376
}
374
377
375
378
}
@@ -439,8 +442,8 @@ public void schemaDeletionBySubjectNotAllowed() {
439
442
fail ("Expects: " + HttpStatus .METHOD_NOT_ALLOWED + " error" );
440
443
}
441
444
catch (HttpClientErrorException .MethodNotAllowed methodNotAllowed ) {
442
- assertThat (methodNotAllowed .getMessage ()).isEqualTo ("405 on DELETE request for \" http://localhost:8990/user \" : " +
443
- " \" Schema deletion is not permitted: Not permitted deletion of Schema by subject: user\" " );
445
+ assertThat (methodNotAllowed .getMessage ()).contains ("405" );
446
+ assertThat ( methodNotAllowed . getMessage ()). contains ( " Schema deletion is not permitted: Not permitted deletion of Schema by subject: user" );
444
447
}
445
448
446
449
}
0 commit comments