diff options
Diffstat (limited to 'main')
7 files changed, 28 insertions, 27 deletions
diff --git a/main/pom.xml b/main/pom.xml index 0b50e842..651b18c4 100644 --- a/main/pom.xml +++ b/main/pom.xml @@ -1,7 +1,7 @@ <!-- ============LICENSE_START======================================================= Copyright (C) 2019 Nordix Foundation. - Modifications Copyright (C) 2019 AT&T Intellectual Property. + Modifications Copyright (C) 2019-2020 AT&T Intellectual Property. ================================================================================ Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -86,7 +86,7 @@ </dependency> <dependency> <groupId>org.powermock</groupId> - <artifactId>powermock-api-mockito</artifactId> + <artifactId>powermock-api-mockito2</artifactId> <scope>test</scope> </dependency> <dependency> diff --git a/main/src/main/java/org/onap/policy/pap/main/rest/PolicyComponentsHealthCheckControllerV1.java b/main/src/main/java/org/onap/policy/pap/main/rest/PolicyComponentsHealthCheckControllerV1.java index 8abc09cd..d608b41e 100644 --- a/main/src/main/java/org/onap/policy/pap/main/rest/PolicyComponentsHealthCheckControllerV1.java +++ b/main/src/main/java/org/onap/policy/pap/main/rest/PolicyComponentsHealthCheckControllerV1.java @@ -1,6 +1,7 @@ /*- * ============LICENSE_START======================================================= * Copyright (C) 2019 Nordix Foundation. + * Modifications Copyright (C) 2020 AT&T Intellectual Property. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -39,7 +40,7 @@ import org.apache.commons.lang3.tuple.Pair; /** * Class to provide REST end point for PAP component to fetch all policy components, including PAP, - * API, Distribution, and PDPs + * API, Distribution, and PDPs. * * @author Yehui Wang (yehui.wang@est.tech) */ diff --git a/main/src/test/java/org/onap/policy/pap/main/comm/CommonRequestBase.java b/main/src/test/java/org/onap/policy/pap/main/comm/CommonRequestBase.java index a9cd7d1f..47d1de5f 100644 --- a/main/src/test/java/org/onap/policy/pap/main/comm/CommonRequestBase.java +++ b/main/src/test/java/org/onap/policy/pap/main/comm/CommonRequestBase.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * ONAP PAP * ================================================================================ - * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,7 +20,7 @@ package org.onap.policy.pap.main.comm; -import static org.mockito.Matchers.any; +import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.doAnswer; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.verify; @@ -107,7 +107,7 @@ public class CommonRequestBase { doAnswer(new Answer<Object>() { @Override public Object answer(InvocationOnMock invocation) throws Throwable { - queue.add(invocation.getArgumentAt(0, QueueToken.class)); + queue.add(invocation.getArgument(0, QueueToken.class)); return null; } }).when(publisher).enqueue(any()); diff --git a/main/src/test/java/org/onap/policy/pap/main/comm/msgdata/UpdateReqTest.java b/main/src/test/java/org/onap/policy/pap/main/comm/msgdata/UpdateReqTest.java index bbaf6571..db955155 100644 --- a/main/src/test/java/org/onap/policy/pap/main/comm/msgdata/UpdateReqTest.java +++ b/main/src/test/java/org/onap/policy/pap/main/comm/msgdata/UpdateReqTest.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * ONAP PAP * ================================================================================ - * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,7 +25,7 @@ import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertSame; import static org.junit.Assert.assertTrue; -import static org.mockito.Matchers.any; +import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.never; import static org.mockito.Mockito.verify; @@ -194,7 +194,7 @@ public class UpdateReqTest extends CommonRequestBase { } @Test - public void isSameContent() { + public void testIsSameContent() { PdpUpdate msg2 = new PdpUpdate(update); msg2.setName("world"); assertTrue(data.isSameContent(msg2)); @@ -206,7 +206,7 @@ public class UpdateReqTest extends CommonRequestBase { } @Test - public void isSameContent_BothGroupNamesNull() { + public void testIsSameContent_BothGroupNamesNull() { PdpUpdate msg2 = new PdpUpdate(update); msg2.setPdpGroup(null); update.setPdpGroup(null); @@ -214,7 +214,7 @@ public class UpdateReqTest extends CommonRequestBase { } @Test - public void isSameContent_BothSubGroupNamesNull() { + public void testIsSameContent_BothSubGroupNamesNull() { PdpUpdate msg2 = new PdpUpdate(update); msg2.setPdpSubgroup(null); update.setPdpSubgroup(null); @@ -222,7 +222,7 @@ public class UpdateReqTest extends CommonRequestBase { } @Test - public void isSameContent_DiffGroup() { + public void testIsSameContent_DiffGroup() { PdpUpdate msg2 = new PdpUpdate(update); msg2.setPdpGroup(null); assertFalse(data.isSameContent(msg2)); @@ -235,7 +235,7 @@ public class UpdateReqTest extends CommonRequestBase { } @Test - public void isSameContent_DiffSubGroup() { + public void testIsSameContent_DiffSubGroup() { PdpUpdate msg2 = new PdpUpdate(update); msg2.setPdpSubgroup(null); assertFalse(data.isSameContent(msg2)); @@ -248,7 +248,7 @@ public class UpdateReqTest extends CommonRequestBase { } @Test - public void isSameContent_DiffPolicies() { + public void testIsSameContent_DiffPolicies() { PdpUpdate msg2 = new PdpUpdate(update); ArrayList<ToscaPolicy> policies = new ArrayList<>(update.getPolicies()); @@ -259,7 +259,7 @@ public class UpdateReqTest extends CommonRequestBase { } @Test - public void isSameContent_DiffPolicies_NotNull_Null() { + public void testIsSameContent_DiffPolicies_NotNull_Null() { PdpUpdate msg2 = new PdpUpdate(update); msg2.setPolicies(null); @@ -267,7 +267,7 @@ public class UpdateReqTest extends CommonRequestBase { } @Test - public void isSameContent_DiffPolicies_Null_NotNull() { + public void testIsSameContent_DiffPolicies_Null_NotNull() { PdpUpdate msg2 = new PdpUpdate(update); update.setPolicies(null); diff --git a/main/src/test/java/org/onap/policy/pap/main/notification/PolicyNotifierTest.java b/main/src/test/java/org/onap/policy/pap/main/notification/PolicyNotifierTest.java index 8c84337a..478c63c9 100644 --- a/main/src/test/java/org/onap/policy/pap/main/notification/PolicyNotifierTest.java +++ b/main/src/test/java/org/onap/policy/pap/main/notification/PolicyNotifierTest.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * ONAP PAP * ================================================================================ - * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,8 +23,8 @@ package org.onap.policy.pap.main.notification; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertSame; import static org.junit.Assert.assertTrue; -import static org.mockito.Matchers.any; -import static org.mockito.Matchers.eq; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.doAnswer; import static org.mockito.Mockito.never; import static org.mockito.Mockito.times; @@ -316,7 +316,7 @@ public class PolicyNotifierTest extends PolicyCommonSupport { private Answer<Void> addStatus(int listIndex, PolicyStatus... status) { return invocation -> { @SuppressWarnings("unchecked") - List<PolicyStatus> statusList = invocation.getArgumentAt(listIndex, List.class); + List<PolicyStatus> statusList = invocation.getArgument(listIndex, List.class); statusList.addAll(Arrays.asList(status)); return null; }; diff --git a/main/src/test/java/org/onap/policy/pap/main/rest/ProviderSuper.java b/main/src/test/java/org/onap/policy/pap/main/rest/ProviderSuper.java index 852516b7..a0fa196e 100644 --- a/main/src/test/java/org/onap/policy/pap/main/rest/ProviderSuper.java +++ b/main/src/test/java/org/onap/policy/pap/main/rest/ProviderSuper.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * ONAP PAP * ================================================================================ - * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,7 +21,7 @@ package org.onap.policy.pap.main.rest; import static org.junit.Assert.assertEquals; -import static org.mockito.Matchers.any; +import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; @@ -101,8 +101,8 @@ public class ProviderSuper { when(dao.getFilteredPdpGroups(any())).thenReturn(groups); - when(dao.createPdpGroups(any())).thenAnswer(answer -> answer.getArgumentAt(0, List.class)); - when(dao.updatePdpGroups(any())).thenAnswer(answer -> answer.getArgumentAt(0, List.class)); + when(dao.createPdpGroups(any())).thenAnswer(answer -> answer.getArgument(0, List.class)); + when(dao.updatePdpGroups(any())).thenAnswer(answer -> answer.getArgument(0, List.class)); Registry.register(PapConstants.REG_PDP_MODIFY_LOCK, lockit); Registry.register(PapConstants.REG_PDP_MODIFY_MAP, reqmap); diff --git a/main/src/test/java/org/onap/policy/pap/main/rest/TestPolicyStatusControllerV1.java b/main/src/test/java/org/onap/policy/pap/main/rest/TestPolicyStatusControllerV1.java index 1f7c6d0f..985ff904 100644 --- a/main/src/test/java/org/onap/policy/pap/main/rest/TestPolicyStatusControllerV1.java +++ b/main/src/test/java/org/onap/policy/pap/main/rest/TestPolicyStatusControllerV1.java @@ -1,7 +1,7 @@ /* * ============LICENSE_START======================================================= * Copyright (C) 2019 Nordix Foundation. - * Modifications Copyright (C) 2019 AT&T Intellectual Property. + * Modifications Copyright (C) 2019-2020 AT&T Intellectual Property. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -43,7 +43,7 @@ public class TestPolicyStatusControllerV1 extends CommonPapRestServer { } @Test - public void queryAllDeployedPolicies() throws Exception { + public void testQueryAllDeployedPolicies() throws Exception { String uri = POLICY_STATUS_ENDPOINT; // verify it fails when no authorization info is included @@ -63,7 +63,7 @@ public class TestPolicyStatusControllerV1 extends CommonPapRestServer { } @Test - public void queryDeployedPolicy() throws Exception { + public void testQueryDeployedPolicy() throws Exception { String uri = POLICY_STATUS_ENDPOINT + "/my-name/1.2.3"; Invocation.Builder invocationBuilder = sendRequest(uri); |