From 426ecdf2949b5951bb05a9cc83d6fa10d4ff04d4 Mon Sep 17 00:00:00 2001 From: Jim Hahn Date: Wed, 10 Jul 2019 16:33:41 -0400 Subject: Fix checkstyle issues in policy-management Also deleted the checkstyle suppression file. Moved classes into their own source files per checkstyle. Change-Id: I586223aac0e5b7623cfd7b0acfceca4742ecc013 Issue-ID: POLICY-1908-mgmt-style Signed-off-by: Jim Hahn --- .../configuration/PdpdConfigurationTest.java | 4 +- .../drools/system/PolicyControllerFactoryTest.java | 14 ++--- .../drools/system/PolicyEngineManagerTest.java | 60 +++++++++++----------- .../internal/AggregatedPolicyControllerTest.java | 46 ++++++++--------- 4 files changed, 62 insertions(+), 62 deletions(-) (limited to 'policy-management/src/test/java/org/onap') diff --git a/policy-management/src/test/java/org/onap/policy/drools/protocol/configuration/PdpdConfigurationTest.java b/policy-management/src/test/java/org/onap/policy/drools/protocol/configuration/PdpdConfigurationTest.java index 4ab42f44..a21cd5b8 100644 --- a/policy-management/src/test/java/org/onap/policy/drools/protocol/configuration/PdpdConfigurationTest.java +++ b/policy-management/src/test/java/org/onap/policy/drools/protocol/configuration/PdpdConfigurationTest.java @@ -222,7 +222,7 @@ public class PdpdConfigurationTest { // List controllers2 = new ArrayList<>(); controllers2.add(controller2); - config2.withRequestID(REQUEST_ID2).withEntity(ENTITY2).withController(controllers2); + config2.withRequestId(REQUEST_ID2).withEntity(ENTITY2).withController(controllers2); assertFalse(config.equals(config2)); @@ -249,7 +249,7 @@ public class PdpdConfigurationTest { @Test public void testConstructor() { PdpdConfiguration config = new PdpdConfiguration(REQUEST_ID, ENTITY, null); - assertEquals(config.getRequestID(), REQUEST_ID); + assertEquals(config.getRequestId(), REQUEST_ID); assertEquals(config.getEntity(), ENTITY); } diff --git a/policy-management/src/test/java/org/onap/policy/drools/system/PolicyControllerFactoryTest.java b/policy-management/src/test/java/org/onap/policy/drools/system/PolicyControllerFactoryTest.java index e56670bd..8e5cf791 100644 --- a/policy-management/src/test/java/org/onap/policy/drools/system/PolicyControllerFactoryTest.java +++ b/policy-management/src/test/java/org/onap/policy/drools/system/PolicyControllerFactoryTest.java @@ -39,7 +39,7 @@ import org.junit.Before; import org.junit.Test; import org.onap.policy.common.utils.gson.GsonTestUtils; import org.onap.policy.drools.controller.DroolsController; -import org.onap.policy.drools.features.PolicyControllerFeatureAPI; +import org.onap.policy.drools.features.PolicyControllerFeatureApi; import org.onap.policy.drools.protocol.configuration.DroolsConfiguration; public class PolicyControllerFactoryTest { @@ -64,9 +64,9 @@ public class PolicyControllerFactoryTest { private DroolsController drools; private DroolsController drools2; private DroolsConfiguration config; - private PolicyControllerFeatureAPI feature1; - private PolicyControllerFeatureAPI feature2; - private List providers; + private PolicyControllerFeatureApi feature1; + private PolicyControllerFeatureApi feature2; + private List providers; private IndexedPolicyControllerFactory ipc; /** @@ -80,8 +80,8 @@ public class PolicyControllerFactoryTest { drools = mock(DroolsController.class); drools2 = mock(DroolsController.class); config = mock(DroolsConfiguration.class); - feature1 = mock(PolicyControllerFeatureAPI.class); - feature2 = mock(PolicyControllerFeatureAPI.class); + feature1 = mock(PolicyControllerFeatureApi.class); + feature2 = mock(PolicyControllerFeatureApi.class); providers = Arrays.asList(feature1, feature2); when(feature1.getName()).thenReturn(FEATURE1); @@ -423,7 +423,7 @@ public class PolicyControllerFactoryTest { } @Override - protected List getProviders() { + protected List getProviders() { return providers; } } diff --git a/policy-management/src/test/java/org/onap/policy/drools/system/PolicyEngineManagerTest.java b/policy-management/src/test/java/org/onap/policy/drools/system/PolicyEngineManagerTest.java index 8050b26a..287f82f5 100644 --- a/policy-management/src/test/java/org/onap/policy/drools/system/PolicyEngineManagerTest.java +++ b/policy-management/src/test/java/org/onap/policy/drools/system/PolicyEngineManagerTest.java @@ -53,8 +53,8 @@ import org.onap.policy.common.endpoints.http.server.HttpServletServer; import org.onap.policy.common.endpoints.http.server.HttpServletServerFactory; import org.onap.policy.common.utils.gson.GsonTestUtils; import org.onap.policy.drools.controller.DroolsController; -import org.onap.policy.drools.features.PolicyControllerFeatureAPI; -import org.onap.policy.drools.features.PolicyEngineFeatureAPI; +import org.onap.policy.drools.features.PolicyControllerFeatureApi; +import org.onap.policy.drools.features.PolicyEngineFeatureApi; import org.onap.policy.drools.persistence.SystemPersistence; import org.onap.policy.drools.properties.DroolsProperties; import org.onap.policy.drools.protocol.coders.EventProtocolCoder; @@ -83,12 +83,12 @@ public class PolicyEngineManagerTest { .addHttpServletServerMock().build(); private Properties properties; - private PolicyEngineFeatureAPI prov1; - private PolicyEngineFeatureAPI prov2; - private List providers; - private PolicyControllerFeatureAPI contProv1; - private PolicyControllerFeatureAPI contProv2; - private List contProviders; + private PolicyEngineFeatureApi prov1; + private PolicyEngineFeatureApi prov2; + private List providers; + private PolicyControllerFeatureApi contProv1; + private PolicyControllerFeatureApi contProv2; + private List contProviders; private String[] globalInitArgs; private TopicSource source1; private TopicSource source2; @@ -135,11 +135,11 @@ public class PolicyEngineManagerTest { public void setUp() throws Exception { properties = new Properties(); - prov1 = mock(PolicyEngineFeatureAPI.class); - prov2 = mock(PolicyEngineFeatureAPI.class); + prov1 = mock(PolicyEngineFeatureApi.class); + prov2 = mock(PolicyEngineFeatureApi.class); providers = Arrays.asList(prov1, prov2); - contProv1 = mock(PolicyControllerFeatureAPI.class); - contProv2 = mock(PolicyControllerFeatureAPI.class); + contProv1 = mock(PolicyControllerFeatureApi.class); + contProv2 = mock(PolicyControllerFeatureApi.class); contProviders = Arrays.asList(contProv1, contProv2); globalInitArgs = null; source1 = mock(TopicSource.class); @@ -1532,10 +1532,10 @@ public class PolicyEngineManagerTest { * @param verifyAfter verifies that a provider's afterXxx method was invoked * @throws Exception if an error occurs while calling {@link #setUp()} */ - private void checkBeforeAfter(BiConsumer setBefore, - BiConsumer setAfter, Runnable action, - Consumer verifyBefore, Runnable verifyMiddle, - Consumer verifyAfter) throws Exception { + private void checkBeforeAfter(BiConsumer setBefore, + BiConsumer setAfter, Runnable action, + Consumer verifyBefore, Runnable verifyMiddle, + Consumer verifyAfter) throws Exception { checkBeforeAfter_FalseFalse(setBefore, setAfter, action, verifyBefore, verifyMiddle, verifyAfter); checkBeforeAfter_FalseTrue(setBefore, setAfter, action, verifyBefore, verifyMiddle, verifyAfter); @@ -1557,10 +1557,10 @@ public class PolicyEngineManagerTest { * @param verifyAfter verifies that a provider's afterXxx method was invoked * @throws Exception if an error occurs while calling {@link #setUp()} */ - private void checkBeforeAfter_FalseFalse(BiConsumer setBefore, - BiConsumer setAfter, Runnable action, - Consumer verifyBefore, Runnable verifyMiddle, - Consumer verifyAfter) throws Exception { + private void checkBeforeAfter_FalseFalse(BiConsumer setBefore, + BiConsumer setAfter, Runnable action, + Consumer verifyBefore, Runnable verifyMiddle, + Consumer verifyAfter) throws Exception { setUp(); @@ -1598,10 +1598,10 @@ public class PolicyEngineManagerTest { * @param verifyAfter verifies that a provider's afterXxx method was invoked * @throws Exception if an error occurs while calling {@link #setUp()} */ - private void checkBeforeAfter_FalseTrue(BiConsumer setBefore, - BiConsumer setAfter, Runnable action, - Consumer verifyBefore, Runnable verifyMiddle, - Consumer verifyAfter) throws Exception { + private void checkBeforeAfter_FalseTrue(BiConsumer setBefore, + BiConsumer setAfter, Runnable action, + Consumer verifyBefore, Runnable verifyMiddle, + Consumer verifyAfter) throws Exception { setUp(); @@ -1639,10 +1639,10 @@ public class PolicyEngineManagerTest { * @param verifyAfter verifies that a provider's afterXxx method was invoked * @throws Exception if an error occurs while calling {@link #setUp()} */ - private void checkBeforeAfter_TrueFalse(BiConsumer setBefore, - BiConsumer setAfter, Runnable action, - Consumer verifyBefore, Runnable verifyMiddle, - Consumer verifyAfter) throws Exception { + private void checkBeforeAfter_TrueFalse(BiConsumer setBefore, + BiConsumer setAfter, Runnable action, + Consumer verifyBefore, Runnable verifyMiddle, + Consumer verifyAfter) throws Exception { setUp(); @@ -1674,12 +1674,12 @@ public class PolicyEngineManagerTest { private class PolicyEngineManagerImpl extends PolicyEngineManager { @Override - protected List getEngineProviders() { + protected List getEngineProviders() { return providers; } @Override - protected List getControllerProviders() { + protected List getControllerProviders() { return contProviders; } diff --git a/policy-management/src/test/java/org/onap/policy/drools/system/internal/AggregatedPolicyControllerTest.java b/policy-management/src/test/java/org/onap/policy/drools/system/internal/AggregatedPolicyControllerTest.java index eb226e00..67fdfe65 100644 --- a/policy-management/src/test/java/org/onap/policy/drools/system/internal/AggregatedPolicyControllerTest.java +++ b/policy-management/src/test/java/org/onap/policy/drools/system/internal/AggregatedPolicyControllerTest.java @@ -46,7 +46,7 @@ import org.onap.policy.common.endpoints.event.comm.TopicSink; import org.onap.policy.common.endpoints.event.comm.TopicSource; import org.onap.policy.drools.controller.DroolsController; import org.onap.policy.drools.controller.DroolsControllerFactory; -import org.onap.policy.drools.features.PolicyControllerFeatureAPI; +import org.onap.policy.drools.features.PolicyControllerFeatureApi; import org.onap.policy.drools.persistence.SystemPersistence; import org.onap.policy.drools.protocol.configuration.DroolsConfiguration; import org.onap.policy.drools.system.GsonMgmtTestBuilder; @@ -83,9 +83,9 @@ public class AggregatedPolicyControllerTest { private DroolsControllerFactory droolsFactory; private DroolsController drools; private DroolsConfiguration config; - private List providers; - private PolicyControllerFeatureAPI prov1; - private PolicyControllerFeatureAPI prov2; + private List providers; + private PolicyControllerFeatureApi prov1; + private PolicyControllerFeatureApi prov2; private AggregatedPolicyController apc; /** @@ -133,8 +133,8 @@ public class AggregatedPolicyControllerTest { droolsFactory = mock(DroolsControllerFactory.class); when(droolsFactory.build(any(), any(), any())).thenReturn(drools); - prov1 = mock(PolicyControllerFeatureAPI.class); - prov2 = mock(PolicyControllerFeatureAPI.class); + prov1 = mock(PolicyControllerFeatureApi.class); + prov2 = mock(PolicyControllerFeatureApi.class); providers = Arrays.asList(prov1, prov2); @@ -797,10 +797,10 @@ public class AggregatedPolicyControllerTest { * and the afterXxx loop was invoked * @param verifyAfter verifies that a provider's afterXxx method was invoked */ - private void checkBeforeAfter(BiConsumer setBefore, - BiConsumer setAfter, Runnable action, - Consumer verifyBefore, Runnable verifyMiddle, - Consumer verifyAfter) { + private void checkBeforeAfter(BiConsumer setBefore, + BiConsumer setAfter, Runnable action, + Consumer verifyBefore, Runnable verifyMiddle, + Consumer verifyAfter) { checkBeforeAfter_FalseFalse(setBefore, setAfter, action, verifyBefore, verifyMiddle, verifyAfter); checkBeforeAfter_FalseTrue(setBefore, setAfter, action, verifyBefore, verifyMiddle, verifyAfter); @@ -821,10 +821,10 @@ public class AggregatedPolicyControllerTest { * and the afterXxx loop was invoked * @param verifyAfter verifies that a provider's afterXxx method was invoked */ - private void checkBeforeAfter_FalseFalse(BiConsumer setBefore, - BiConsumer setAfter, Runnable action, - Consumer verifyBefore, Runnable verifyMiddle, - Consumer verifyAfter) { + private void checkBeforeAfter_FalseFalse(BiConsumer setBefore, + BiConsumer setAfter, Runnable action, + Consumer verifyBefore, Runnable verifyMiddle, + Consumer verifyAfter) { setUp(); @@ -861,10 +861,10 @@ public class AggregatedPolicyControllerTest { * and the afterXxx loop was invoked * @param verifyAfter verifies that a provider's afterXxx method was invoked */ - private void checkBeforeAfter_FalseTrue(BiConsumer setBefore, - BiConsumer setAfter, Runnable action, - Consumer verifyBefore, Runnable verifyMiddle, - Consumer verifyAfter) { + private void checkBeforeAfter_FalseTrue(BiConsumer setBefore, + BiConsumer setAfter, Runnable action, + Consumer verifyBefore, Runnable verifyMiddle, + Consumer verifyAfter) { setUp(); @@ -901,10 +901,10 @@ public class AggregatedPolicyControllerTest { * and the afterXxx loop was invoked * @param verifyAfter verifies that a provider's afterXxx method was invoked */ - private void checkBeforeAfter_TrueFalse(BiConsumer setBefore, - BiConsumer setAfter, Runnable action, - Consumer verifyBefore, Runnable verifyMiddle, - Consumer verifyAfter) { + private void checkBeforeAfter_TrueFalse(BiConsumer setBefore, + BiConsumer setAfter, Runnable action, + Consumer verifyBefore, Runnable verifyMiddle, + Consumer verifyAfter) { setUp(); @@ -955,7 +955,7 @@ public class AggregatedPolicyControllerTest { } @Override - protected List getProviders() { + protected List getProviders() { return providers; } } -- cgit 1.2.3-korg