### Question:
InformationProperties { public URL getServer() throws MalformedURLException { String url = properties.getProperty(SERVER); return new URL(url); } InformationProperties(String propertiesFile); URL getServer(); static final String SERVER_DEFAULT; }### Answer:
@Test public void shouldReturnTheValueFromThePropertyFile() throws IOException { String propertiesFile = "/server.properties"; InformationProperties ip = new InformationProperties(propertiesFile); assertThat(ip.getServer()).isEqualTo(new URL("http: }
@Test public void shouldReturnDefaultValueIfPropertyFileDoesNotExists() throws IOException { String propertiesFile = "/test.properties"; InformationProperties ip = new InformationProperties(propertiesFile); assertThat(ip.getServer()).isEqualTo(new URL(InformationProperties.SERVER_DEFAULT)); }