diff options
author | Denes Nemeth <denes.nemeth@nokia.com> | 2018-03-05 11:34:34 +0100 |
---|---|---|
committer | Denes Nemeth <denes.nemeth@nokia.com> | 2018-03-05 11:46:33 +0100 |
commit | be56383397388d35f41089723e912856c03f4673 (patch) | |
tree | 70fa2ec82e5de369fb7397e8b261bfcf8748282b /nokiav2/driver/src/test/java/org/onap/vfc/nfvo | |
parent | 729c12f0145d4ac71e92545e7408379b48c8f389 (diff) |
Fix release artifacts
Change-Id: Ic61a50d8c7b9c2121b7ebbac5324b1c2b99e1f3a
Signed-off-by: Denes Nemeth <denes.nemeth@nokia.com>
Issue-ID: VFC-728
Diffstat (limited to 'nokiav2/driver/src/test/java/org/onap/vfc/nfvo')
3 files changed, 8 insertions, 7 deletions
diff --git a/nokiav2/driver/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/ct/CTReal.java b/nokiav2/driver/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/ct/CTReal.java index e013142a..c40dcfb1 100644 --- a/nokiav2/driver/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/ct/CTReal.java +++ b/nokiav2/driver/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/ct/CTReal.java @@ -19,6 +19,7 @@ package org.onap.vfc.nfvo.driver.vnfm.svnfm.nokia.ct; import org.junit.Test; import org.junit.runner.RunWith; import org.onap.vfc.nfvo.driver.vnfm.svnfm.nokia.NokiaSvnfmApplication; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.nokia.util.SystemFunctions; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.ActiveProfiles; import org.springframework.test.context.junit4.SpringRunner; @@ -33,10 +34,8 @@ public class CTReal { * It takes parameters from application-real.properties */ @Test - public void testBasicWorkflow() throws Exception { - - - Thread.sleep(10000000 * 1000L); + public void testBasicWorkflow() { + SystemFunctions.systemFunctions().sleep(10000000 * 1000L); } } diff --git a/nokiav2/driver/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/onap/core/TestGenericExternalSystemInfoProvider.java b/nokiav2/driver/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/onap/core/TestGenericExternalSystemInfoProvider.java index 44263835..ea1afe5f 100644 --- a/nokiav2/driver/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/onap/core/TestGenericExternalSystemInfoProvider.java +++ b/nokiav2/driver/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/onap/core/TestGenericExternalSystemInfoProvider.java @@ -77,7 +77,9 @@ public class TestGenericExternalSystemInfoProvider extends TestBase { assertEquals(expectedVnfmInfo, vnfmInfo); //when //sleeping is required to make time pass (for cache to notice the change) - Thread.sleep(10); + //cache is configured with 1 ms cache eviction without sleep it is not + //deterministic that at least 1 ms time will pass between calls + Thread.sleep(10); //NO SONAR VnfmInfo vnfmInfo2 = genericExternalSystemInfoProvider.getVnfmInfo(VNFM_ID); //verify source system called again verify(logger, times(2)).info("Quering VNFM info from source with " + VNFM_ID + " identifier"); diff --git a/nokiav2/driver/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/vnfm/TestBase.java b/nokiav2/driver/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/vnfm/TestBase.java index 99e95b4c..5f1d6007 100644 --- a/nokiav2/driver/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/vnfm/TestBase.java +++ b/nokiav2/driver/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/vnfm/TestBase.java @@ -116,7 +116,7 @@ public class TestBase { @Before public void genericSetup() throws Exception { MockitoAnnotations.initMocks(this); - ReflectionTestUtils.setField(SystemFunctions.class, "INSTANCE", systemFunctions); + ReflectionTestUtils.setField(SystemFunctions.class, "singletonInstance", systemFunctions); when(cbamRestApiProvider.getCbamLcmApi(VNFM_ID)).thenReturn(vnfApi); when(cbamRestApiProvider.getCbamOperationExecutionApi(VNFM_ID)).thenReturn(operationExecutionApi); when(cbamRestApiProvider.getCbamLcnApi(VNFM_ID)).thenReturn(lcnApi); @@ -133,7 +133,7 @@ public class TestBase { @After public void tearGeneric() { - ReflectionTestUtils.setField(SystemFunctions.class, "INSTANCE", null); + ReflectionTestUtils.setField(SystemFunctions.class, "singletonInstance", null); } protected void assertFileInZip(byte[] zip, String path, byte[] expectedContent) throws Exception { |