DefaultServerPortProvider implements ServerPortProvider { public String getDefaultPort() { return System.getProperty(DEFAULT_PORT, "8080"); }  String getDefaultPort();  }
@Test public void shouldReturn8080IfDefaultPortNotSet() throws Exception { assertThat(System.getProperty(DEFAULT_PORT), is(nullValue())); assertThat(defaultServerPortProvider.getDefaultPort(), is("8080")); }
@Test public void shouldReturnSystemPropertyDefaultPortIfSet() throws Exception { final String defaultPort = "827364"; System.setProperty(DEFAULT_PORT, defaultPort); assertThat(defaultServerPortProvider.getDefaultPort(), is(defaultPort)); }