/*-
* ============LICENSE_START=======================================================
* Copyright (C) 2018 Ericsson. All rights reserved.
- * Modifications Copyright (C) 2020 Nordix Foundation
+ * Modifications Copyright (C) 2020,2023 Nordix Foundation
* Modifications Copyright (C) 2022 Bell Canada. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
*
*/
public class JsonEventConverterTest {
+ @SuppressWarnings("deprecation")
@Test
public void testJsonEventConverter() {
Apex2JsonEventConverter converter = new Apex2JsonEventConverter();
"here", "there", "")))
.hasMessage("Model for org.onap.policy.apex.model.eventmodel.concepts.AxEvents not found in model service");
}
-}
\ No newline at end of file
+}
/*-
* ============LICENSE_START=======================================================
* Copyright (C) 2016-2018 Ericsson. All rights reserved.
- * Modifications Copyright (C) 2020,2022 Nordix Foundation.
+ * Modifications Copyright (C) 2020,2022-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.
* @throws ApexException the apex exception
* @throws IOException on IO exceptions
*/
+ @SuppressWarnings("deprecation")
@Test
public void testJsonBadPojoApexEvent() throws ApexException, IOException {
final Apex2JsonEventConverter jsonEventConverter = new Apex2JsonEventConverter();
/*-
* ============LICENSE_START=======================================================
* Copyright (C) 2016-2018 Ericsson. All rights reserved.
- * Modifications Copyright (C) 2020 Nordix Foundation.
+ * Modifications Copyright (C) 2020,2023 Nordix Foundation.
* Modifications Copyright (C) 2022 Bell Canada. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
*
* @throws ApexException the apex exception
*/
+ @SuppressWarnings("deprecation")
@Test
public void testJsontoApexBadEvent() throws ApexException {
final Apex2JsonEventConverter jsonEventConverter = new Apex2JsonEventConverter();
assertTrue(apexEvent0000JsonString.contains("\"intPar\": 12345"));
assertTrue(apexEvent0000JsonString.contains("\"toscaPolicyState\": \"ENTRY\""));
}
-}
\ No newline at end of file
+}
<!--
============LICENSE_START=======================================================
- Copyright (C) 2019-2020 Nordix Foundation.
+ Copyright (C) 2019-2020,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.
<scope>test</scope>
</dependency>
<dependency>
- <groupId>org.powermock</groupId>
- <artifactId>powermock-api-mockito2</artifactId>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-core</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
/*-
* ============LICENSE_START=======================================================
- * Copyright (C) 2019 Nordix Foundation.
+ * Copyright (C) 2019,2023 Nordix Foundation.
* Modifications Copyright (C) 2020 Nordix Foundation
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
import static org.assertj.core.api.Assertions.assertThatCode;
+import java.lang.reflect.Constructor;
import org.junit.Test;
-import org.powermock.reflect.Whitebox;
/**
* Class to perform unit test of {@link ApexStarterConstants}}.
@Test
public void test() throws Exception {
// verify that constructor does not throw an exception
- assertThatCode(() -> Whitebox.invokeConstructor(ApexStarterConstants.class)).doesNotThrowAnyException();
+ assertThatCode(() -> {
+ Constructor<ApexStarterConstants> c = ApexStarterConstants.class.getDeclaredConstructor();
+ c.setAccessible(true);
+ c.newInstance();
+ }).doesNotThrowAnyException();
}
}
/*-
* ============LICENSE_START=======================================================
- * Copyright (C) 2019 Nordix Foundation.
+ * Copyright (C) 2019,2023 Nordix Foundation.
* Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
import org.onap.policy.common.utils.network.NetworkUtil;
import org.onap.policy.common.utils.security.SelfSignedKeyStore;
import org.onap.policy.common.utils.services.Registry;
-import org.powermock.reflect.Whitebox;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import org.springframework.test.util.ReflectionTestUtils;
/**
* Class to perform unit test of {@link ApexStarterRestServer}.
}
private void markActivator(final boolean wasAlive) {
- final Object manager = Whitebox.getInternalState(
+ final Object manager = ReflectionTestUtils.getField(
Registry.get(ApexStarterConstants.REG_APEX_STARTER_ACTIVATOR, ApexStarterActivator.class), "manager");
- AtomicBoolean running = Whitebox.getInternalState(manager, "running");
+ AtomicBoolean running = (AtomicBoolean) ReflectionTestUtils.getField(manager, "running");
running.set(wasAlive);
}