Skip to content

Commit

Permalink
SONARLINT
Browse files Browse the repository at this point in the history
  • Loading branch information
sumathi-thirumani committed Oct 8, 2024
1 parent 06c89fa commit fca0be9
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
*/
@ActiveProfiles("test")
@AutoConfigureMockMvc
public class SessionControllerTest extends BaseEasAPITest {
class SessionControllerTest extends BaseEasAPITest {

protected static final ObjectMapper objectMapper = JsonMapper.builder().addModule(new JavaTimeModule()).build();
@Autowired
Expand Down Expand Up @@ -84,7 +84,7 @@ void testSessionManagement_GetAllSessions_ShouldReturnOK() throws Exception {
final GrantedAuthority grantedAuthority = () -> "SCOPE_READ_EAS_SESSIONS";
final SecurityMockMvcRequestPostProcessors.OidcLoginRequestPostProcessor mockAuthority = oidcLogin().authorities(grantedAuthority);
SessionEntity SessionEntity = sessionRepository.save(createMockSessionEntity());
var resultSessions = this.mockMvc.perform(
this.mockMvc.perform(
get(URL.SESSIONS_URL).with(mockAuthority))
.andDo(print()).andExpect(status().isOk())
.andExpect(MockMvcResultMatchers.jsonPath("$.[0].courseSession").value(LocalDateTime.now().getYear() + "" + LocalDateTime.now().getMonthValue()))
Expand All @@ -99,7 +99,7 @@ void testSessionManagement_UpdateSession_ShouldReturnOK() throws Exception {
updatedSession.setActiveFromDate(LocalDateTime.now().plusDays(20));
updatedSession.setActiveUntilDate(LocalDateTime.now().plusDays(120));
updatedSession.setUpdateUser("test");
ResultActions resultActions = this.mockMvc.perform(put(URL.SESSIONS_URL + "/" + sessionEntity.getAssessmentSessionID())
this.mockMvc.perform(put(URL.SESSIONS_URL + "/" + sessionEntity.getAssessmentSessionID())
.with(jwt().jwt(jwt -> jwt.claim("scope", "WRITE_EAS_SESSIONS")))
.content(objectMapper.writeValueAsString(updatedSession))
.contentType(APPLICATION_JSON)).andExpect(status().isOk());
Expand Down

0 comments on commit fca0be9

Please sign in to comment.