@Test public void shouldReturnBlankUrlForNullOrBlankServerUrl() { when(motechSettings.getServerUrl()).thenReturn(null); assertEquals("", configService.getBaseUrl()); when(motechSettings.getServerUrl()).thenReturn(""); assertEquals("", configService.getBaseUrl()); }
@Test public void shouldReturnBaseUrl() { when(motechSettings.getServerUrl()).thenReturn("http://demo.motechproject.org"); assertEquals("http://demo.motechproject.org/module/commcare/", configService.getBaseUrl()); when(motechSettings.getServerUrl()) .thenReturn("https://192.168.1.1:8080/motech-platform-server/"); assertEquals( "https://192.168.1.1:8080/motech-platform-server/module/commcare/", configService.getBaseUrl()); }