diff options
author | jhh <jorge.hernandez-herrero@att.com> | 2021-04-20 08:45:13 -0500 |
---|---|---|
committer | Jorge Hernandez <jorge.hernandez-herrero@att.com> | 2021-04-20 14:55:14 +0000 |
commit | 1ae2dfcde4eb8510fa5bd8dbcec7fcf497b76ed4 (patch) | |
tree | 2c6a1df1b013380b39c660ff2b86ec5e357bb350 | |
parent | 9141db029eaa20784116226b03cd966318f2d1eb (diff) |
Fix no-lock service loader incorrect metadata
Issue-ID: POLICY-3202
Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
Change-Id: Iac6d9c7459718df1aae97e0b56f51178cd6b172e
(cherry picked from commit 8ba0ef18395205abd8fe0a1b41a5d9d030e93cc1)
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 |