@Test
public void buildShouldUseHttpURLConnectionHttpChannelFactory() throws Exception{

    CRestConfig config = mockCRestConfig(false);
    HttpURLConnectionHttpChannelFactory expected = mock(HttpURLConnectionHttpChannelFactory.class);
    mockStatic(ComponentFactory.class);
    when(ComponentFactory.instantiate(HttpURLConnectionHttpChannelFactory.class, config)).thenReturn(expected);
    CRest actual = toTest.build();
    RequestExecutor retryingRequestExecutor = getFieldValue(actual, "requestExecutor");
    assertEquals(RetryingRequestExecutor.class, retryingRequestExecutor.getClass());
    RequestExecutor httpRequestExecutor = getFieldValue(retryingRequestExecutor, "delegate");
    assertSame(HttpRequestExecutor.class, httpRequestExecutor.getClass());
    HttpChannelFactory channelFactory = getFieldValue(httpRequestExecutor, "channelFactory");
    assertSame(expected, channelFactory);
    verifyNew(DefaultCRestConfig.class).withArguments(baseCRestProperties());
}