Skip to content

Commit

Permalink
feat: TSYSTEMS-196
Browse files Browse the repository at this point in the history
spotless:apply
  • Loading branch information
Leandro13Silva13 committed Jan 22, 2025
1 parent 644da71 commit 4061eec
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ void mapAuthorities_Should_returnGrantedConsultantAuthority_When_authorityIsCons
}

@Test
void
mapAuthorities_Should_returnGrantedConsultantAuthority_When_authoritiesContainConsultant() {
void mapAuthorities_Should_returnGrantedConsultantAuthority_When_authoritiesContainConsultant() {
List<GrantedAuthority> grantedAuthorities =
Stream.of("a", "v", ROLE_CONSULTANT, "c")
.map(SimpleGrantedAuthority::new)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ class CustomResponseErrorHandlerTest {
private final CustomResponseErrorHandler errorHandler = new CustomResponseErrorHandler();

@Test
void
handleError_Should_throwInternalServerErrorException_When_responseStatusIsNotLoopThrough() {
void handleError_Should_throwInternalServerErrorException_When_responseStatusIsNotLoopThrough() {
assertThrows(
InternalServerErrorException.class,
() -> {
Expand All @@ -40,9 +39,8 @@ class CustomResponseErrorHandlerTest {
}

@Test
void
handleError_Should_throwExpectedResponseStatusException_When_responseStatusIsForbidden()
throws Exception {
void handleError_Should_throwExpectedResponseStatusException_When_responseStatusIsForbidden()
throws Exception {
URL url = new URL("http://test.de");
when(httpResponse.getStatusCode()).thenReturn(HttpStatus.FORBIDDEN);

Expand All @@ -56,9 +54,8 @@ class CustomResponseErrorHandlerTest {
}

@Test
void
handleError_Should_throwExpectedResponseStatusException_When_responseStatusIsNotFound()
throws Exception {
void handleError_Should_throwExpectedResponseStatusException_When_responseStatusIsNotFound()
throws Exception {
URL url = new URL("http://test.de");
when(httpResponse.getStatusCode()).thenReturn(HttpStatus.NOT_FOUND);

Expand All @@ -80,9 +77,8 @@ private void handleErrorPost(URL url) throws IOException, URISyntaxException {
}

@Test
void
handleError_Should_throwExpectedResponseStatusException_When_responseStatusIsBadRequest()
throws Exception {
void handleError_Should_throwExpectedResponseStatusException_When_responseStatusIsBadRequest()
throws Exception {
URL url = new URL("http://test.de");
when(httpResponse.getStatusCode()).thenReturn(HttpStatus.BAD_REQUEST);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,7 @@ void createVideoCall_Should_ReturnCreated_When_EverythingSucceeded() throws Exce
}

@Test
void createVideoCall_Should_ReturnUnauthorized_When_AuthorizationIsMissing()
throws Exception {
void createVideoCall_Should_ReturnUnauthorized_When_AuthorizationIsMissing() throws Exception {

when(videoCallFacade.startVideoCall(any(), anyString()))
.thenReturn(CREATE_VIDEO_CALL_RESPONSE_DTO);
Expand All @@ -95,9 +94,8 @@ void createVideoCall_Should_ReturnUnauthorized_When_AuthorizationIsMissing()

@Test
@WithMockUser()
void
createVideoCall_Should_ReturnForbiddenAndCallNoMethods_WhenNoConsultantDefaultAuthority()
throws Exception {
void createVideoCall_Should_ReturnForbiddenAndCallNoMethods_WhenNoConsultantDefaultAuthority()
throws Exception {

mvc.perform(
post(PATH_START_VIDEO_CALL)
Expand All @@ -113,8 +111,7 @@ void createVideoCall_Should_ReturnUnauthorized_When_AuthorizationIsMissing()

@Test
@WithMockUser(authorities = AUTHORITY_CONSULTANT)
void createVideoCall_Should_ReturnForbiddenAndCallNoMethods_WhenNoCsrfTokens()
throws Exception {
void createVideoCall_Should_ReturnForbiddenAndCallNoMethods_WhenNoCsrfTokens() throws Exception {

mvc.perform(
post(PATH_START_VIDEO_CALL)
Expand Down Expand Up @@ -156,8 +153,7 @@ void stopVideoCallShouldReturnForbiddenAndCallNoMethodsWhenNoConsultantDefaultAu

@Test
@WithMockUser(authorities = AUTHORITY_CONSULTANT)
void stopVideoCallShouldReturnForbiddenAndCallNoMethodsWhenNoCsrfTokens()
throws Exception {
void stopVideoCallShouldReturnForbiddenAndCallNoMethodsWhenNoCsrfTokens() throws Exception {
var path = "/videocalls/stop/" + easyRandom.nextInt(100);

mvc.perform(
Expand All @@ -172,8 +168,7 @@ void stopVideoCallShouldReturnForbiddenAndCallNoMethodsWhenNoCsrfTokens()

@Test
@WithMockUser(authorities = {AUTHORITY_USER})
void rejectVideoCall_Should_ReturnForbiddenAndCallNoMethods_WhenNoCsrfTokens()
throws Exception {
void rejectVideoCall_Should_ReturnForbiddenAndCallNoMethods_WhenNoCsrfTokens() throws Exception {
String content =
new ObjectMapper()
.writeValueAsString(
Expand All @@ -194,8 +189,7 @@ void rejectVideoCall_Should_ReturnForbiddenAndCallNoMethods_WhenNoCsrfTokens()

@Test
@WithMockUser(authorities = {"NO_AUTHORITY"})
void rejectVideoCall_Should_ReturnForbiddenAndCallNoMethods_WhenNoAuthority()
throws Exception {
void rejectVideoCall_Should_ReturnForbiddenAndCallNoMethods_WhenNoAuthority() throws Exception {
String content =
new ObjectMapper()
.writeValueAsString(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,7 @@ void createVideoCall_Should_ReturnBadRequest_When_RcUserIdIsMissing() throws Exc
}

@Test
void rejectVideoCall_Should_ReturnBadRequest_When_VideoCallRejectDtoIsNull()
throws Exception {
void rejectVideoCall_Should_ReturnBadRequest_When_VideoCallRejectDtoIsNull() throws Exception {

mvc.perform(
post(PATH_REJECT_VIDEO_CALL)
Expand All @@ -110,8 +109,7 @@ void rejectVideoCall_Should_ReturnBadRequest_When_VideoCallRejectDtoIsNull()
}

@Test
void rejectVideoCall_Should_ReturnBadRequest_When_VideoCallRejectDtoIsEmpty()
throws Exception {
void rejectVideoCall_Should_ReturnBadRequest_When_VideoCallRejectDtoIsEmpty() throws Exception {

mvc.perform(
post(PATH_REJECT_VIDEO_CALL)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@ void generateVideoCallUrls_Should_generateExpectedVideoCallUrls_When_askerNameIs
}

@Test
void
generateVideoCallUrls_Should_throwInternalServerErrorException_When_videoUrlIsInvalid() {
void generateVideoCallUrls_Should_throwInternalServerErrorException_When_videoUrlIsInvalid() {
assertThrows(
InternalServerErrorException.class,
() -> {
Expand Down

0 comments on commit 4061eec

Please sign in to comment.