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());
}
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());
}
Aggregations