Bump checkstyle version
[dcaegen2/collectors/hv-ves.git] / hv-collector-ves-message-generator / src / test / kotlin / org / onap / dcae / collectors / veshv / ves / message / generator / impl / parameters.kt
1 /*
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
10  *
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  *
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=========================================================
19  */
20 package org.onap.dcae.collectors.veshv.ves.message.generator.impl
21
22 import javax.json.Json
23
24 private const val validMessageParameters =
25 """[
26         {
27           "commonEventHeader": {
28             "version": "sample-version",
29             "domain": "perf3gpp",
30             "sequence": 1,
31             "priority": 1,
32             "eventId": "sample-event-id",
33             "eventName": "sample-event-name",
34             "eventType": "sample-event-type",
35             "startEpochMicrosec": 120034455,
36             "lastEpochMicrosec": 120034455,
37             "nfNamingCode": "sample-nf-naming-code",
38             "nfcNamingCode": "sample-nfc-naming-code",
39             "reportingEntityId": "sample-reporting-entity-id",
40             "reportingEntityName": "sample-reporting-entity-name",
41             "sourceId": "sample-source-id",
42             "sourceName": "sample-source-name",
43             "vesEventListenerVersion": "another-version"
44           },
45           "messageType": "VALID",
46           "messagesAmount": 25000
47         },
48         {
49           "commonEventHeader": {
50             "version": "sample-version",
51             "domain": "perf3gpp",
52             "sequence": 1,
53             "priority": 1,
54             "eventId": "sample-event-id",
55             "eventName": "sample-event-name",
56             "eventType": "sample-event-type",
57             "startEpochMicrosec": 120034455,
58             "lastEpochMicrosec": 120034455,
59             "nfNamingCode": "sample-nf-naming-code",
60             "nfcNamingCode": "sample-nfc-naming-code",
61             "reportingEntityId": "sample-reporting-entity-id",
62             "reportingEntityName": "sample-reporting-entity-name",
63             "sourceId": "sample-source-id",
64             "sourceName": "sample-source-name",
65             "vesEventListenerVersion": "another-version"
66           },
67           "messageType": "TOO_BIG_PAYLOAD",
68           "messagesAmount": 100
69         }
70         ]
71 """
72
73 private const val invalidMessageParameters =
74 """
75     [
76         {
77           "commonEventHeader": {
78             "version": "sample-version",
79             "domain": "perf3gpp",
80             "sequence": 1,
81             "priority": 1,
82             "eventId": "sample-event-id",
83             "eventName": "sample-event-name",
84             "eventType": "sample-event-type",
85             "startEpochMicrosec": 120034455,
86             "lastEpochMicrosec": 120034455,
87             "nfNamingCode": "sample-nf-naming-code",
88             "nfcNamingCode": "sample-nfc-naming-code",
89             "reportingEntityId": "sample-reporting-entity-id",
90             "reportingEntityName": "sample-reporting-entity-name",
91             "sourceId": "sample-source-id",
92             "sourceName": "sample-source-name",
93             "vesEventListenerVersion": "another-version"
94           },
95           "messagesAmount": 3
96         }
97         ]
98 """
99
100 fun validMessagesParametesJson() = Json
101         .createReader(validMessageParameters.reader())
102         .readArray()!!
103
104 fun invalidMessagesParametesJson() = Json
105         .createReader(invalidMessageParameters.reader())
106         .readArray()!!