Skip to content

Commit

Permalink
Fix other exceptions in tests related to (geonetwork#6977)
Browse files Browse the repository at this point in the history
  • Loading branch information
ianwallen committed Oct 30, 2023
1 parent 511e798 commit 3cda243
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ public void addExistingService() throws Exception {
.session(this.mockHttpSession)
.accept(MediaType.parseMediaType("application/json")))
.andExpect(status().is(400))
.andExpect(jsonPath("$.description", is("A service already exist with this name 'csw-endpoint1'. Choose another name.")));
.andExpect(jsonPath("$.message", is("A service already exist with this name 'csw-endpoint1'. Choose another name.")));
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ public void updateInvalidNameGroup() throws Exception {
}
})
.andExpect(status().is(400))
.andExpect(jsonPath("$.description", is("Group name may only contain alphanumeric "
.andExpect(jsonPath("$.message", is("Group name may only contain alphanumeric "
+ "characters or single hyphens. Cannot begin or end with a hyphen.")));
}
}
Expand Down Expand Up @@ -364,7 +364,7 @@ public void addGroupInvalidName() throws Exception {
}
})
.andExpect(status().is(400))
.andExpect(jsonPath("$.description", is("Group name may only contain alphanumeric "
.andExpect(jsonPath("$.message", is("Group name may only contain alphanumeric "
+ "characters or single hyphens. Cannot begin or end with a hyphen.")));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ public void subTemplateValidIsTrueButNotLoggedAsAdmin() throws Exception {
.accept(MediaType.APPLICATION_JSON))
.andExpect(status().is4xxClientError())
.andExpect(content().contentType(API_JSON_EXPECTED_ENCODING))
.andExpect(jsonPath("$.message").value("SecurityException"));
.andExpect(jsonPath("$.message").value("User anonymous can't edit record with UUID " + subTemplate.getUuid()));

List<MetadataValidation> validations = metadataValidationRepository.findAllById_MetadataId(subTemplate.getId());
assertEquals(0, validations.size());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ public void createUserInvalidUsername() throws Exception {
System.err.println(invalidName + " has been accepted as user name and it shouldn't");
}
})
.andExpect(jsonPath("$.description", is("username may only contain alphanumeric "
.andExpect(jsonPath("$.message", is("username may only contain alphanumeric "
+ "characters or single hyphens, single at signs or single dots. Cannot begin or end with a "
+ "hyphen, at sign or dot.")))
.andExpect(status().is(400));
Expand Down Expand Up @@ -608,7 +608,7 @@ public void updateUserInvalidUsername() throws Exception {
}
})
.andExpect(status().is(400))
.andExpect(jsonPath("$.description", is("username may only contain alphanumeric "
.andExpect(jsonPath("$.message", is("username may only contain alphanumeric "
+ "characters or single hyphens, single at signs or single dots. Cannot begin or end with a "
+ "hyphen, at sign or dot.")));
}
Expand Down

0 comments on commit 3cda243

Please sign in to comment.