aboutsummaryrefslogtreecommitdiffstats
path: root/appc-event-listener/appc-event-listener-bundle/src/test/java
diff options
context:
space:
mode:
Diffstat (limited to 'appc-event-listener/appc-event-listener-bundle/src/test/java')
-rw-r--r--appc-event-listener/appc-event-listener-bundle/src/test/java/org/onap/appc/listener/demo/model/TestMessages.java41
1 files changed, 33 insertions, 8 deletions
diff --git a/appc-event-listener/appc-event-listener-bundle/src/test/java/org/onap/appc/listener/demo/model/TestMessages.java b/appc-event-listener/appc-event-listener-bundle/src/test/java/org/onap/appc/listener/demo/model/TestMessages.java
index 2462e517e..62ea83a2d 100644
--- a/appc-event-listener/appc-event-listener-bundle/src/test/java/org/onap/appc/listener/demo/model/TestMessages.java
+++ b/appc-event-listener/appc-event-listener-bundle/src/test/java/org/onap/appc/listener/demo/model/TestMessages.java
@@ -7,6 +7,8 @@
* Copyright (C) 2017 Amdocs
* =============================================================================
* Modification Copyright (C) 2018 IBM.
+ * ================================================================================
+ * Modifications Copyright (C) 2019 Ericsson
* =============================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -27,16 +29,17 @@ package org.onap.appc.listener.demo.model;
import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
-
+import java.util.ArrayList;
+import java.util.Collection;
import org.apache.commons.io.IOUtils;
import org.json.JSONObject;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
+import org.onap.appc.listener.demo.model.CommonMessage.pgStream;
import org.onap.appc.listener.demo.model.IncomingMessage;
import org.onap.appc.listener.demo.model.OutgoingMessage;
import org.onap.appc.listener.demo.model.Status;
@@ -64,7 +67,6 @@ public class TestMessages {
assertNotNull(in);
assertNotNull(out);
} catch (Exception e) {
- e.printStackTrace();
fail(e.getMessage());
}
}
@@ -79,7 +81,7 @@ public class TestMessages {
assertNotNull(in.getHeader().getRequestID());
assertNotNull(in.getHeader().getSubRequestId());
assertNotNull(in.getHeader().getTimeStamp());
-
+
assertNotNull(out);
assertNotNull(out.getHeader().getApiVer());
assertNotNull(out.getHeader().getOriginatorId());
@@ -90,7 +92,7 @@ public class TestMessages {
assertNotNull(out.getStatus().getValue());
}
-
+
@Test
public void testGetRequest()
{
@@ -98,7 +100,7 @@ public class TestMessages {
in.setRequest(request);
assertEquals(request, in.getRequest());
}
-
+
@Test
public void testIsValid()
{
@@ -106,6 +108,30 @@ public class TestMessages {
}
@Test
+ public void testTime() {
+ in.setStartTime(0);
+ assertEquals(0, in.getStartTime());
+ }
+
+ @Test
+ public void testPayload() {
+ CommonMessage.Payload payload = new CommonMessage.Payload();
+ payload.setGenericVnfId("VNF_ID");
+ CommonMessage.pgStream pgStream = new CommonMessage.pgStream();
+ pgStream.setId("ID");
+ pgStream.setIsEnabled("true");
+ CommonMessage.pgStreams pgStreams = new CommonMessage.pgStreams();
+ Collection<pgStream> collectionPgStreams = new ArrayList<pgStream>();
+ collectionPgStreams.add(pgStream);
+ pgStreams.setStreams(collectionPgStreams);
+ payload.setPgStreams(pgStreams);
+ in.setPayload(payload);
+ assertEquals("VNF_ID", in.getPayload().getGenericVnfId());
+ assertEquals("{\\\"pg-streams\\\": {\\\"pg-stream\\\":[{\\\"id\\\":\\\"ID\\\", \\\"is-enabled\\\":\\\"true\\\"}]}}",
+ in.getPayload().getPgStreams());
+ }
+
+ @Test
@Ignore
public void testIncommingToOutgoing(){
OutgoingMessage newOut;
@@ -119,7 +145,7 @@ public class TestMessages {
assertNotNull(newOut.getStatus().getCode());
assertNotNull(newOut.getStatus().getValue());
}
-
+
@Test
@Ignore
public void testToString() {
@@ -131,7 +157,6 @@ public class TestMessages {
assertTrue(in.toString().contains(id));
}
-
@Test
@Ignore
public void testOutgoingUpdateTime() {
e */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */ }
###
# ============LICENSE_START==========================================
# ONAP Portal SDK
# ===================================================================
# Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.
# ===================================================================
#
# Unless otherwise specified, all software contained herein is licensed
# under the Apache License, Version 2.0 (the “License”);
# you may not use this software 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.
#
# Unless otherwise specified, all documentation contained herein is licensed
# under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
# you may not use this documentation except in compliance with the License.
# You may obtain a copy of the License at
#
#             https://creativecommons.org/licenses/by/4.0/
#
# Unless required by applicable law or agreed to in writing, documentation
# 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============================================
#
# 
###
# Properties read by ONAP Portal Framework library, ecompFW.jar

##########################################################################
# The following properties should NOT be changed by partner applications.
##########################################################################

portal.api.prefix = /api
max.idle.time = 5
user.attribute.name = user_attribute

#Use REST API instead of UEB to fetch the functional menu data
use_rest_for_functional_menu=true

##########################################################################
# The following properties MUST be changed by partner applications.
##########################################################################

# Name of java class that implements the OnBoardingApiService interface.
portal.api.impl.class = org.onap.portalapp.service.OnBoardingApiServiceImpl

# URL of the Portal where this app is onboarded
ecomp_redirect_url = http://portal.api.simpledemo.onap.org:8989/ONAPPORTAL/login.htm

# URL of the ONAP Portal REST API
ecomp_rest_url = http://portal.api.simpledemo.onap.org:8989/ONAPPORTAL/auxapi

# Applications do not need to run a UEB listener after 1607.
ueb_listeners_enable = false

# UEB Configuration
# If key ueb_listeners_enable is set to false,
# then only the ueb_app_key is required.
ueb_app_key = REPLACE-ME-UEB-APP-KEY-EPSDK-APP-OS