Skip to content

Commit

Permalink
[SELC-6086] clean tests and remove unused swagger reference
Browse files Browse the repository at this point in the history
  • Loading branch information
flaminiaScarciofolo committed Nov 28, 2024
1 parent 28390e5 commit be75734
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 29 deletions.
1 change: 0 additions & 1 deletion web/src/main/resources/swagger/swagger_en.properties
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ swagger.dashboard.user.model.name=User's name
swagger.dashboard.user.model.surname=User's surname
swagger.dashboard.user.model.birthDate=User's birth date
swagger.dashboard.user.model.email=User's personal email
swagger.dashboard.user.model.phone=User's personal phone Number
swagger.dashboard.user.model.workContacts=User's workcontacts, contains the emails associated to every institution the user is assigned to
swagger.dashboard.user.model.institutionalEmail=User's institutional email
swagger.dashboard.user.model.institutionalPhone=User's institutional phone number
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -409,31 +409,6 @@ void search_EmptyObject() throws Exception {
Mockito.verifyNoMoreInteractions(userServiceMock);
}

@Test
void updateUser_EmptyObject() throws Exception {
//given
final String id = "userId";
final String institutionId = "institutionId";

byte[] userStream = Files.readAllBytes(Paths.get("src/test/resources/stubs/updateUserDto.json"));
UpdateUserDto updateUserDto = objectMapper.readValue(userStream, UpdateUserDto.class);

//when
mockMvc.perform(MockMvcRequestBuilders
.put(BASE_URL + "/{id}", id)
.queryParam("institutionId", institutionId)
.content(userStream)
.contentType(MediaType.APPLICATION_JSON_VALUE)
.accept(MediaType.APPLICATION_JSON_VALUE))
.andExpect(status().isNoContent())
.andExpect(content().string(emptyString()));
//then
verify(userServiceMock, times(1))
.updateUser(id, institutionId, userMapper.fromUpdateUser(updateUserDto));

Mockito.verifyNoMoreInteractions(userServiceMock);
}

@Test
void getUsers_institutionIdProductIdValid_EmptyObject() throws Exception {
// given
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import java.util.HashMap;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;

import static org.junit.jupiter.api.Assertions.assertTrue;

Expand Down Expand Up @@ -46,7 +45,7 @@ void validateNullFields() {
Class<? extends Annotation> annotationToCheck = toCheckMap.get(violation.getPropertyPath().toString());
return !violation.getConstraintDescriptor().getAnnotation().annotationType().equals(annotationToCheck);
})
.collect(Collectors.toList());
.toList();
assertTrue(filteredViolations.isEmpty());
}

Expand Down Expand Up @@ -79,7 +78,7 @@ void validate_emailFieldsNotValid() {
Class<? extends Annotation> annotationToCheck = toCheckMap.get(violation.getPropertyPath().toString());
return !violation.getConstraintDescriptor().getAnnotation().annotationType().equals(annotationToCheck);
})
.collect(Collectors.toList());
.toList();
assertTrue(filteredViolations.isEmpty());
}

Expand Down

0 comments on commit be75734

Please sign in to comment.