Skip to content

Commit

Permalink
chore: renamed testclass and optimized assertion
Browse files Browse the repository at this point in the history
  • Loading branch information
mebo4b committed Apr 29, 2022
1 parent f01842f commit 094525d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,10 @@ public class RejectVideoCallServiceTest {

@Test
public void rejectVideoCall_Should_useServicesCorrectly() {
var securityHeaders = new HttpHeaders();
when(this.messageControllerApi.getApiClient()).thenReturn(this.apiClient);
when(this.securityHeaderSupplier.getKeycloakAndCsrfHttpHeaders()).thenReturn(new HttpHeaders());
RejectVideoCallDTO rejectVideoCallDto = new EasyRandom().nextObject(RejectVideoCallDTO.class);
when(this.securityHeaderSupplier.getKeycloakAndCsrfHttpHeaders()).thenReturn(securityHeaders);
var rejectVideoCallDto = new EasyRandom().nextObject(RejectVideoCallDTO.class);

this.rejectVideoCallService.rejectVideoCall(rejectVideoCallDto);

Expand All @@ -49,7 +50,7 @@ public void rejectVideoCall_Should_useServicesCorrectly() {
.initiatorUserName(rejectVideoCallDto.getInitiatorUsername())
.initiatorRcUserId(rejectVideoCallDto.getInitiatorRcUserId());
verify(this.securityHeaderSupplier).getKeycloakAndCsrfHttpHeaders();
verify(this.tenantHeaderSupplier).addTenantHeader(any());
verify(this.tenantHeaderSupplier).addTenantHeader(securityHeaders);
verify(this.messageControllerApi)
.createVideoHintMessage(rejectVideoCallDto.getRcGroupId(), expectedMessage);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;

class TenantHeaderSupplierSupplierTest {
class TenantHeaderSupplierTest {

private final TenantHeaderSupplier tenantHeaderSupplier = new TenantHeaderSupplier();

Expand Down

0 comments on commit 094525d

Please sign in to comment.