diff options
author | FrancescoFioraEst <francesco.fiora@est.tech> | 2023-09-12 15:27:38 +0100 |
---|---|---|
committer | FrancescoFioraEst <francesco.fiora@est.tech> | 2023-09-13 12:47:16 +0100 |
commit | 281cd97df5d674d2a4168a80e2e0a21b7c21e076 (patch) | |
tree | b486144fa5e56e75bdbabbad0fbb23cdd0ceed2d /controlloop/common/eventmanager/src/test/java/org/onap/policy/controlloop/ophistory/OperationHistoryDataManagerParamsTest.java | |
parent | b2d624d4655fa4b4e0cebbf7e41dc96b38fa0df5 (diff) |
Upgrade drools-applications to JUnit 5java-17
Issue-ID: POLICY-4819
Change-Id: I33e1f156a1ea0e98cb6386a7d10d06be4dc258d9
Signed-off-by: FrancescoFioraEst <francesco.fiora@est.tech>
Diffstat (limited to 'controlloop/common/eventmanager/src/test/java/org/onap/policy/controlloop/ophistory/OperationHistoryDataManagerParamsTest.java')
-rw-r--r-- | controlloop/common/eventmanager/src/test/java/org/onap/policy/controlloop/ophistory/OperationHistoryDataManagerParamsTest.java | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/controlloop/common/eventmanager/src/test/java/org/onap/policy/controlloop/ophistory/OperationHistoryDataManagerParamsTest.java b/controlloop/common/eventmanager/src/test/java/org/onap/policy/controlloop/ophistory/OperationHistoryDataManagerParamsTest.java index 97f306528..f0159aaff 100644 --- a/controlloop/common/eventmanager/src/test/java/org/onap/policy/controlloop/ophistory/OperationHistoryDataManagerParamsTest.java +++ b/controlloop/common/eventmanager/src/test/java/org/onap/policy/controlloop/ophistory/OperationHistoryDataManagerParamsTest.java @@ -3,6 +3,7 @@ * ONAP * ================================================================================ * Copyright (C) 2020-2021 AT&T Intellectual Property. 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. @@ -21,17 +22,16 @@ package org.onap.policy.controlloop.ophistory; import static org.assertj.core.api.Assertions.assertThat; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; import java.util.function.Consumer; -import org.junit.Before; -import org.junit.Test; -import org.onap.policy.common.parameters.ValidationResult; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.onap.policy.controlloop.ophistory.OperationHistoryDataManagerParams.OperationHistoryDataManagerParamsBuilder; -public class OperationHistoryDataManagerParamsTest { +class OperationHistoryDataManagerParamsTest { private static final String CONTAINER = "my-container"; private static final int BATCH_SIZE = 10; private static final int MAX_QUEUE_LENGTH = 20; @@ -44,13 +44,13 @@ public class OperationHistoryDataManagerParamsTest { private OperationHistoryDataManagerParams params; - @Before + @BeforeEach public void setUp() { params = makeBuilder().build(); } @Test - public void test() { + void test() { assertEquals(BATCH_SIZE, params.getBatchSize()); assertEquals(MAX_QUEUE_LENGTH, params.getMaxQueueLength()); assertEquals(MY_PASS, params.getPassword()); @@ -71,7 +71,7 @@ public class OperationHistoryDataManagerParamsTest { } @Test - public void testValidate() { + void testValidate() { assertTrue(params.validate(CONTAINER).isValid()); testValidateField("url", "null", params2 -> params2.setUrl(null)); @@ -103,14 +103,14 @@ public class OperationHistoryDataManagerParamsTest { Consumer<OperationHistoryDataManagerParams> makeInvalid) { // original params should be valid - ValidationResult result = params.validate(CONTAINER); - assertTrue(fieldName, result.isValid()); + var result = params.validate(CONTAINER); + assertTrue(result.isValid()); // make invalid params - OperationHistoryDataManagerParams params2 = makeBuilder().build(); + var params2 = makeBuilder().build(); makeInvalid.accept(params2); result = params2.validate(CONTAINER); - assertFalse(fieldName, result.isValid()); + assertFalse(result.isValid()); assertThat(result.getResult()).contains(CONTAINER).contains(fieldName).contains(expected); } |