Repository: metron Updated Branches: refs/heads/master 892aec357 -> 1cd819a6b
METRON-1274 Master has failure in StormControllerIntegrationTest (merrimanr) closes apache/metron#813 Project: http://git-wip-us.apache.org/repos/asf/metron/repo Commit: http://git-wip-us.apache.org/repos/asf/metron/commit/1cd819a6 Tree: http://git-wip-us.apache.org/repos/asf/metron/tree/1cd819a6 Diff: http://git-wip-us.apache.org/repos/asf/metron/diff/1cd819a6 Branch: refs/heads/master Commit: 1cd819a6b6cc4e2c1bb30f4cb9c632f1f2cdac51 Parents: 892aec3 Author: merrimanr <[email protected]> Authored: Tue Oct 24 15:49:02 2017 -0500 Committer: merrimanr <[email protected]> Committed: Tue Oct 24 15:49:02 2017 -0500 ---------------------------------------------------------------------- .../SensorParserConfigControllerIntegrationTest.java | 7 +++++++ .../rest/controller/StormControllerIntegrationTest.java | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/metron/blob/1cd819a6/metron-interface/metron-rest/src/test/java/org/apache/metron/rest/controller/SensorParserConfigControllerIntegrationTest.java ---------------------------------------------------------------------- diff --git a/metron-interface/metron-rest/src/test/java/org/apache/metron/rest/controller/SensorParserConfigControllerIntegrationTest.java b/metron-interface/metron-rest/src/test/java/org/apache/metron/rest/controller/SensorParserConfigControllerIntegrationTest.java index d8aea72..785c083 100644 --- a/metron-interface/metron-rest/src/test/java/org/apache/metron/rest/controller/SensorParserConfigControllerIntegrationTest.java +++ b/metron-interface/metron-rest/src/test/java/org/apache/metron/rest/controller/SensorParserConfigControllerIntegrationTest.java @@ -20,8 +20,10 @@ package org.apache.metron.rest.controller; import org.adrianwalker.multilinestring.Multiline; import org.apache.commons.io.FileUtils; import org.apache.metron.common.configuration.SensorParserConfig; +import org.apache.metron.integration.utils.TestUtils; import org.apache.metron.rest.MetronRestConstants; import org.apache.metron.rest.service.SensorParserConfigService; +import org.junit.Assert; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; @@ -290,6 +292,11 @@ public class SensorParserConfigControllerIntegrationTest { this.mockMvc.perform(delete(sensorParserConfigUrl + "/squidTest").with(httpBasic(user,password)).with(csrf())) .andExpect(status().isOk()); + { + //we must wait for the config to find its way into the config. + TestUtils.assertEventually(() -> Assert.assertNull(sensorParserConfigService.findOne("squidTest"))); + } + this.mockMvc.perform(get(sensorParserConfigUrl + "/squidTest").with(httpBasic(user,password))) .andExpect(status().isNotFound()); http://git-wip-us.apache.org/repos/asf/metron/blob/1cd819a6/metron-interface/metron-rest/src/test/java/org/apache/metron/rest/controller/StormControllerIntegrationTest.java ---------------------------------------------------------------------- diff --git a/metron-interface/metron-rest/src/test/java/org/apache/metron/rest/controller/StormControllerIntegrationTest.java b/metron-interface/metron-rest/src/test/java/org/apache/metron/rest/controller/StormControllerIntegrationTest.java index e3518ca..a04444d 100644 --- a/metron-interface/metron-rest/src/test/java/org/apache/metron/rest/controller/StormControllerIntegrationTest.java +++ b/metron-interface/metron-rest/src/test/java/org/apache/metron/rest/controller/StormControllerIntegrationTest.java @@ -187,9 +187,9 @@ public class StormControllerIntegrationTest { sensorParserConfig.setSensorTopic("broTest"); sensorParserConfigService.save(sensorParserConfig); { - final Map<String, Object> expectedGlobalConfig = globalConfig; + final SensorParserConfig expectedSensorParserConfig = sensorParserConfig; //we must wait for the config to find its way into the config. - TestUtils.assertEventually(() -> Assert.assertEquals(expectedGlobalConfig, globalConfigService.get())); + TestUtils.assertEventually(() -> Assert.assertEquals(expectedSensorParserConfig, sensorParserConfigService.findOne("broTest"))); } this.mockMvc.perform(get(stormUrl + "/parser/start/broTest").with(httpBasic(user,password)))
