@Test public void shouldUseInjectedClientConfigurationIfSatisfied() throws ServletException { CloseableHttpClient mockHttpClient = mock(CloseableHttpClient.class, Mockito.RETURNS_DEEP_STUBS); LightblueClientConfiguration config = new LightblueClientConfiguration(); AbstractLightblueProxyServlet servlet = getTestServlet(mockHttpClient, config, null, null); assertSame(config, servlet.configuration()); }
@Test public void shouldDefaultToDefaultPropertiesFileForClientConfigIfNoneIsInjected() throws ServletException { CloseableHttpClient mockHttpClient = mock(CloseableHttpClient.class, Mockito.RETURNS_DEEP_STUBS); ServletConfig servletConfig = new FakeServletConfig().setServletContext(mock(ServletContext.class)); AbstractLightblueProxyServlet servlet = getTestServlet(mockHttpClient, null, null, servletConfig); LightblueClientConfiguration expected = PropertiesLightblueClientConfiguration.fromDefault(); assertEquals(expected, servlet.configuration()); }