@Test public void loginFoundTest() throws Exception { when(projectConfiguration.getServerUrl()).thenReturn("TESTSERVER"); when(userProperties.get("server.TESTSERVER.email")).thenReturn("*****@*****.**"); when(userProperties.get("server.TESTSERVER.password")).thenReturn("test"); assertTrue(homeDirLoginProvider.provideLogin()); verify(loginContext).setLogin(any(Login.class)); }
@Test public void noLoginFoundTest() throws Exception { when(projectConfiguration.getServerUrl()).thenReturn("http://www.example.org"); assertFalse(homeDirLoginProvider.provideLogin()); verifyZeroInteractions(loginContext); }