@Test public void testGetLocatorUrl() throws Exception { String host = "10.69.1.23"; expect(iniFile.getStringValue(LocatorConfigurationImpl.LOCATOR_HOST_KEY)).andReturn(host); control.replay(); String locatorUrl = locatorConfigurationImpl.getLocatorUrl(); control.verify(); assertThat(locatorUrl).isEqualTo("http://" + host + ":8084/obm-locator/"); }
@Test public void testGetLocatorCacheTimeUnit() { expect(iniFile.getStringValue(LocatorConfigurationImpl.LOCATOR_CACHE_TIMEUNIT_KEY)) .andReturn("hours"); control.replay(); TimeUnit locatorCacheTimeUnit = locatorConfigurationImpl.getLocatorCacheTimeUnit(); control.verify(); assertThat(locatorCacheTimeUnit).isEqualTo(TimeUnit.HOURS); }
@Test(expected = ConfigurationException.class) public void testGetLocatorUrlThrowsConfigurationException() throws Exception { expect(iniFile.getStringValue(LocatorConfigurationImpl.LOCATOR_HOST_KEY)).andReturn(null); control.replay(); try { locatorConfigurationImpl.getLocatorUrl(); } catch (Exception e) { control.verify(); throw e; } }