[DCAE-PMSH] Removing dmaap mr from suite

Signed-off-by: efiacor <fiachra.corcoran@est.tech>
Change-Id: I1bb83e675667ae38e7e2d6d47f7e63165722cbb4
Issue-ID: DCAEGEN2-2922
diff --git a/plans/dcaegen2-services-pmsh/testsuite/assets/cbs_sim/cbs-initializer.json b/plans/dcaegen2-services-pmsh/testsuite/assets/cbs_sim/cbs-initializer.json
index 194e556..0c3592b 100644
--- a/plans/dcaegen2-services-pmsh/testsuite/assets/cbs_sim/cbs-initializer.json
+++ b/plans/dcaegen2-services-pmsh/testsuite/assets/cbs_sim/cbs-initializer.json
@@ -87,7 +87,7 @@
                 "dmaap_info": {
                   "client_id": "1475976809466",
                   "client_role": "org.onap.dcae.pmPublisher",
-                  "topic_url": "http://dmaap-mr:3904/events/unauthenticated.DCAE_CL_OUTPUT",
+                  "topic_url": "http://mr-sim:3904/events/unauthenticated.DCAE_CL_OUTPUT",
                   "location": "san-francisco"
                 },
                 "type": "message_router"
@@ -99,14 +99,14 @@
                 "dmaap_info": {
                   "client_id": "1575976809466",
                   "client_role": "org.onap.dcae.aaiSub",
-                  "topic_url": "http://dmaap-mr:3904/events/AAI_EVENT",
+                  "topic_url": "http://mr-sim:3904/events/AAI-EVENT",
                   "location": "san-francisco"
                 }
               },
               "policy_pm_subscriber": {
                 "dmaap_info": {
                   "location": "san-francisco",
-                  "topic_url": "http://dmaap-mr:3904/events/unauthenticated.PMSH_CL_INPUT",
+                  "topic_url": "http://mr-sim:3904/events/unauthenticated.PMSH_CL_INPUT",
                   "client_role": "org.onap.dcae.pmSubscriber",
                   "client_id": "1575876809456"
                 },
diff --git a/plans/dcaegen2-services-pmsh/testsuite/assets/kafka/zk_client_jaas.conf b/plans/dcaegen2-services-pmsh/testsuite/assets/kafka/zk_client_jaas.conf
deleted file mode 100644
index 79a7601..0000000
--- a/plans/dcaegen2-services-pmsh/testsuite/assets/kafka/zk_client_jaas.conf
+++ /dev/null
@@ -1,5 +0,0 @@
-Client {
-  org.apache.zookeeper.server.auth.DigestLoginModule required
-  username="kafka"
-  password="kafka_secret";
- };
\ No newline at end of file
diff --git a/plans/dcaegen2-services-pmsh/testsuite/assets/mr/MsgRtrApi.properties b/plans/dcaegen2-services-pmsh/testsuite/assets/mr/MsgRtrApi.properties
deleted file mode 100644
index 4764321..0000000
--- a/plans/dcaegen2-services-pmsh/testsuite/assets/mr/MsgRtrApi.properties
+++ /dev/null
@@ -1,166 +0,0 @@
-# LICENSE_START=======================================================
-#  org.onap.dmaap
-#  ================================================================================
-#  Copyright © 2017 AT&T Intellectual Property. All rights reserved.
-#  ================================================================================
-#  Licensed under the Apache License, Version 2.0 (the "License");
-#  you may not use this file except in compliance with the License.
-#  You may obtain a copy of the License at
-#        http://www.apache.org/licenses/LICENSE-2.0
-#
-#  Unless required by applicable law or agreed to in writing, software
-#  distributed under the License is distributed on an "AS IS" BASIS,
-#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-#  See the License for the specific language governing permissions and
-#  limitations under the License.
-#  ============LICENSE_END=========================================================
-#
-#  ECOMP is a trademark and service mark of AT&T Intellectual Property.
-#
-###############################################################################
-###############################################################################
-##
-## Cambria API Server config
-##
-## Default values are shown as commented settings.
-##
-###############################################################################
-##
-## HTTP service
-##
-## 3904 is standard as of 7/29/14.
-#
-## Zookeeper Connection
-##
-## Both Cambria and Kafka make use of Zookeeper.
-##
-config.zk.servers=zookeeper:2181
-
-###############################################################################
-##
-## Kafka Connection
-##
-##        Items below are passed through to Kafka's producer and consumer
-##        configurations (after removing "kafka.")
-##        if you want to change request.required.acks it can take this one value
-#kafka.metadata.broker.list=localhost:9092,localhost:9093
-#kafka.metadata.broker.list={{.Values.kafka.name}}:{{.Values.kafka.port}}
-kafka.metadata.broker.list=kafka:9092
-##kafka.request.required.acks=-1
-#kafka.client.zookeeper=${config.zk.servers}
-consumer.timeout.ms=100
-zookeeper.connection.timeout.ms=6000
-zookeeper.session.timeout.ms=20000
-zookeeper.sync.time.ms=2000
-auto.commit.interval.ms=1000
-fetch.message.max.bytes =1000000
-auto.commit.enable=false
-
-#(backoff*retries > zksessiontimeout)
-kafka.rebalance.backoff.ms=10000
-kafka.rebalance.max.retries=6
-
-
-###############################################################################
-##
-##        Secured Config
-##
-##        Some data stored in the config system is sensitive -- API keys and secrets,
-##        for example. to protect it, we use an encryption layer for this section
-##        of the config.
-##
-## The key is a base64 encode AES key. This must be created/configured for
-## each installation.
-#cambria.secureConfig.key=
-##
-## The initialization vector is a 16 byte value specific to the secured store.
-## This must be created/configured for each installation.
-#cambria.secureConfig.iv=
-
-## Southfield Sandbox
-cambria.secureConfig.key=b/7ouTn9FfEw2PQwL0ov/Q==
-cambria.secureConfig.iv=wR9xP5k5vbz/xD0LmtqQLw==
-authentication.adminSecret=fe3cCompound
-
-
-###############################################################################
-##
-## Consumer Caching
-##
-##        Kafka expects live connections from the consumer to the broker, which
-##        obviously doesn't work over connectionless HTTP requests. The Cambria
-##        server proxies HTTP requests into Kafka consumer sessions that are kept
-##        around for later re-use. Not doing so is costly for setup per request,
-##        which would substantially impact a high volume consumer's performance.
-##
-##        This complicates Cambria server failover, because we often need server
-##        A to close its connection before server B brings up the replacement.
-##
-
-## The consumer cache is normally enabled.
-#cambria.consumer.cache.enabled=true
-
-## Cached consumers are cleaned up after a period of disuse. The server inspects
-## consumers every sweepFreqSeconds and will clean up any connections that are
-## dormant for touchFreqMs.
-#cambria.consumer.cache.sweepFreqSeconds=15
-cambria.consumer.cache.touchFreqMs=120000
-##stickforallconsumerrequests=false
-## The cache is managed through ZK. The default value for the ZK connection
-## string is the same as config.zk.servers.
-#cambria.consumer.cache.zkConnect=${config.zk.servers}
-
-##
-## Shared cache information is associated with this node's name. The default
-## name is the hostname plus the HTTP service port this host runs on. (The
-## hostname is determined via InetAddress.getLocalHost ().getCanonicalHostName(),
-## which is not always adequate.) You can set this value explicitly here.
-##
-#cambria.api.node.identifier=<use-something-unique-to-this-instance>
-
-#cambria.rateLimit.maxEmptyPollsPerMinute=30
-#cambria.rateLimitActual.delay.ms=10
-
-###############################################################################
-##
-## Metrics Reporting
-##
-##        This server can report its metrics periodically on a topic.
-##
-#metrics.send.cambria.enabled=true
-#metrics.send.cambria.topic=cambria.apinode.metrics
-#msgrtr.apinode.metrics.dmaap
-#metrics.send.cambria.sendEverySeconds=60
-
-cambria.consumer.cache.zkBasePath=/fe3c/cambria/consumerCache
-consumer.timeout=17
-default.partitions=3
-default.replicas=3
-##############################################################################
-#100mb
-maxcontentlength=10000
-
-
-##############################################################################
-#AAF Properties
-msgRtr.namespace.aaf=org.onap.dmaap.mr.topic
-msgRtr.topicfactory.aaf=org.onap.dmaap.mr.topicFactory|:org.onap.dmaap.mr.topic:
-enforced.topic.name.AAF=org.onap.dmaap.mr
-forceAAF=false
-transidUEBtopicreqd=false
-defaultNSforUEB=org.onap.dmaap.mr
-##############################################################################
-#Mirror Maker Agent
-
-msgRtr.mirrormakeradmin.aaf=org.onap.dmaap.mr.mirrormaker|*|admin
-msgRtr.mirrormakeruser.aaf=org.onap.dmaap.mr.mirrormaker|*|user
-msgRtr.mirrormakeruser.aaf.create=org.onap.dmaap.mr.topicFactory|:org.onap.dmaap.mr.topic:
-msgRtr.mirrormaker.timeout=15000
-msgRtr.mirrormaker.topic=org.onap.dmaap.mr.mirrormakeragent
-msgRtr.mirrormaker.consumergroup=mmagentserver
-msgRtr.mirrormaker.consumerid=1
-
-kafka.max.poll.interval.ms=300000
-kafka.heartbeat.interval.ms=60000
-kafka.session.timeout.ms=240000
-kafka.max.poll.records=1000
\ No newline at end of file
diff --git a/plans/dcaegen2-services-pmsh/testsuite/assets/mr_sim/mr-initializer.json b/plans/dcaegen2-services-pmsh/testsuite/assets/mr_sim/mr-initializer.json
new file mode 100644
index 0000000..ed3ecb0
--- /dev/null
+++ b/plans/dcaegen2-services-pmsh/testsuite/assets/mr_sim/mr-initializer.json
@@ -0,0 +1,64 @@
+[
+   {
+      "id":"mr_aai_event",
+      "httpRequest":{
+         "method":"GET",
+         "path":"/events/AAI-EVENT/.*",
+         "queryStringParameters":{
+            "timeout":[
+               "5000"
+            ]
+         }
+      },
+      "httpResponse":{
+         "statusCode":200,
+         "headers":{
+            "content-type":[
+               "application/json"
+            ]
+         },
+         "body":{
+            "type":"JSON",
+            "json":{
+
+            }
+         }
+      }
+   },
+   {
+      "id":"pmsh_cl_input_event",
+      "httpRequest":{
+         "path":"/events/unauthenticated.PMSH_CL_INPUT/.*",
+         "method":"GET",
+         "queryStringParameters":{
+            "timeout":[
+               "5000"
+            ]
+         }
+      },
+      "httpResponse":{
+         "statusCode":200,
+         "headers":{
+            "content-type":[
+               "application/json"
+            ]
+         },
+         "body":{
+            "type":"JSON",
+            "json":{
+
+            }
+         }
+      }
+   },
+   {
+      "id":"dcae_cl_output_event",
+      "httpRequest":{
+         "path":"/events/unauthenticated.DCAE_CL_OUTPUT/.*",
+         "method":"POST"
+      },
+      "httpResponse":{
+         "statusCode":200
+      }
+   }
+]
\ No newline at end of file
diff --git a/plans/dcaegen2-services-pmsh/testsuite/assets/mr_sim/mr_mockserver.properties b/plans/dcaegen2-services-pmsh/testsuite/assets/mr_sim/mr_mockserver.properties
new file mode 100644
index 0000000..7aa31b2
--- /dev/null
+++ b/plans/dcaegen2-services-pmsh/testsuite/assets/mr_sim/mr_mockserver.properties
@@ -0,0 +1,27 @@
+#######################################
+# MockServer & Proxy Example Settings #
+#######################################
+
+# Socket & Port Settings
+
+# socket timeout in milliseconds (default 120000)
+mockserver.maxSocketTimeout=120000
+
+# Certificate Generation
+
+# delete KeyStore file on JVM shutdown (default true)
+mockserver.deleteGeneratedKeyStoreOnExit=true
+# certificate domain name (default "localhost")
+mockserver.sslCertificateDomainName=localhost
+# comma separated list of domain names for Subject Alternative Name domain names (default empty list)
+mockserver.sslSubjectAlternativeNameDomains=mr-sim
+# comma separated list of ip addresses for Subject Alternative Name ips (default empty list)
+mockserver.sslSubjectAlternativeNameIps=127.0.0.1
+
+
+# CORS
+
+# enable CORS for MockServer REST API
+mockserver.enableCORSForAPI=true
+# enable CORS for all responses
+mockserver.enableCORSForAllResponses=true
diff --git a/plans/dcaegen2-services-pmsh/testsuite/assets/zk/zk_server_jaas.conf b/plans/dcaegen2-services-pmsh/testsuite/assets/zk/zk_server_jaas.conf
deleted file mode 100644
index 3d2767f..0000000
--- a/plans/dcaegen2-services-pmsh/testsuite/assets/zk/zk_server_jaas.conf
+++ /dev/null
@@ -1,4 +0,0 @@
-Server {
-       org.apache.zookeeper.server.auth.DigestLoginModule required
-       user_kafka="kafka_secret";
-};
\ No newline at end of file
diff --git a/plans/dcaegen2-services-pmsh/testsuite/docker-compose.yml b/plans/dcaegen2-services-pmsh/testsuite/docker-compose.yml
index 73a7c07..a355c89 100644
--- a/plans/dcaegen2-services-pmsh/testsuite/docker-compose.yml
+++ b/plans/dcaegen2-services-pmsh/testsuite/docker-compose.yml
@@ -1,76 +1,6 @@
 version: '3.3'
 
 services:
-  zookeeper:
-    image: nexus3.onap.org:10001/onap/dmaap/zookeeper:6.1.0
-    container_name: dmaap-zookeeper
-    ports:
-      - "2181:2181"
-    environment:
-     ZOOKEEPER_REPLICAS: 1
-     ZOOKEEPER_TICK_TIME: 2000
-     ZOOKEEPER_SYNC_LIMIT: 5
-     ZOOKEEPER_INIT_LIMIT: 10
-     ZOOKEEPER_MAX_CLIENT_CNXNS: 200
-     ZOOKEEPER_AUTOPURGE_SNAP_RETAIN_COUNT: 3
-     ZOOKEEPER_AUTOPURGE_PURGE_INTERVAL: 24
-     ZOOKEEPER_CLIENT_PORT: 2181
-     KAFKA_OPTS: -Djava.security.auth.login.config=/etc/zookeeper/secrets/jaas/zk_server_jaas.conf -Dzookeeper.kerberos.removeHostFromPrincipal=true -Dzookeeper.kerberos.removeRealmFromPrincipal=true -Dzookeeper.authProvider.1=org.apache.zookeeper.server.auth.SASLAuthenticationProvider -Dzookeeper.requireClientAuthScheme=sasl -Dzookeeper.4lw.commands.whitelist=*
-     ZOOKEEPER_SERVER_ID: 1
-    volumes:
-      -  ./assets/zk/zk_server_jaas.conf:/etc/zookeeper/secrets/jaas/zk_server_jaas.conf
-    networks:
-      net:
-        aliases:
-        - zookeeper
-
-  kafka:
-   image: nexus3.onap.org:10001/onap/dmaap/kafka111:1.1.0
-   container_name: dmaap-kafka
-   ports:
-    - "9092:9092"
-   environment:
-    enableCadi: 'false'
-    KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
-    KAFKA_ZOOKEEPER_CONNECTION_TIMEOUT_MS: 40000
-    KAFKA_ZOOKEEPER_SESSION_TIMEOUT_MS: 40000
-    KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: INTERNAL_PLAINTEXT:PLAINTEXT,EXTERNAL_PLAINTEXT:PLAINTEXT
-    KAFKA_ADVERTISED_LISTENERS: INTERNAL_PLAINTEXT://kafka:9092
-    KAFKA_LISTENERS: INTERNAL_PLAINTEXT://0.0.0.0:9092
-    KAFKA_INTER_BROKER_LISTENER_NAME: INTERNAL_PLAINTEXT
-    KAFKA_CONFLUENT_SUPPORT_METRICS_ENABLE: 'false'
-    KAFKA_OPTS: -Djava.security.auth.login.config=/etc/kafka/secrets/jaas/zk_client_jaas.conf
-    KAFKA_ZOOKEEPER_SET_ACL: 'true'
-    KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
-    # Reduced the number of partitions only to avoid the timeout error for the first subscribe call in slow environment
-    KAFKA_OFFSETS_TOPIC_NUM_PARTITIONS: 1
-   volumes:
-     -  ./assets/kafka/zk_client_jaas.conf:/etc/kafka/secrets/jaas/zk_client_jaas.conf
-   networks:
-     net:
-       aliases:
-       - kafka
-   depends_on:
-    - zookeeper
-
-  dmaap-mr:
-    image: nexus3.onap.org:10001/onap/dmaap/dmaap-mr:1.3.0
-    container_name: dmaap-mr
-    ports:
-      - "3904:3904"
-      - "3905:3905"
-    environment:
-     enableCadi: 'false'
-    volumes:
-      - ./assets/mr/MsgRtrApi.properties:/appl/dmaapMR1/bundleconfig/etc/appprops/MsgRtrApi.properties
-    networks:
-      net:
-        aliases:
-        - dmaap-mr
-    depends_on:
-      - zookeeper
-      - kafka
-
   db:
     container_name: db
     image: nexus3.onap.org:10001/library/postgres:10
@@ -118,12 +48,30 @@
       net:
         aliases:
         - cbs-sim
+  mr-sim:
+    container_name: mr-sim
+    image: nexus3.onap.org:10001/mockserver/mockserver:latest
+    command: -logLevel DEBUG -serverPort 3904
+    ports:
+      - 3904:1080
+    environment:
+      MOCKSERVER_PROPERTY_FILE: /config/mockserver.properties
+      MOCKSERVER_INITIALIZATION_JSON_PATH: /config/mr-initializer.json
+    volumes:
+      - ./assets/mr_sim/mr_mockserver.properties:/config/mockserver.properties
+      - ./assets/mr_sim/mr-initializer.json:/config/mr-initializer.json
+    networks:
+      net:
+        aliases:
+        - mr-sim
 
   pmsh:
     container_name: pmsh
     image: nexus3.onap.org:10001/onap/org.onap.dcaegen2.services.pmsh:latest
     depends_on:
       - db
+    ports:
+      - 8443:8443
     volumes:
       - ./assets/ssl_certs/cert.pem:/opt/app/pmsh/etc/certs/cert.pem
       - ./assets/ssl_certs/key.pem:/opt/app/pmsh/etc/certs/key.pem
diff --git a/plans/dcaegen2-services-pmsh/testsuite/setup.sh b/plans/dcaegen2-services-pmsh/testsuite/setup.sh
index 73a219f..a970c36 100644
--- a/plans/dcaegen2-services-pmsh/testsuite/setup.sh
+++ b/plans/dcaegen2-services-pmsh/testsuite/setup.sh
@@ -5,7 +5,7 @@
 
 TEST_PLANS_DIR=$WORKSPACE/plans/dcaegen2-services-pmsh/testsuite
 
-docker-compose -f ${TEST_PLANS_DIR}/docker-compose.yml up -d zookeeper kafka dmaap-mr db aai cbs-sim
+docker-compose -f ${TEST_PLANS_DIR}/docker-compose.yml up -d db aai cbs-sim mr-sim
 
 # Slow machine running CSITs can affect db coming up in time for PMSH
 echo "Waiting for postgres db to come up..."
@@ -21,20 +21,6 @@
 done
 [[ "$db_response" != "0" ]] && echo "Error: postgres db not accessible" && exit 1
 
-DMAAP_MR_IP=$(docker inspect -f "{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}" dmaap-mr)
-
-echo "Waiting for dmaap-message-router to come up ..."
-for i in {1..20}; do
-    dmaap_state=$(curl --write-out '%{http_code}' --silent --output /dev/null $DMAAP_MR_IP:3904/topics)
-    if [[ ${dmaap_state} == "200" ]]
-    then
-      break
-    else
-      sleep 5
-    fi
-done
-[[ "$dmaap_state" != "200" ]] && echo "Error: DMaaP MR container state not healthy" && exit 1
-
 docker-compose -f ${TEST_PLANS_DIR}/docker-compose.yml up -d pmsh
 
 PMSH_IP=$(docker inspect -f "{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}" pmsh)
@@ -95,6 +81,7 @@
     fi
     if [[ $(docker inspect --format '{{ .State.Running }}' cbs-sim) ]] && \
        [[ $(docker inspect --format '{{ .State.Running }}' aai-sim) ]] && \
+       [[ $(docker inspect --format '{{ .State.Running }}' mr-sim) ]] && \
        [[ $(docker inspect --format '{{ .State.Running }}' db) ]] && \
        [[ $(docker inspect --format '{{ .State.Running }}' pmsh) ]]
     then
@@ -103,14 +90,9 @@
 done
 [[ "$containers_ok" == "false" ]] && echo "Error: required container not running." && exit 1
 
-# Create topics on MR
-curl -X POST http://${DMAAP_MR_IP}:3904/events/AAI_EVENT --header 'Content-Type: application/json' --data-raw '{"message": "dummy message"}'
-sleep 2
-curl -X POST http://${DMAAP_MR_IP}:3904/events/unauthenticated.PMSH_CL_INPUT --header 'Content-Type: application/json' --data-raw '{"message": "dummy message"}'
-
-
 DB_IP_ADDRESS=$(docker inspect -f "{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}" db)
 CBS_SIM_IP_ADDRESS=$(docker inspect -f "{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}" cbs-sim)
+MR_SIM_IP_ADDRESS=$(docker inspect -f "{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}" mr-sim)
 
 #Pass any variables required by Robot test suites in ROBOT_VARIABLES
-ROBOT_VARIABLES="-v PMSH_IP:${PMSH_IP} -v MR_IP_ADDRESS:${DMAAP_MR_IP} -v DB_IP_ADDRESS:${DB_IP_ADDRESS} -v CBS_SIM_IP_ADDRESS:${CBS_SIM_IP_ADDRESS}"
+ROBOT_VARIABLES="-v PMSH_IP:${PMSH_IP} -v MR_SIM_IP_ADDRESS:${MR_SIM_IP_ADDRESS} -v DB_IP_ADDRESS:${DB_IP_ADDRESS} -v CBS_SIM_IP_ADDRESS:${CBS_SIM_IP_ADDRESS}"