diff options
author | Ram Krishna Verma <ram_krishna.verma@bell.ca> | 2020-03-01 15:44:26 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2020-03-01 15:44:26 +0000 |
commit | 76a2d0ed90c281768793a279debbd6ee6e445fce (patch) | |
tree | 00fcabf94706b533983aec22cae60eb36f3e40b8 /models-interactions/model-actors/actorServiceProvider/src/test | |
parent | fe0673988d5707bbb6553802946f3ca5b31dca44 (diff) | |
parent | f583aa9031e4f73ae0004bf972ac7a6c3afa4b71 (diff) |
Merge "Add sequence number to Actors"
Diffstat (limited to 'models-interactions/model-actors/actorServiceProvider/src/test')
2 files changed, 15 insertions, 2 deletions
diff --git a/models-interactions/model-actors/actorServiceProvider/src/test/java/org/onap/policy/controlloop/actorserviceprovider/ActorServiceTest.java b/models-interactions/model-actors/actorServiceProvider/src/test/java/org/onap/policy/controlloop/actorserviceprovider/ActorServiceTest.java index 401e0ca58..0f282f662 100644 --- a/models-interactions/model-actors/actorServiceProvider/src/test/java/org/onap/policy/controlloop/actorserviceprovider/ActorServiceTest.java +++ b/models-interactions/model-actors/actorServiceProvider/src/test/java/org/onap/policy/controlloop/actorserviceprovider/ActorServiceTest.java @@ -91,15 +91,27 @@ public class ActorServiceTest { } @Test - public void testActorService() { + public void testActorService_testBuildList() { /* * make a service where actors two and four have names that are duplicates of the * others */ + + /* + * actor0 has a higher sequence number than actor1, so it should be discarded, + * even though it will be examined first + */ + Actor actor0 = spy(new ActorImpl(ACTOR1) { + @Override + public int getSequenceNumber() { + return 10000; + } + }); + actor2 = spy(new ActorImpl(ACTOR1)); actor4 = spy(new ActorImpl(ACTOR3)); - service = makeService(actor1, actor2, actor3, actor4); + service = makeService(actor0, actor1, actor2, actor3, actor4); assertEquals(2, service.getActorNames().size()); diff --git a/models-interactions/model-actors/actorServiceProvider/src/test/java/org/onap/policy/controlloop/actorserviceprovider/impl/ActorImplTest.java b/models-interactions/model-actors/actorServiceProvider/src/test/java/org/onap/policy/controlloop/actorserviceprovider/impl/ActorImplTest.java index 92cbbe774..681378de4 100644 --- a/models-interactions/model-actors/actorServiceProvider/src/test/java/org/onap/policy/controlloop/actorserviceprovider/impl/ActorImplTest.java +++ b/models-interactions/model-actors/actorServiceProvider/src/test/java/org/onap/policy/controlloop/actorserviceprovider/impl/ActorImplTest.java @@ -93,6 +93,7 @@ public class ActorImplTest { public void testActorImpl_testGetName() { assertEquals(ACTOR_NAME, actor.getName()); assertEquals(4, actor.getOperationNames().size()); + assertEquals(0, actor.getSequenceNumber()); } @Test |