Search in sources :

Example 1 with ProxyDetails

use of com.sequenceiq.cloudbreak.structuredevent.event.cdp.environment.proxy.ProxyDetails in project cloudbreak by hortonworks.

the class EnvironmentDetailsToCDPNetworkDetailsConverterTest method testConversionProxyWhenProxyPresentedShouldReturnProxyTrueNoAuth.

@Test
public void testConversionProxyWhenProxyPresentedShouldReturnProxyTrueNoAuth() {
    ProxyDetails proxyDetails = ProxyDetails.Builder.builder().withEnabled(true).withProtocol("https").withAuthentication(false).build();
    when(environmentDetails.getProxyDetails()).thenReturn(proxyDetails);
    UsageProto.CDPNetworkDetails networkDetails = underTest.convert(environmentDetails);
    Assert.assertEquals(true, networkDetails.getProxyDetails().getProxy());
    Assert.assertEquals("https", networkDetails.getProxyDetails().getProtocol());
    Assert.assertEquals("NONE", networkDetails.getProxyDetails().getAuthentication());
}
Also used : ProxyDetails(com.sequenceiq.cloudbreak.structuredevent.event.cdp.environment.proxy.ProxyDetails) UsageProto(com.cloudera.thunderhead.service.common.usage.UsageProto) Test(org.junit.jupiter.api.Test)

Example 2 with ProxyDetails

use of com.sequenceiq.cloudbreak.structuredevent.event.cdp.environment.proxy.ProxyDetails in project cloudbreak by hortonworks.

the class EnvironmentDetailsToCDPNetworkDetailsConverterTest method testConversionProxyWhenProxyPresentedShouldReturnProxyTrueWithAuth.

@Test
public void testConversionProxyWhenProxyPresentedShouldReturnProxyTrueWithAuth() {
    ProxyDetails proxyDetails = ProxyDetails.Builder.builder().withEnabled(true).withProtocol("http").withAuthentication(true).build();
    when(environmentDetails.getProxyDetails()).thenReturn(proxyDetails);
    UsageProto.CDPNetworkDetails networkDetails = underTest.convert(environmentDetails);
    Assert.assertEquals(true, networkDetails.getProxyDetails().getProxy());
    Assert.assertEquals("http", networkDetails.getProxyDetails().getProtocol());
    Assert.assertEquals("BASIC", networkDetails.getProxyDetails().getAuthentication());
}
Also used : ProxyDetails(com.sequenceiq.cloudbreak.structuredevent.event.cdp.environment.proxy.ProxyDetails) UsageProto(com.cloudera.thunderhead.service.common.usage.UsageProto) Test(org.junit.jupiter.api.Test)

Aggregations

UsageProto (com.cloudera.thunderhead.service.common.usage.UsageProto)2 ProxyDetails (com.sequenceiq.cloudbreak.structuredevent.event.cdp.environment.proxy.ProxyDetails)2 Test (org.junit.jupiter.api.Test)2