### Question:
XsuaaMockWebServer extends PropertySource<MockWebServer> { @Override public Object getProperty(String name) { if ((name.equals(MOCK_XSUAA_URL) || name.equals(MOCK_XSUAA_PROPERTY_SOURCE_NAME))) { if (!startedWebServer.containsKey(port)) { intializeMockXsuaa(getSource(), port); isStarted = true; } String url = startedWebServer.get(port); log.info("return Mock Server url {} as property", url); return url; } else { return null; } } XsuaaMockWebServer();  XsuaaMockWebServer(int port);  XsuaaMockWebServer(Dispatcher dispatcher); @Override Object getProperty(String name); void destroy(); static final String MOCK_XSUAA_PROPERTY_SOURCE_NAME; static final String MOCK_XSUAA_URL; }### Answer:
@Test public void getPropertyShouldStartMockServerAndReturnUrl() throws UnknownHostException { mockServer = new XsuaaMockWebServer(54321); String url = getLocalHostUrl(mockServer.getProperty(MOCK_XSUAA_PROPERTY_SOURCE_NAME)); Assert.assertThat(url, equalTo("http: }
@Test public void startMockServerAtRandomPortAndReturnUrl() throws UnknownHostException { mockServer = new XsuaaMockWebServer(0); String url = getLocalHostUrl(mockServer.getProperty(MOCK_XSUAA_PROPERTY_SOURCE_NAME)); Assert.assertThat(url, startsWith("http: }