diff options
author | waynedunican <wayne.dunican@est.tech> | 2024-06-13 09:13:33 +0100 |
---|---|---|
committer | Wayne Dunican <wayne.dunican@est.tech> | 2024-06-20 15:48:51 +0000 |
commit | 951a1df7e35c8aa51e91af1e17851d7d2aa45fb3 (patch) | |
tree | 59bfecd90fb46cd048becd989faf0500c446f8dc /models-errors | |
parent | 9e8684c88435734cb2e142208436cec647cde887 (diff) |
Convert models to JUnit 5
Review for models-base, models-dao, models-decisions and models-errors
Issue-ID: POLICY-5042
Change-Id: I0fd2252dcf5c758420508facf62d70789a5e9598
Signed-off-by: waynedunican <wayne.dunican@est.tech>
Diffstat (limited to 'models-errors')
3 files changed, 15 insertions, 14 deletions
diff --git a/models-errors/src/test/java/org/onap/policy/models/errors/concepts/ErrorResponseTest.java b/models-errors/src/test/java/org/onap/policy/models/errors/concepts/ErrorResponseTest.java index 0be37f489..3ede12a2e 100644 --- a/models-errors/src/test/java/org/onap/policy/models/errors/concepts/ErrorResponseTest.java +++ b/models-errors/src/test/java/org/onap/policy/models/errors/concepts/ErrorResponseTest.java @@ -3,7 +3,7 @@ * ONAP Policy Decision Models * ================================================================================ * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. - * Modifications Copyright (C) 2023 Nordix Foundation. + * Modifications Copyright (C) 2023, 2024 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,21 +22,21 @@ package org.onap.policy.models.errors.concepts; import static org.assertj.core.api.Assertions.assertThatCode; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; import jakarta.ws.rs.core.Response; import java.util.List; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.onap.policy.common.utils.coder.StandardCoder; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -public class ErrorResponseTest { +class ErrorResponseTest { - public static final Logger logger = LoggerFactory.getLogger(ErrorResponseTest.class); + static final Logger logger = LoggerFactory.getLogger(ErrorResponseTest.class); @Test - public void test() { + void test() { assertThatCode(() -> { ErrorResponse error = new ErrorResponse(); diff --git a/models-errors/src/test/java/org/onap/policy/models/errors/concepts/ErrorResponseUtilsTest.java b/models-errors/src/test/java/org/onap/policy/models/errors/concepts/ErrorResponseUtilsTest.java index c19b18b63..317c42c93 100644 --- a/models-errors/src/test/java/org/onap/policy/models/errors/concepts/ErrorResponseUtilsTest.java +++ b/models-errors/src/test/java/org/onap/policy/models/errors/concepts/ErrorResponseUtilsTest.java @@ -1,6 +1,6 @@ /*- * ============LICENSE_START======================================================= - * Copyright (C) 2019-2020 Nordix Foundation. + * Copyright (C) 2019-2020, 2024 Nordix Foundation. * Modifications Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); @@ -22,21 +22,21 @@ package org.onap.policy.models.errors.concepts; import static org.assertj.core.api.Assertions.assertThat; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; import java.io.IOException; -import org.junit.Test; +import org.junit.jupiter.api.Test; /** * Test the {@link ErrorResponseUtils} class. * * @author Liam Fallon (liam.fallon@est.tech) */ -public class ErrorResponseUtilsTest { +class ErrorResponseUtilsTest { private static final String EXCEPTION1 = "Exception 1"; @Test - public void testErrorResponseUtils() { + void testErrorResponseUtils() { final IOException ioe = new IOException(EXCEPTION1, new NumberFormatException("Exception 0")); final ErrorResponse errorResponse = new ErrorResponse(); assertThat(ioe).hasMessage(EXCEPTION1); diff --git a/models-errors/src/test/java/org/onap/policy/models/errors/concepts/TestModels.java b/models-errors/src/test/java/org/onap/policy/models/errors/concepts/TestModels.java index 054aaa520..4914cc65f 100644 --- a/models-errors/src/test/java/org/onap/policy/models/errors/concepts/TestModels.java +++ b/models-errors/src/test/java/org/onap/policy/models/errors/concepts/TestModels.java @@ -3,6 +3,7 @@ * ONAP Policy Decision Models * ================================================================================ * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. + * Modifications Copyright (C) 2024 Nordix Foundation * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,13 +26,13 @@ import com.openpojo.validation.Validator; import com.openpojo.validation.ValidatorBuilder; import com.openpojo.validation.test.impl.GetterTester; import com.openpojo.validation.test.impl.SetterTester; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.onap.policy.common.utils.test.ToStringTester; -public class TestModels { +class TestModels { @Test - public void testDecisionModels() { + void testDecisionModels() { final Validator validator = ValidatorBuilder.create().with(new ToStringTester()).with(new SetterTester()) .with(new GetterTester()).build(); validator.validate(TestModels.class.getPackage().getName(), new FilterPackageInfo()); |