2 * ============LICENSE_START=======================================================
3 * dcaegen2-collectors-veshv
4 * ================================================================================
5 * Copyright (C) 2018 NOKIA
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END=========================================================
20 package org.onap.dcae.collectors.veshv.ves.message.generator.impl.impl
22 import javax.json.Json
24 private const val validMessageParameters = "[\n" +
26 " \"commonEventHeader\": {\n" +
27 " \"version\": \"sample-version\",\n" +
28 " \"domain\": \"HVRANMEAS\",\n" +
29 " \"sequence\": 1,\n" +
30 " \"priority\": 1,\n" +
31 " \"eventId\": \"sample-event-id\",\n" +
32 " \"eventName\": \"sample-event-name\",\n" +
33 " \"eventType\": \"sample-event-type\",\n" +
34 " \"startEpochMicrosec\": 120034455,\n" +
35 " \"lastEpochMicrosec\": 120034455,\n" +
36 " \"nfNamingCode\": \"sample-nf-naming-code\",\n" +
37 " \"nfcNamingCode\": \"sample-nfc-naming-code\",\n" +
38 " \"reportingEntityId\": \"sample-reporting-entity-id\",\n" +
39 " \"reportingEntityName\": \"sample-reporting-entity-name\",\n" +
40 " \"sourceId\": \"sample-source-id\",\n" +
41 " \"sourceName\": \"sample-source-name\"\n" +
43 " \"messageType\": \"VALID\",\n" +
44 " \"messagesAmount\": 25000\n" +
47 " \"commonEventHeader\": {\n" +
48 " \"version\": \"sample-version\",\n" +
49 " \"domain\": \"HVRANMEAS\",\n" +
50 " \"sequence\": 1,\n" +
51 " \"priority\": 1,\n" +
52 " \"eventId\": \"sample-event-id\",\n" +
53 " \"eventName\": \"sample-event-name\",\n" +
54 " \"eventType\": \"sample-event-type\",\n" +
55 " \"startEpochMicrosec\": 120034455,\n" +
56 " \"lastEpochMicrosec\": 120034455,\n" +
57 " \"nfNamingCode\": \"sample-nf-naming-code\",\n" +
58 " \"nfcNamingCode\": \"sample-nfc-naming-code\",\n" +
59 " \"reportingEntityId\": \"sample-reporting-entity-id\",\n" +
60 " \"reportingEntityName\": \"sample-reporting-entity-name\",\n" +
61 " \"sourceId\": \"sample-source-id\",\n" +
62 " \"sourceName\": \"sample-source-name\"\n" +
64 " \"messageType\": \"TOO_BIG_PAYLOAD\",\n" +
65 " \"messagesAmount\": 100\n" +
69 private const val invalidMessageParameters = "[\n" +
71 " \"commonEventHeader\": {\n" +
72 " \"version\": \"sample-version\",\n" +
73 " \"domain\": \"HVRANMEAS\",\n" +
74 " \"sequence\": 1,\n" +
75 " \"priority\": 1,\n" +
76 " \"eventId\": \"sample-event-id\",\n" +
77 " \"eventName\": \"sample-event-name\",\n" +
78 " \"eventType\": \"sample-event-type\",\n" +
79 " \"startEpochMicrosec\": 120034455,\n" +
80 " \"lastEpochMicrosec\": 120034455,\n" +
81 " \"nfNamingCode\": \"sample-nf-naming-code\",\n" +
82 " \"nfcNamingCode\": \"sample-nfc-naming-code\",\n" +
83 " \"reportingEntityId\": \"sample-reporting-entity-id\",\n" +
84 " \"reportingEntityName\": \"sample-reporting-entity-name\",\n" +
85 " \"sourceId\": \"sample-source-id\",\n" +
86 " \"sourceName\": \"sample-source-name\"\n" +
88 " \"messagesAmount\": 3\n" +
92 fun validMessagesParametesJson() = Json
93 .createReader(validMessageParameters.reader())
96 fun invalidMessagesParametesJson() = Json
97 .createReader(invalidMessageParameters.reader())