diff options
author | adheli.tavares <adheli.tavares@est.tech> | 2023-08-17 22:09:58 +0100 |
---|---|---|
committer | adheli.tavares <adheli.tavares@est.tech> | 2023-09-22 15:58:23 +0100 |
commit | 42c18ef1c6506e63151b55a96d90362da9fbda63 (patch) | |
tree | 895c7598c35b8daad7ac5e2681bc0feed5a47027 /main/src/test/java/org/onap/policy/pap/main/parameters/TestPdpModifyRequestMapParams.java | |
parent | eb4cf2ad5d004cbfda90a752d10fbc6e91ef8fb4 (diff) |
Java 17 / Spring 6 / Spring Boot 3 Upgrade
Issue-ID: POLICY-4671
Change-Id: I664e5f62b1ad23619888af98589c04875b07f4d3
Signed-off-by: adheli.tavares <adheli.tavares@est.tech>
Diffstat (limited to 'main/src/test/java/org/onap/policy/pap/main/parameters/TestPdpModifyRequestMapParams.java')
-rw-r--r-- | main/src/test/java/org/onap/policy/pap/main/parameters/TestPdpModifyRequestMapParams.java | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/main/src/test/java/org/onap/policy/pap/main/parameters/TestPdpModifyRequestMapParams.java b/main/src/test/java/org/onap/policy/pap/main/parameters/TestPdpModifyRequestMapParams.java index c41915d2..ae46e66b 100644 --- a/main/src/test/java/org/onap/policy/pap/main/parameters/TestPdpModifyRequestMapParams.java +++ b/main/src/test/java/org/onap/policy/pap/main/parameters/TestPdpModifyRequestMapParams.java @@ -4,6 +4,7 @@ * ================================================================================ * Copyright (C) 2019, 2021 AT&T Intellectual Property. All rights reserved. * Modifications Copyright (C) 2022 Bell Canada. All rights reserved. + * Modifications Copyright (C) 2023 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,11 +25,11 @@ package org.onap.policy.pap.main.parameters; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatCode; import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException; -import static org.junit.Assert.assertSame; +import static org.junit.jupiter.api.Assertions.assertSame; import static org.mockito.Mockito.mock; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.onap.policy.common.endpoints.listeners.RequestIdDispatcher; import org.onap.policy.models.pdp.concepts.PdpMessage; import org.onap.policy.models.pdp.concepts.PdpStatus; @@ -36,7 +37,7 @@ import org.onap.policy.pap.main.comm.Publisher; import org.onap.policy.pap.main.comm.TimerManager; import org.onap.policy.pap.main.parameters.PdpModifyRequestMapParams.PdpModifyRequestMapParamsBuilder; -public class TestPdpModifyRequestMapParams { +class TestPdpModifyRequestMapParams { private static final long MAX_PDP_AGE_MS = 100; private PdpModifyRequestMapParamsBuilder builder; private Publisher<PdpMessage> pub; @@ -49,7 +50,7 @@ public class TestPdpModifyRequestMapParams { /** * Sets up the objects and creates an empty {@link #builder}. */ - @Before + @BeforeEach @SuppressWarnings("unchecked") public void setUp() { pub = mock(Publisher.class); @@ -65,7 +66,7 @@ public class TestPdpModifyRequestMapParams { } @Test - public void testGettersSetters() { + void testGettersSetters() { PdpModifyRequestMapParams params = builder.build(); assertThat(params.getMaxPdpAgeMs()).isEqualTo(MAX_PDP_AGE_MS); assertSame(pub, params.getPdpPublisher()); @@ -77,12 +78,12 @@ public class TestPdpModifyRequestMapParams { } @Test - public void testValidate() { + void testValidate() { assertThatCode(builder.build()::validate).doesNotThrowAnyException(); } @Test - public void testValidate_InvalidMaxPdpAge() { + void testValidate_InvalidMaxPdpAge() { assertThatIllegalArgumentException().isThrownBy(() -> builder.maxPdpAgeMs(0).build().validate()) .withMessageContaining("maxPdpAgeMs"); assertThatIllegalArgumentException().isThrownBy(() -> builder.maxPdpAgeMs(-1).build().validate()) @@ -92,37 +93,37 @@ public class TestPdpModifyRequestMapParams { } @Test - public void testValidate_MissingPublisher() { + void testValidate_MissingPublisher() { assertThatIllegalArgumentException().isThrownBy(() -> builder.pdpPublisher(null).build().validate()) .withMessageContaining("publisher"); } @Test - public void testValidate_MissingDispatcher() { + void testValidate_MissingDispatcher() { assertThatIllegalArgumentException().isThrownBy(() -> builder.responseDispatcher(null).build().validate()) .withMessageContaining("Dispatch"); } @Test - public void testValidate_MissingLock() { + void testValidate_MissingLock() { assertThatIllegalArgumentException().isThrownBy(() -> builder.modifyLock(null).build().validate()) .withMessageContaining("Lock"); } @Test - public void testValidate_MissingPdpParams() { + void testValidate_MissingPdpParams() { assertThatIllegalArgumentException().isThrownBy(() -> builder.params(null).build().validate()) .withMessageContaining("PDP param"); } @Test - public void testValidate_MissingStateChangeTimers() { + void testValidate_MissingStateChangeTimers() { assertThatIllegalArgumentException().isThrownBy(() -> builder.stateChangeTimers(null).build().validate()) .withMessageContaining("state"); } @Test - public void testValidate_MissingUpdateTimers() { + void testValidate_MissingUpdateTimers() { assertThatIllegalArgumentException().isThrownBy(() -> builder.updateTimers(null).build().validate()) .withMessageContaining("update"); } |