diff options
Diffstat (limited to 'feature-no-locking/src')
4 files changed, 17 insertions, 7 deletions
diff --git a/feature-no-locking/src/main/resources/META-INF.services/org.onap.policy.drools.features.PolicyEngineFeatureApi b/feature-no-locking/src/main/resources/META-INF.services/org.onap.policy.drools.features.PolicyEngineFeatureApi deleted file mode 100644 index e8a5d79f..00000000 --- a/feature-no-locking/src/main/resources/META-INF.services/org.onap.policy.drools.features.PolicyEngineFeatureApi +++ /dev/null @@ -1 +0,0 @@ -org.onap.policy.no.locking.NoLockManager
\ No newline at end of file diff --git a/feature-no-locking/src/main/resources/META-INF/services/org.onap.policy.drools.features.PolicyEngineFeatureApi b/feature-no-locking/src/main/resources/META-INF/services/org.onap.policy.drools.features.PolicyEngineFeatureApi new file mode 100644 index 00000000..93e6abe3 --- /dev/null +++ b/feature-no-locking/src/main/resources/META-INF/services/org.onap.policy.drools.features.PolicyEngineFeatureApi @@ -0,0 +1 @@ +org.onap.policy.no.locking.NoLockManager diff --git a/feature-no-locking/src/test/java/org/onap/policy/no/locking/NoLockManagerTest.java b/feature-no-locking/src/test/java/org/onap/policy/no/locking/NoLockManagerTest.java index bae9d109..376fc04e 100644 --- a/feature-no-locking/src/test/java/org/onap/policy/no/locking/NoLockManagerTest.java +++ b/feature-no-locking/src/test/java/org/onap/policy/no/locking/NoLockManagerTest.java @@ -20,6 +20,7 @@ package org.onap.policy.no.locking; +import static org.assertj.core.api.Assertions.assertThat; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; @@ -28,21 +29,29 @@ import static org.mockito.Mockito.mock; import static org.mockito.Mockito.never; import static org.mockito.Mockito.verify; -import org.junit.Before; +import java.util.List; +import org.junit.BeforeClass; import org.junit.Test; import org.onap.policy.drools.core.lock.AlwaysSuccessLock; import org.onap.policy.drools.core.lock.Lock; import org.onap.policy.drools.core.lock.LockCallback; +import org.onap.policy.drools.features.PolicyEngineFeatureApi; +import org.onap.policy.drools.features.PolicyEngineFeatureApiConstants; public class NoLockManagerTest { - private NoLockManager nlm; - private LockCallback callback; + private static NoLockManager nlm; + private static LockCallback callback; - @Before - public void setUp() { + /** + * Set up Junits. + */ + @BeforeClass + public static void setUp() { + List<PolicyEngineFeatureApi> engineServices = PolicyEngineFeatureApiConstants.getProviders().getList(); + assertThat(engineServices).hasSize(1); + nlm = (NoLockManager) engineServices.get(0); callback = mock(LockCallback.class); - nlm = new NoLockManager(); } @Test diff --git a/feature-no-locking/src/test/resources/META-INF/services/org.onap.policy.drools.features.PolicyEngineFeatureApi b/feature-no-locking/src/test/resources/META-INF/services/org.onap.policy.drools.features.PolicyEngineFeatureApi new file mode 100644 index 00000000..93e6abe3 --- /dev/null +++ b/feature-no-locking/src/test/resources/META-INF/services/org.onap.policy.drools.features.PolicyEngineFeatureApi @@ -0,0 +1 @@ +org.onap.policy.no.locking.NoLockManager |