aboutsummaryrefslogtreecommitdiffstats
path: root/main/src/test/java/org/onap/policy/pap/main/rest/TestProviderBase.java
diff options
context:
space:
mode:
authorLiam Fallon <liam.fallon@est.tech>2020-06-30 07:36:30 +0000
committerGerrit Code Review <gerrit@onap.org>2020-06-30 07:36:30 +0000
commitbe97f0c04fdaa1ce87db75a9701f7a1fcef009e0 (patch)
treea0dfc554ee57638a90e95baf61dd663b287693ba /main/src/test/java/org/onap/policy/pap/main/rest/TestProviderBase.java
parentcbf8332c2438bb8fe444758fdb514b033c8482cb (diff)
parentc3e5e80e820936b7b0732333211f135c42ee8e53 (diff)
Merge "Fix issues in pap for new sonar rules"
Diffstat (limited to 'main/src/test/java/org/onap/policy/pap/main/rest/TestProviderBase.java')
-rw-r--r--main/src/test/java/org/onap/policy/pap/main/rest/TestProviderBase.java8
1 files changed, 5 insertions, 3 deletions
diff --git a/main/src/test/java/org/onap/policy/pap/main/rest/TestProviderBase.java b/main/src/test/java/org/onap/policy/pap/main/rest/TestProviderBase.java
index b6f56ba0..818237d5 100644
--- a/main/src/test/java/org/onap/policy/pap/main/rest/TestProviderBase.java
+++ b/main/src/test/java/org/onap/policy/pap/main/rest/TestProviderBase.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.
@@ -167,7 +167,8 @@ public class TestProviderBase extends ProviderSuper {
PfModelException exc = new PfModelException(Status.CONFLICT, EXPECTED_EXCEPTION);
when(dao.getFilteredPolicyList(any())).thenThrow(exc);
- assertThatThrownBy(() -> prov.process(loadRequest(), this::handle)).isInstanceOf(PfModelRuntimeException.class)
+ ToscaPolicyIdentifierOptVersion req = loadRequest();
+ assertThatThrownBy(() -> prov.process(req, this::handle)).isInstanceOf(PfModelRuntimeException.class)
.hasCause(exc);
}
@@ -175,7 +176,8 @@ public class TestProviderBase extends ProviderSuper {
public void testGetPolicy_NotFound() throws Exception {
when(dao.getFilteredPolicyList(any())).thenReturn(Collections.emptyList());
- assertThatThrownBy(() -> prov.process(loadRequest(), this::handle)).isInstanceOf(PfModelRuntimeException.class)
+ ToscaPolicyIdentifierOptVersion req = loadRequest();
+ assertThatThrownBy(() -> prov.process(req, this::handle)).isInstanceOf(PfModelRuntimeException.class)
.hasMessage("cannot find policy: policyA 1.2.3")
.extracting(ex -> ((PfModelRuntimeException) ex).getErrorResponse().getResponseCode())
.isEqualTo(Status.NOT_FOUND);