From ef1c07eb976ff4d8145f40ce4db092591bb78047 Mon Sep 17 00:00:00 2001 From: Pamela Dragosh Date: Tue, 10 Mar 2020 12:41:47 -0400 Subject: Bump monitoring app code coverage Cleaned up some code to remove unnecessary branches. Add more test cases specifically for query parameters. Coverage should be above 90% for this repo. Issue-ID: POLICY-2242 Change-Id: I20a75aacd75f9b8c87abb47e88b81ab8f2d30626 Signed-off-by: Pamela Dragosh --- .../common/std/StdCombinedPolicyResultsTranslatorTest.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'applications/common/src') diff --git a/applications/common/src/test/java/org/onap/policy/pdp/xacml/application/common/std/StdCombinedPolicyResultsTranslatorTest.java b/applications/common/src/test/java/org/onap/policy/pdp/xacml/application/common/std/StdCombinedPolicyResultsTranslatorTest.java index 93124552..6ff7a7f1 100644 --- a/applications/common/src/test/java/org/onap/policy/pdp/xacml/application/common/std/StdCombinedPolicyResultsTranslatorTest.java +++ b/applications/common/src/test/java/org/onap/policy/pdp/xacml/application/common/std/StdCombinedPolicyResultsTranslatorTest.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * ONAP * ================================================================================ - * 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. @@ -123,6 +123,10 @@ public class StdCombinedPolicyResultsTranslatorTest { public void testConvert() throws ToscaPolicyConversionException, CoderException { StdCombinedPolicyResultsTranslator translator = new StdCombinedPolicyResultsTranslator(); + assertThatThrownBy(() -> translator.convertPolicy(null)).isInstanceOf(ToscaPolicyConversionException.class) + .hasMessageContaining("Cannot convert a NULL policy"); + + assertThatThrownBy(() -> translator.convertPolicy( new ToscaPolicy())).isInstanceOf(ToscaPolicyConversionException.class) .hasMessageContaining("missing metadata"); -- cgit 1.2.3-korg