Search in sources :

Example 1 with MatchingServiceConfigEntityDataDtoBuilder.aMatchingServiceConfigEntityDataDto

use of uk.gov.ida.hub.samlsoapproxy.builders.MatchingServiceConfigEntityDataDtoBuilder.aMatchingServiceConfigEntityDataDto in project verify-hub by alphagov.

the class MatchingServiceHealthCheckHandlerTest method handle_shouldReturnSuccessWhenMatchingServiceIsHealthy.

@Test
public void handle_shouldReturnSuccessWhenMatchingServiceIsHealthy() {
    MatchingServiceConfigEntityDataDto matchingServiceConfigEntityDataDto = MatchingServiceConfigEntityDataDtoBuilder.aMatchingServiceConfigEntityDataDto().build();
    when(matchingServiceConfigProxy.getMatchingServices()).thenReturn(singletonList(matchingServiceConfigEntityDataDto));
    when(matchingServiceHealthChecker.performHealthCheck(matchingServiceConfigEntityDataDto)).thenReturn(MatchingServiceHealthCheckResult.healthy(MatchingServiceHealthCheckDetailsBuilder.aMatchingServiceHealthCheckDetails().build()));
    AggregatedMatchingServicesHealthCheckResult result = matchingServiceHealthCheckHandler.handle();
    assertThat(result.isHealthy()).isEqualTo(true);
}
Also used : MatchingServiceConfigEntityDataDto(uk.gov.ida.hub.samlsoapproxy.contract.MatchingServiceConfigEntityDataDto) MatchingServiceConfigEntityDataDtoBuilder.aMatchingServiceConfigEntityDataDto(uk.gov.ida.hub.samlsoapproxy.builders.MatchingServiceConfigEntityDataDtoBuilder.aMatchingServiceConfigEntityDataDto) Test(org.junit.jupiter.api.Test)

Example 2 with MatchingServiceConfigEntityDataDtoBuilder.aMatchingServiceConfigEntityDataDto

use of uk.gov.ida.hub.samlsoapproxy.builders.MatchingServiceConfigEntityDataDtoBuilder.aMatchingServiceConfigEntityDataDto in project verify-hub by alphagov.

the class MatchingServiceHealthCheckHandlerTest method handle_shouldReturnSuccessWhenMatchingServiceIsNotHealthy.

@Test
public void handle_shouldReturnSuccessWhenMatchingServiceIsNotHealthy() {
    MatchingServiceConfigEntityDataDto matchingServiceConfigEntityDataDto = MatchingServiceConfigEntityDataDtoBuilder.aMatchingServiceConfigEntityDataDto().build();
    when(matchingServiceConfigProxy.getMatchingServices()).thenReturn(singletonList(matchingServiceConfigEntityDataDto));
    when(matchingServiceHealthChecker.performHealthCheck(matchingServiceConfigEntityDataDto)).thenReturn(MatchingServiceHealthCheckResult.unhealthy(MatchingServiceHealthCheckDetailsBuilder.aMatchingServiceHealthCheckDetails().build()));
    AggregatedMatchingServicesHealthCheckResult result = matchingServiceHealthCheckHandler.handle();
    assertThat(result.isHealthy()).isEqualTo(false);
}
Also used : MatchingServiceConfigEntityDataDto(uk.gov.ida.hub.samlsoapproxy.contract.MatchingServiceConfigEntityDataDto) MatchingServiceConfigEntityDataDtoBuilder.aMatchingServiceConfigEntityDataDto(uk.gov.ida.hub.samlsoapproxy.builders.MatchingServiceConfigEntityDataDtoBuilder.aMatchingServiceConfigEntityDataDto) Test(org.junit.jupiter.api.Test)

Aggregations

Test (org.junit.jupiter.api.Test)2 MatchingServiceConfigEntityDataDtoBuilder.aMatchingServiceConfigEntityDataDto (uk.gov.ida.hub.samlsoapproxy.builders.MatchingServiceConfigEntityDataDtoBuilder.aMatchingServiceConfigEntityDataDto)2 MatchingServiceConfigEntityDataDto (uk.gov.ida.hub.samlsoapproxy.contract.MatchingServiceConfigEntityDataDto)2