diff options
Diffstat (limited to 'test/mocks/pnfsimulator/src/test/java/org')
3 files changed, 8 insertions, 59 deletions
diff --git a/test/mocks/pnfsimulator/src/test/java/org/onap/pnfsimulator/SimulatorParamsProviderTest.java b/test/mocks/pnfsimulator/src/test/java/org/onap/pnfsimulator/SimulatorParamsProviderTest.java index bd6584233..96397eae1 100644 --- a/test/mocks/pnfsimulator/src/test/java/org/onap/pnfsimulator/SimulatorParamsProviderTest.java +++ b/test/mocks/pnfsimulator/src/test/java/org/onap/pnfsimulator/SimulatorParamsProviderTest.java @@ -1,23 +1,3 @@ -/*- - * ============LICENSE_START======================================================= - * org.onap.integration - * ================================================================================ - * Copyright (C) 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========================================================= - */ - package org.onap.pnfsimulator; import org.apache.commons.cli.ParseException; diff --git a/test/mocks/pnfsimulator/src/test/java/org/onap/pnfsimulator/SimulatorTest.java b/test/mocks/pnfsimulator/src/test/java/org/onap/pnfsimulator/SimulatorTest.java index e3db4c837..ccbb72846 100644 --- a/test/mocks/pnfsimulator/src/test/java/org/onap/pnfsimulator/SimulatorTest.java +++ b/test/mocks/pnfsimulator/src/test/java/org/onap/pnfsimulator/SimulatorTest.java @@ -1,23 +1,3 @@ -/*- - * ============LICENSE_START======================================================= - * org.onap.integration - * ================================================================================ - * Copyright (C) 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========================================================= - */ - package org.onap.pnfsimulator; import org.assertj.core.api.Assertions; diff --git a/test/mocks/pnfsimulator/src/test/java/org/onap/pnfsimulator/message/MessageProviderTest.java b/test/mocks/pnfsimulator/src/test/java/org/onap/pnfsimulator/message/MessageProviderTest.java index d462d2592..bfd222dc2 100644 --- a/test/mocks/pnfsimulator/src/test/java/org/onap/pnfsimulator/message/MessageProviderTest.java +++ b/test/mocks/pnfsimulator/src/test/java/org/onap/pnfsimulator/message/MessageProviderTest.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * org.onap.integration * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2018 NOKIA 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. @@ -23,20 +23,7 @@ package org.onap.pnfsimulator.message; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertThrows; import static org.junit.jupiter.api.Assertions.assertTrue; -import static org.onap.pnfsimulator.message.MessageConstants.COMMON_EVENT_HEADER; -import static org.onap.pnfsimulator.message.MessageConstants.DOMAIN; -import static org.onap.pnfsimulator.message.MessageConstants.EVENT_ID; -import static org.onap.pnfsimulator.message.MessageConstants.EVENT_TYPE; -import static org.onap.pnfsimulator.message.MessageConstants.INTERNAL_HEADER_FIELDS; -import static org.onap.pnfsimulator.message.MessageConstants.LAST_EPOCH_MICROSEC; -import static org.onap.pnfsimulator.message.MessageConstants.OTHER_FIELDS; -import static org.onap.pnfsimulator.message.MessageConstants.OTHER_FIELDS_VERSION; -import static org.onap.pnfsimulator.message.MessageConstants.PNF_LAST_SERVICE_DATE; -import static org.onap.pnfsimulator.message.MessageConstants.PNF_MANUFACTURE_DATE; -import static org.onap.pnfsimulator.message.MessageConstants.PRIORITY; -import static org.onap.pnfsimulator.message.MessageConstants.SEQUENCE; -import static org.onap.pnfsimulator.message.MessageConstants.START_EPOCH_MICROSEC; -import static org.onap.pnfsimulator.message.MessageConstants.VERSION; +import static org.onap.pnfsimulator.message.MessageConstants.*; import java.util.UUID; import org.json.JSONObject; @@ -65,9 +52,10 @@ public class MessageProviderTest { @Test public void createMessage_should_create_constant_message_when_no_params_specified() { JSONObject message = messageProvider.createMessage(new JSONObject()); + JSONObject event = message.getJSONObject(EVENT); - JSONObject commonEventHeader = message.getJSONObject(COMMON_EVENT_HEADER); - JSONObject otherFields = message.getJSONObject(OTHER_FIELDS); + JSONObject commonEventHeader = event.getJSONObject(COMMON_EVENT_HEADER); + JSONObject otherFields = event.getJSONObject(OTHER_FIELDS); JSONObject expectedCommonEventHeader = generateConstantCommonEventHeader(); JSONObject expectedOtherFields = generateConstantOtherFields(); @@ -89,8 +77,9 @@ public class MessageProviderTest { JSONObject params = new JSONObject(testParamsJson); JSONObject message = messageProvider.createMessage(params); - JSONObject commonEventHeader = message.getJSONObject(COMMON_EVENT_HEADER); - JSONObject otherFields = message.getJSONObject(OTHER_FIELDS); + JSONObject event = message.getJSONObject(EVENT); + JSONObject commonEventHeader = event.getJSONObject(COMMON_EVENT_HEADER); + JSONObject otherFields = event.getJSONObject(OTHER_FIELDS); assertEquals("pnfVal3", otherFields.getString("pnfKey3")); assertEquals("val1", commonEventHeader.getString("key1")); |