From 7c03e5855fb667a01d9375b445c4a04919bd1dbb Mon Sep 17 00:00:00 2001 From: Dmitry Puzikov Date: Tue, 9 Jul 2019 16:06:02 +0200 Subject: Fix dockerfile to reflect common image naming FROM section changed to reflerct new aai-common image naming scheme. Added explicit aai-common version parameter. Change-Id: Ifc1187384ce757f1a2bf852a670dd9d706a4c782 Issue-ID: INT-1141 Signed-off-by: Dmitry Puzikov --- .../response/GraphEventResponseHandlerTest.java | 39 ++++++++++++---------- 1 file changed, 22 insertions(+), 17 deletions(-) (limited to 'src/test') diff --git a/src/test/java/org/onap/crud/event/response/GraphEventResponseHandlerTest.java b/src/test/java/org/onap/crud/event/response/GraphEventResponseHandlerTest.java index b28ba3a..5cb8dc6 100644 --- a/src/test/java/org/onap/crud/event/response/GraphEventResponseHandlerTest.java +++ b/src/test/java/org/onap/crud/event/response/GraphEventResponseHandlerTest.java @@ -20,11 +20,15 @@ */ package org.onap.crud.event.response; -import static org.assertj.core.api.Assertions.assertThat; -import org.junit.BeforeClass; +import com.google.gson.Gson; +import com.google.gson.JsonParser; +import org.junit.Before; import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; +import org.junit.runner.RunWith; +import org.mockito.junit.MockitoJUnitRunner; +import org.onap.crud.OXMModelLoaderSetup; import org.onap.crud.event.GraphEvent; import org.onap.crud.event.GraphEvent.GraphEventOperation; import org.onap.crud.event.envelope.GraphEventEnvelope; @@ -32,29 +36,30 @@ import org.onap.crud.exception.CrudException; import org.onap.crud.util.TestUtil; import org.onap.schema.EdgeRulesLoader; import org.onap.schema.OxmModelLoader; -import com.google.gson.Gson; -import com.google.gson.JsonParser; -import org.junit.runner.RunWith; -import org.mockito.junit.MockitoJUnitRunner; -import org.onap.crud.OXMModelLoaderSetup; +import static org.assertj.core.api.Assertions.assertThat; @RunWith(MockitoJUnitRunner.Silent.class) public class GraphEventResponseHandlerTest extends OXMModelLoaderSetup { + private static boolean setUpIsNotDone = true; + + @Before + public void setUpOnce() throws CrudException { + if (setUpIsNotDone) { + System.setProperty("CONFIG_HOME", "src/test/resources"); + System.setProperty("AJSC_HOME", "."); + System.setProperty("BUNDLECONFIG_DIR", "src/test/resources/bundleconfig-local"); + + OxmModelLoader.loadModels(); + EdgeRulesLoader.loadModels(); + + setUpIsNotDone = false; + } + } @Rule public ExpectedException expectedException = ExpectedException.none(); - @BeforeClass - public static void setUpBeforeClass() throws Exception { - System.setProperty("CONFIG_HOME", "src/test/resources"); - System.setProperty("AJSC_HOME", "."); - System.setProperty("BUNDLECONFIG_DIR", "src/test/resources/bundleconfig-local"); - - OxmModelLoader.loadModels(); - EdgeRulesLoader.loadModels(); - } - @Test public void testPolicyViolationsNotDetected() throws Exception { String expectedEnvelope = TestUtil.getFileAsString("event/event-envelope-sentinel-no-violations.json"); -- cgit 1.2.3-korg