Fix simulator topics for lower case
[policy/models.git] / models-sim / models-sim-dmaap / src / test / java / org / onap / policy / models / sim / dmaap / rest / DmaapSimRestControllerV1Test.java
index 7b84d54..fd9397e 100644 (file)
@@ -1,6 +1,8 @@
 /*-
  * ============LICENSE_START=======================================================
  * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2021 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.
 
 package org.onap.policy.models.sim.dmaap.rest;
 
+import static org.assertj.core.api.Assertions.assertThat;
 import static org.junit.Assert.assertEquals;
 
+import jakarta.ws.rs.core.Response;
 import java.io.File;
 import java.util.Arrays;
 import java.util.Map;
-import javax.ws.rs.core.Response;
 import org.junit.Before;
 import org.junit.Test;
 import org.onap.policy.common.utils.coder.Coder;
@@ -41,7 +44,7 @@ public class DmaapSimRestControllerV1Test {
     private static final String CONSUMER = "my-consumer";
     private static final String CONSUMER_ID = "my-id";
 
-    private static Coder coder = new StandardCoder();
+    private static final Coder coder = new StandardCoder();
 
     private DmaapSimRestControllerV1 rest;
 
@@ -82,6 +85,11 @@ public class DmaapSimRestControllerV1Test {
         resp = rest.getDmaapMessage(TOPIC, CONSUMER, CONSUMER_ID, LIMIT, 0);
         assertEquals(Response.Status.OK.getStatusCode(), resp.getStatus());
         assertEquals("[my-message, my-message-B]", resp.getEntity().toString());
+
+        // verify getDmaapTopics
+        resp = rest.getDmaapTopics();
+        assertEquals(Response.Status.OK.getStatusCode(), resp.getStatus());
+        assertThat(resp.getEntity().toString()).contains("POLICY-PDP-PAP");
     }
 
     private int getCount(Response resp) {