Fix unstable MDNSDiscoveryServiceOSGiTest (#1123)

Fixes #567

Signed-off-by: Wouter Born <github@maindrain.net>
pull/1126/head
Wouter Born 2019-10-13 14:26:38 +02:00 committed by Christoph Weitkamp
parent 91617d8af8
commit 20faf1c63b
1 changed files with 3 additions and 1 deletions

View File

@ -46,11 +46,13 @@ public class MDNSDiscoveryServiceOSGiTest extends JavaOSGiTest {
*/
@Test
public void testDynamicConfigurationOfBackgroundDiscovery() throws IOException {
setBackgroundDiscoveryViaConfigAdmin(true);
waitForAssert(() -> assertThat(mdnsDiscoveryService.isBackgroundDiscoveryEnabled(), is(true)), 5000, 100);
setBackgroundDiscoveryViaConfigAdmin(false);
waitForAssert(() -> assertThat(mdnsDiscoveryService.isBackgroundDiscoveryEnabled(), is(false)), 5000, 100);
setBackgroundDiscoveryViaConfigAdmin(true);
waitForAssert(() -> assertThat(mdnsDiscoveryService.isBackgroundDiscoveryEnabled(), is(true)), 5000, 100);
}
private void setBackgroundDiscoveryViaConfigAdmin(boolean status) throws IOException {