@Test public void setHostShouldResetIsDefaultHost() { // pre-conditions Connection connection = new ConnectionFake("fakeUser", null); assertTrue(connection.isDefaultHost()); // operations connection.setHost("http://www.redhat.com"); // verifications assertFalse(connection.isDefaultHost()); }
@Test public void shouldHaveHostWithSchemeAfterSetting() { // pre-conditions Connection connection = new ConnectionFake("fakeUser", "openshift.redhat.com"); // operations connection.setHost("jboss.com"); // verifications assertNotNull(connection.getHost()); assertTrue(connection.getHost().startsWith(UrlUtils.HTTP)); assertNotNull(connection.getScheme()); assertTrue(connection.getScheme().startsWith(UrlUtils.HTTP)); }