@Test public void manuallySetDefaultHostShouldNotBeDefaultHost() { // pre-conditions String host = ConnectionUtils.getDefaultHostUrl(); assertNotNull(host); // operations Connection connection = new ConnectionFake("fakeUser", host); // verifications assertFalse(connection.isDefaultHost()); assertEquals(ConnectionUtils.getDefaultHostUrl(), connection.getHost()); }
@Test public void nullHostShouldBeDefaultHost() { // pre-conditions // operations Connection connection = new ConnectionFake("fakeUser", null); // verifications assertTrue(connection.isDefaultHost()); assertEquals(ConnectionUtils.getDefaultHostUrl(), connection.getHost()); }