fix more test

This commit is contained in:
Paulo Gustavo Veiga 2024-01-22 23:18:25 -08:00
parent 56e4970861
commit ccfcb3b335

View File

@ -401,12 +401,9 @@ public class RestMindmapControllerTest {
final URI resourceUri = addNewMap(restTemplate, "deleteCollabsWithInvalidEmail"); final URI resourceUri = addNewMap(restTemplate, "deleteCollabsWithInvalidEmail");
// Remove with invalid email ... // Remove with invalid email ...
try { final ResponseEntity<String> exchange = restTemplate.exchange(resourceUri + "/collabs?email=invalidEmail", HttpMethod.DELETE, null, String.class);
restTemplate.delete(resourceUri + "/collabs?email=invalidEmail"); assertTrue(exchange.getStatusCode().is4xxClientError());
} catch (HttpClientErrorException e) { assertTrue(Objects.requireNonNull(exchange.getBody()).contains("Invalid email exception:"));
assertEquals(e.getRawStatusCode(), 400);
assertTrue(e.getMessage().contains("Invalid email exception:"));
}
// Check that it has been removed ... // Check that it has been removed ...
final ResponseEntity<RestCollaborationList> afterDeleteResponse = fetchCollabs(requestHeaders, restTemplate, resourceUri); final ResponseEntity<RestCollaborationList> afterDeleteResponse = fetchCollabs(requestHeaders, restTemplate, resourceUri);