Search in sources :

Example 16 with ProxyResponse

use of com.sequenceiq.environment.api.v1.proxy.model.response.ProxyResponse in project cloudbreak by hortonworks.

the class ProxyConfigDtoServiceTest method testGetWhenProxyConfigUserPasswordSecretsAreEmpty.

@ParameterizedTest
@MethodSource("invalidUserPasswordSecrets")
void testGetWhenProxyConfigUserPasswordSecretsAreEmpty(SecretResponse user, SecretResponse password) {
    String name = "aProxyConfig";
    String host = "https://test.cloudera.com";
    Integer port = 8443;
    ProxyResponse proxyResponse = new ProxyResponse();
    proxyResponse.setName(name);
    proxyResponse.setHost(host);
    proxyResponse.setPort(port);
    proxyResponse.setUserName(user);
    proxyResponse.setPassword(password);
    when(regionAwareInternalCrnGenerator.getInternalCrnForServiceAsString()).thenReturn("crn");
    when(regionAwareInternalCrnGeneratorFactory.iam()).thenReturn(regionAwareInternalCrnGenerator);
    when(environmentServiceCrnClient.withCrn(anyString()).proxyV1Endpoint()).thenReturn(proxyEndpoint);
    when(proxyEndpoint.getByResourceCrn(anyString())).thenReturn(proxyResponse);
    ProxyConfig proxyConfig = underTest.getByCrn("crn:cdp:environments:us-west-1:cloudera:proxyconfig:a2f0bee2-059e-433f-a9d0-2893c53419ad");
    assertFalse(proxyConfig.getProxyAuthentication().isPresent());
}
Also used : ProxyResponse(com.sequenceiq.environment.api.v1.proxy.model.response.ProxyResponse) ArgumentMatchers.anyString(org.mockito.ArgumentMatchers.anyString) ProxyConfig(com.sequenceiq.cloudbreak.dto.ProxyConfig) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) MethodSource(org.junit.jupiter.params.provider.MethodSource)

Aggregations

ProxyResponse (com.sequenceiq.environment.api.v1.proxy.model.response.ProxyResponse)15 Test (org.junit.jupiter.api.Test)9 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)6 SpringBootTest (org.springframework.boot.test.context.SpringBootTest)6 ArgumentMatchers.anyString (org.mockito.ArgumentMatchers.anyString)5 ProxyConfig (com.sequenceiq.cloudbreak.dto.ProxyConfig)3 SecretResponse (com.sequenceiq.cloudbreak.service.secret.model.SecretResponse)3 CheckPermissionByAccount (com.sequenceiq.authorization.annotation.CheckPermissionByAccount)2 TelemetryResponse (com.sequenceiq.common.api.telemetry.response.TelemetryResponse)2 CredentialResponse (com.sequenceiq.environment.api.v1.credential.model.response.CredentialResponse)2 CompactRegionResponse (com.sequenceiq.environment.api.v1.environment.model.response.CompactRegionResponse)2 EnvironmentNetworkResponse (com.sequenceiq.environment.api.v1.environment.model.response.EnvironmentNetworkResponse)2 FreeIpaResponse (com.sequenceiq.environment.api.v1.environment.model.response.FreeIpaResponse)2 ProxyRequest (com.sequenceiq.environment.api.v1.proxy.model.request.ProxyRequest)2 EnvironmentDto (com.sequenceiq.environment.environment.dto.EnvironmentDto)2 ProxyConfig (com.sequenceiq.environment.proxy.domain.ProxyConfig)2 ProxyTestSource.getProxyConfig (com.sequenceiq.environment.proxy.v1.ProxyTestSource.getProxyConfig)2 ProxyTestSource.getProxyRequest (com.sequenceiq.environment.proxy.v1.ProxyTestSource.getProxyRequest)2 EnumSource (org.junit.jupiter.params.provider.EnumSource)2 MethodSource (org.junit.jupiter.params.provider.MethodSource)2