X-Git-Url: https://gerrit.onap.org/r/gitweb?p=policy%2Fengine.git;a=blobdiff_plain;f=ONAP-PAP-REST%2Fsrc%2Ftest%2Fjava%2Forg%2Fonap%2Fpolicy%2Fpap%2Fxacml%2Frest%2Fpolicycontroller%2FPolicyCreationTest.java;fp=ONAP-PAP-REST%2Fsrc%2Ftest%2Fjava%2Forg%2Fonap%2Fpolicy%2Fpap%2Fxacml%2Frest%2Fpolicycontroller%2FPolicyCreationTest.java;h=0c029b433eb4ca10d01b372f32fcfd3c592495ac;hp=08c1659f9fe40ef540608530d2476afe1bb4c7bb;hb=ce75201a88f6787c7f5aed265c32134e1a116761;hpb=3fcc3204c1c65a5e5f774088bca1fd81dedd9ddb diff --git a/ONAP-PAP-REST/src/test/java/org/onap/policy/pap/xacml/rest/policycontroller/PolicyCreationTest.java b/ONAP-PAP-REST/src/test/java/org/onap/policy/pap/xacml/rest/policycontroller/PolicyCreationTest.java index 08c1659f9..0c029b433 100644 --- a/ONAP-PAP-REST/src/test/java/org/onap/policy/pap/xacml/rest/policycontroller/PolicyCreationTest.java +++ b/ONAP-PAP-REST/src/test/java/org/onap/policy/pap/xacml/rest/policycontroller/PolicyCreationTest.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * ONAP-PAP-REST * ================================================================================ - * 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,11 +23,12 @@ package org.onap.policy.pap.xacml.rest.policycontroller; import static org.assertj.core.api.Assertions.assertThatCode; import static org.assertj.core.api.Assertions.assertThatThrownBy; import static org.junit.Assert.assertEquals; -import static org.mockito.Matchers.anyString; -import static org.mockito.Matchers.eq; +import static org.mockito.ArgumentMatchers.anyString; +import static org.mockito.ArgumentMatchers.eq; import com.mockrunner.mock.web.MockHttpServletRequest; import java.util.ArrayList; +import java.util.LinkedHashMap; import java.util.List; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @@ -90,6 +91,7 @@ public class PolicyCreationTest { assertThatThrownBy(() -> creation.savePolicy(policyData, response)) .isInstanceOf(IllegalArgumentException.class); policyData.setConfigPolicyType("Base"); + Mockito.when(policyData.getRuleData()).thenReturn(new LinkedHashMap<>()); assertThatCode(() -> creation.savePolicy(policyData, response)).doesNotThrowAnyException(); policyData.setConfigPolicyType("ClosedLoop_PM"); assertThatThrownBy(() -> creation.savePolicy(policyData, response))