X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=models-tosca%2Fsrc%2Ftest%2Fjava%2Forg%2Fonap%2Fpolicy%2Fmodels%2Ftosca%2Fsimple%2Fconcepts%2FJpaToscaConstraintLogicalTest.java;h=2fdd29c5a09b8ebee04c1f584218dd7071f444be;hb=938005505883cf7a636a8840e20e3dc8a0ad9176;hp=e48f5f89560834ac35dcddf58617d42e4c61c852;hpb=556c59a7b57e91d7c6c8fbbf5bb6966bdfc1578c;p=policy%2Fmodels.git diff --git a/models-tosca/src/test/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaConstraintLogicalTest.java b/models-tosca/src/test/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaConstraintLogicalTest.java index e48f5f895..2fdd29c5a 100644 --- a/models-tosca/src/test/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaConstraintLogicalTest.java +++ b/models-tosca/src/test/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaConstraintLogicalTest.java @@ -1,6 +1,6 @@ /*- * ============LICENSE_START======================================================= - * Copyright (C) 2019 Nordix Foundation. + * Copyright (C) 2019, 2023 Nordix Foundation. * Modifications Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); @@ -21,12 +21,12 @@ package org.onap.policy.models.tosca.simple.concepts; +import static org.assertj.core.api.Assertions.assertThatThrownBy; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotEquals; import static org.junit.Assert.assertNull; import java.util.ArrayList; - import org.junit.Test; import org.onap.policy.models.tosca.authorative.concepts.ToscaConstraint; @@ -70,7 +70,7 @@ public class JpaToscaConstraintLogicalTest { JpaToscaConstraintLogical jc5 = new JpaToscaConstraintLogical(c5); assertNull(jc5.toAuthorative()); - assertEquals(-1, jc0.compareTo(null)); + assertThatThrownBy(() -> jc0.compareTo(null)).isInstanceOf(NullPointerException.class); assertEquals(0, jc0.compareTo(jc0)); assertNotEquals(0, jc0.compareTo(new JpaToscaConstraintValidValues(new ArrayList<>()))); assertEquals(-2, jc0.compareTo(jc1));