diff options
author | Jim Hahn <jrh3@att.com> | 2020-07-02 09:30:52 -0400 |
---|---|---|
committer | Jim Hahn <jrh3@att.com> | 2020-07-02 12:49:44 -0400 |
commit | c6012167b9692eb38bcb479f233543e93c51c998 (patch) | |
tree | 7a2a590eb659cd036f8815de9ce894e6099cf92b /models-interactions/model-actors/actor.so/src/test | |
parent | e7ba97a66db5c0a45626aff62f9a167f88da62c1 (diff) |
Rename XxxActorServiceProvider to XxxActor
Renamed the actors and their test classes.
Addressed review comments:
- some license dates
Issue-ID: POLICY-2684
Change-Id: Ic9d83e146ef36bb305496d541166cb9f80544025
Signed-off-by: Jim Hahn <jrh3@att.com>
Diffstat (limited to 'models-interactions/model-actors/actor.so/src/test')
-rw-r--r-- | models-interactions/model-actors/actor.so/src/test/java/org/onap/policy/controlloop/actor/so/SoActorTest.java (renamed from models-interactions/model-actors/actor.so/src/test/java/org/onap/policy/controlloop/actor/so/SoActorServiceProviderTest.java) | 45 |
1 files changed, 22 insertions, 23 deletions
diff --git a/models-interactions/model-actors/actor.so/src/test/java/org/onap/policy/controlloop/actor/so/SoActorServiceProviderTest.java b/models-interactions/model-actors/actor.so/src/test/java/org/onap/policy/controlloop/actor/so/SoActorTest.java index cdd8a334c..783380855 100644 --- a/models-interactions/model-actors/actor.so/src/test/java/org/onap/policy/controlloop/actor/so/SoActorServiceProviderTest.java +++ b/models-interactions/model-actors/actor.so/src/test/java/org/onap/policy/controlloop/actor/so/SoActorTest.java @@ -1,10 +1,9 @@ /* * ============LICENSE_START======================================================= - * TestSOActorServiceProvider + * ONAP * ================================================================================ * Copyright (C) 2018 Ericsson. All rights reserved. - * ================================================================================ - * Modifications Copyright (C) 2018-2019 AT&T. All rights reserved. + * Modifications Copyright (C) 2018-2020 AT&T. All rights reserved. * Modifications Copyright (C) 2019 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); @@ -50,7 +49,7 @@ import org.onap.policy.so.SoRequest; import org.onap.policy.so.SoRequestParameters; import org.onap.policy.so.util.Serialization; -public class SoActorServiceProviderTest extends BasicActor { +public class SoActorTest extends BasicActor { private static final String C_VALUE = "cvalue"; private static final String A_VALUE = "avalue"; @@ -71,7 +70,7 @@ public class SoActorServiceProviderTest extends BasicActor { @Test public void testConstructor() { - SoActorServiceProvider prov = new SoActorServiceProvider(); + SoActor prov = new SoActor(); // verify that it has the operators we expect var expected = Arrays.asList(VfModuleCreate.NAME, VfModuleDelete.NAME).stream().sorted() @@ -84,18 +83,18 @@ public class SoActorServiceProviderTest extends BasicActor { @Test public void testActorService() { // verify that it all plugs into the ActorService - verifyActorService(SoActorServiceProvider.NAME, "service.yaml"); + verifyActorService(SoActor.NAME, "service.yaml"); } @Test public void testSendRequest() { - assertThatCode(() -> SoActorServiceProvider.sendRequest(UUID.randomUUID().toString(), null, null, null, null, + assertThatCode(() -> SoActor.sendRequest(UUID.randomUUID().toString(), null, null, null, null, null)).doesNotThrowAnyException(); } @Test public void testMethods() { - SoActorServiceProvider sp = new SoActorServiceProvider(); + SoActor sp = new SoActor(); assertEquals("SO", sp.actor()); assertEquals(2, sp.recipes().size()); @@ -121,16 +120,16 @@ public class SoActorServiceProviderTest extends BasicActor { instantiateTargetCq(policy); - assertNull(new SoActorServiceProvider().constructRequestCq(onset, operation, policy, aaiCqResp)); + assertNull(new SoActor().constructRequestCq(onset, operation, policy, aaiCqResp)); policy.setActor("SO"); - assertNull(new SoActorServiceProvider().constructRequestCq(onset, operation, policy, aaiCqRespMissing)); + assertNull(new SoActor().constructRequestCq(onset, operation, policy, aaiCqRespMissing)); policy.setRecipe(VF_MODULE_CREATE); // empty policy payload - SoRequest request = new SoActorServiceProvider().constructRequestCq(onset, operation, policy, aaiCqResp); + SoRequest request = new SoActor().constructRequestCq(onset, operation, policy, aaiCqResp); assertNotNull(request); assertEquals("vfModuleName", request.getRequestDetails().getRequestInfo().getInstanceName()); @@ -139,7 +138,7 @@ public class SoActorServiceProviderTest extends BasicActor { // non-empty policy payload policy.setPayload(makePayload()); - request = new SoActorServiceProvider().constructRequestCq(onset, operation, policy, aaiCqResp); + request = new SoActor().constructRequestCq(onset, operation, policy, aaiCqResp); assertNotNull(request); assertEquals(true, request.getRequestDetails().getRequestParameters().isUsePreload()); assertEquals(A_VALUE, request.getRequestDetails().getRequestParameters().getUserParams().get(0).get("akey")); @@ -148,26 +147,26 @@ public class SoActorServiceProviderTest extends BasicActor { // payload with config, but no request params policy.setPayload(makePayload()); - policy.getPayload().remove(SoActorServiceProvider.REQ_PARAM_NM); - request = new SoActorServiceProvider().constructRequestCq(onset, operation, policy, aaiCqResp); + policy.getPayload().remove(SoActor.REQ_PARAM_NM); + request = new SoActor().constructRequestCq(onset, operation, policy, aaiCqResp); assertNotNull(request); assertNull(request.getRequestDetails().getRequestParameters()); assertNotNull(request.getRequestDetails().getConfigurationParameters()); // payload with request, but no config params policy.setPayload(makePayload()); - policy.getPayload().remove(SoActorServiceProvider.CONFIG_PARAM_NM); - request = new SoActorServiceProvider().constructRequestCq(onset, operation, policy, aaiCqResp); + policy.getPayload().remove(SoActor.CONFIG_PARAM_NM); + request = new SoActor().constructRequestCq(onset, operation, policy, aaiCqResp); assertNotNull(request); assertNotNull(request.getRequestDetails().getRequestParameters()); assertNull(request.getRequestDetails().getConfigurationParameters()); // null response - assertNull(new SoActorServiceProvider().constructRequestCq(onset, operation, policy, null)); + assertNull(new SoActor().constructRequestCq(onset, operation, policy, null)); instantiateTargetCq(policy); policy.setRecipe(VF_MODULE_DELETE); - SoRequest deleteRequest = new SoActorServiceProvider().constructRequestCq(onset, operation, policy, aaiCqResp); + SoRequest deleteRequest = new SoActor().constructRequestCq(onset, operation, policy, aaiCqResp); assertNotNull(deleteRequest); assertEquals(SoOperationType.DELETE_VF_MODULE, deleteRequest.getOperationType()); @@ -178,12 +177,12 @@ public class SoActorServiceProviderTest extends BasicActor { policy.setRecipe(VF_MODULE_CREATE); // null tenant - assertNull(new SoActorServiceProvider().constructRequestCq(onset, operation, policy, aaiCqRespMissing)); + assertNull(new SoActor().constructRequestCq(onset, operation, policy, aaiCqRespMissing)); // null service item - assertNull(new SoActorServiceProvider().constructRequestCq(onset, operation, policy, aaiCqRespMissing)); + assertNull(new SoActor().constructRequestCq(onset, operation, policy, aaiCqRespMissing)); - assertNull(new SoActorServiceProvider().constructRequestCq(onset, operation, policy, null)); + assertNull(new SoActor().constructRequestCq(onset, operation, policy, null)); } /** @@ -208,8 +207,8 @@ public class SoActorServiceProviderTest extends BasicActor { private Map<String, String> makePayload() { Map<String, String> payload = new TreeMap<>(); - payload.put(SoActorServiceProvider.REQ_PARAM_NM, makeReqParams()); - payload.put(SoActorServiceProvider.CONFIG_PARAM_NM, makeConfigParams()); + payload.put(SoActor.REQ_PARAM_NM, makeReqParams()); + payload.put(SoActor.CONFIG_PARAM_NM, makeConfigParams()); return payload; } |