Fix simulator topics for lower case
[policy/models.git] / models-sim / models-sim-dmaap / src / test / java / org / onap / policy / models / sim / dmaap / provider / TopicDataTest.java
index f7e1f5e..f37255a 100644 (file)
@@ -2,7 +2,8 @@
  * ============LICENSE_START=======================================================
  * ONAP Policy Models
  * ================================================================================
- * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2019-2020 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.
@@ -24,9 +25,9 @@ import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertSame;
 import static org.junit.Assert.assertTrue;
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.anyInt;
-import static org.mockito.Matchers.anyLong;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.anyInt;
+import static org.mockito.ArgumentMatchers.anyLong;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.times;
 import static org.mockito.Mockito.verify;
@@ -42,10 +43,10 @@ import java.util.TreeSet;
 import java.util.stream.Collectors;
 import org.junit.Before;
 import org.junit.Test;
-import org.mockito.internal.util.reflection.Whitebox;
 import org.onap.policy.common.utils.coder.Coder;
 import org.onap.policy.common.utils.coder.CoderException;
 import org.onap.policy.common.utils.coder.StandardCoder;
+import org.springframework.test.util.ReflectionTestUtils;
 
 public class TopicDataTest {
     private static final String EXPECTED_EXCEPTION = "expected exception";
@@ -185,7 +186,7 @@ public class TopicDataTest {
 
         coder = mock(Coder.class);
         when(coder.encode(any())).thenThrow(new CoderException(EXPECTED_EXCEPTION));
-        assertNull(data.convertMessageToString(new TreeMap<String,Object>(), coder));
+        assertNull(data.convertMessageToString(new TreeMap<String, Object>(), coder));
     }
 
     @Test
@@ -208,6 +209,6 @@ public class TopicDataTest {
      */
     @SuppressWarnings("unchecked")
     private Map<String, ConsumerGroupData> getGroups() {
-        return (Map<String, ConsumerGroupData>) Whitebox.getInternalState(data, "group2data");
+        return (Map<String, ConsumerGroupData>) ReflectionTestUtils.getField(data, "group2data");
     }
 }