X-Git-Url: https://gerrit.onap.org/r/gitweb?p=aai%2Fgizmo.git;a=blobdiff_plain;f=src%2Ftest%2Fjava%2Forg%2Fonap%2Fcrud%2Fevent%2Fresponse%2FGraphEventResponseHandlerTest.java;h=5cb8dc6ca4fa01080b5e6225dcec3d0107ed4c62;hp=b28ba3a259f1c8c7f208697f284d7b78557017d8;hb=7c03e5855fb667a01d9375b445c4a04919bd1dbb;hpb=6c61db25f45369d0b97345db9aa86589603c151d 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");