EmailNotifier { protected String messagesUrl() { String serverUrl = configurationService.getPlatformSettings().getServerUrl(); if (serverUrl == null) { serverUrl = ""; } return serverUrl + "/module/server/?moduleName=admin#/messages"; }  void send(StatusMessage statusMessage, String recipient);  }
@Test public void shouldNotAddSchemeWhenHttpIsPartOfTheUrl() { when(motechSettings.getServerUrl()).thenReturn("https: assertThat(emailNotifier.messagesUrl(), IsEqual.equalTo("https: }
@Test public void shouldJustReturnUrlPathWhenServerUrlIsNotGiven() { when(motechSettings.getServerUrl()).thenReturn(null); assertThat(emailNotifier.messagesUrl(), IsEqual.equalTo("/module/server/?moduleName=admin#/messages")); }