44651a544ecad1fba5cf224f09cc53626952f747
[dcaegen2/services/prh.git] /
1 /*
2  * ============LICENSE_START=======================================================
3  * PNF-REGISTRATION-HANDLER
4  * ================================================================================
5  * Copyright (C) 2018 NOKIA Intellectual Property. All rights reserved.
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
21 package org.onap.dcaegen2.services.prh.service;
22
23 import static org.mockito.Mockito.spy;
24
25 import com.google.gson.JsonElement;
26 import com.google.gson.JsonParser;
27 import java.util.Optional;
28 import org.junit.jupiter.api.Assertions;
29 import org.junit.jupiter.api.Test;
30 import org.mockito.Mockito;
31 import org.onap.dcaegen2.services.prh.model.ConsumerDmaapModel;
32 import org.onap.dcaegen2.services.prh.model.ImmutableConsumerDmaapModel;
33 import reactor.core.publisher.Mono;
34 import reactor.test.StepVerifier;
35
36 /**
37  * @author <a href="mailto:przemyslaw.wasala@nokia.com">Przemysław Wąsala</a> on 5/8/18
38  */
39 class DmaapConsumerJsonParserTest {
40
41     @Test
42     void whenPassingCorrectJson_validationNotThrowingAnException() {
43         //given
44         String message = "[{\"event\": {"
45                 + "\"commonEventHeader\": { "
46                 + " \"sourceName\":\"NOKQTFCOC540002E\","
47                 + " \"nfNamingCode\":\"gNB\" "
48                 + "},"
49                 + "\"pnfRegistrationFields\": {"
50                 + " \"vendorName\": \"nokia\","
51                 + " \"serialNumber\": \"QTFCOC540002E\","
52                 + " \"pnfRegistrationFieldsVersion\": \"2.0\","
53                 + " \"modelNumber\": \"3310\","
54                 + " \"unitType\": \"type\",\n"
55                 + " \"unitFamily\": \"BBU\","
56                 + " \"oamV4IpAddress\": \"10.16.123.234\","
57                 + " \"softwareVersion\": \"v4.5.0.1\","
58                 + " \"oamV6IpAddress\": \"0:0:0:0:0:FFFF:0A10:7BEA\""
59                 + "}}}]";
60
61         String parsed = "{\"event\": {"
62                 + "\"commonEventHeader\": { "
63                 + " \"sourceName\":\"NOKQTFCOC540002E\","
64                 + " \"nfNamingCode\":\"gNB\" "
65                 + "},"
66                 + "\"pnfRegistrationFields\": {"
67                 + " \"vendorName\": \"nokia\","
68                 + " \"serialNumber\": \"QTFCOC540002E\","
69                 + " \"pnfRegistrationFieldsVersion\": \"2.0\","
70                 + " \"modelNumber\": \"3310\","
71                 + " \"unitType\": \"type\",\n"
72                 + " \"unitFamily\": \"BBU\","
73                 + " \"oamV4IpAddress\": \"10.16.123.234\","
74                 + " \"softwareVersion\": \"v4.5.0.1\","
75                 + " \"oamV6IpAddress\": \"0:0:0:0:0:FFFF:0A10:7BEA\""
76                 + "}}}";
77
78         ConsumerDmaapModel expectedObject = ImmutableConsumerDmaapModel.builder()
79                 .ipv4("10.16.123.234")
80                 .ipv6("0:0:0:0:0:FFFF:0A10:7BEA")
81                 .correlationId("NOKQTFCOC540002E")
82                 .serialNumber("QTFCOC540002E")
83                 .equipVendor("nokia")
84                 .equipModel("3310")
85                 .equipType("type")
86                 .nfRole("gNB")
87                 .swVersion("v4.5.0.1")
88                 .build();
89         //when
90         DmaapConsumerJsonParser dmaapConsumerJsonParser = spy(new DmaapConsumerJsonParser());
91         JsonElement jsonElement = new JsonParser().parse(parsed);
92         Mockito.doReturn(Optional.of(jsonElement.getAsJsonObject()))
93             .when(dmaapConsumerJsonParser).getJsonObjectFromAnArray(jsonElement);
94         ConsumerDmaapModel consumerDmaapModel = dmaapConsumerJsonParser
95             .getJsonObject(Mono.just((message))).blockFirst();
96         //then
97         Assertions.assertNotNull(consumerDmaapModel);
98         Assertions.assertEquals(expectedObject, consumerDmaapModel);
99     }
100
101     @Test
102     void whenPassingCorrectJsonWithoutIpv4_validationNotThrowingAnException() {
103         //given
104         String message = "[{\"event\": {"
105                 + "\"commonEventHeader\": { "
106                 + " \"sourceName\":\"NOKQTFCOC540002E\","
107                 + " \"nfNamingCode\":\"gNB\" "
108                 + "},"
109                 + "\"pnfRegistrationFields\": {"
110                 + " \"vendorName\": \"nokia\","
111                 + " \"serialNumber\": \"QTFCOC540002E\","
112                 + " \"pnfRegistrationFieldsVersion\": \"2.0\","
113                 + " \"modelNumber\": \"3310\","
114                 + " \"unitType\": \"type\",\n"
115                 + " \"unitFamily\": \"BBU\","
116                 + " \"softwareVersion\": \"v4.5.0.1\","
117                 + " \"oamV6IpAddress\": \"0:0:0:0:0:FFFF:0A10:7BEA\""
118                 + "}}}]";
119
120         String parsed = "{\"event\": {"
121                 + "\"commonEventHeader\": { "
122                 + " \"sourceName\":\"NOKQTFCOC540002E\","
123                 + " \"nfNamingCode\":\"gNB\" "
124                 + "},"
125                 + "\"pnfRegistrationFields\": {"
126                 + " \"vendorName\": \"nokia\","
127                 + " \"serialNumber\": \"QTFCOC540002E\","
128                 + " \"pnfRegistrationFieldsVersion\": \"2.0\","
129                 + " \"modelNumber\": \"3310\","
130                 + " \"unitType\": \"type\",\n"
131                 + " \"unitFamily\": \"BBU\","
132                 + " \"softwareVersion\": \"v4.5.0.1\","
133                 + " \"oamV6IpAddress\": \"0:0:0:0:0:FFFF:0A10:7BEA\""
134                 + "}}}";
135
136         //when
137         DmaapConsumerJsonParser dmaapConsumerJsonParser = spy(new DmaapConsumerJsonParser());
138         JsonElement jsonElement = new JsonParser().parse(parsed);
139         Mockito.doReturn(Optional.of(jsonElement.getAsJsonObject()))
140             .when(dmaapConsumerJsonParser).getJsonObjectFromAnArray(jsonElement);
141         dmaapConsumerJsonParser.getJsonObject(Mono.just((message)));
142         ConsumerDmaapModel consumerDmaapModel = dmaapConsumerJsonParser.getJsonObject(Mono.just((message)))
143             .blockFirst();
144         //then
145         ConsumerDmaapModel expectedObject = ImmutableConsumerDmaapModel.builder()
146                 .ipv4("")
147                 .ipv6("0:0:0:0:0:FFFF:0A10:7BEA")
148                 .correlationId("NOKQTFCOC540002E")
149                 .serialNumber("QTFCOC540002E")
150                 .equipVendor("nokia")
151                 .equipModel("3310")
152                 .equipType("type")
153                 .nfRole("gNB")
154                 .swVersion("v4.5.0.1")
155                 .build();
156         Assertions.assertNotNull(consumerDmaapModel);
157         Assertions.assertEquals(expectedObject, consumerDmaapModel);
158     }
159
160     @Test
161     void whenPassingCorrectJsonWithoutIpv6_validationNotThrowingAnException() {
162         //given
163         String message = "[{\"event\": {"
164                 + "\"commonEventHeader\": { "
165                 + " \"sourceName\":\"NOKQTFCOC540002E\","
166                 + " \"nfNamingCode\":\"gNB\" "
167                 + "},"
168                 + "\"pnfRegistrationFields\": {"
169                 + " \"vendorName\": \"nokia\","
170                 + " \"serialNumber\": \"QTFCOC540002E\","
171                 + " \"pnfRegistrationFieldsVersion\": \"2.0\","
172                 + " \"modelNumber\": \"3310\","
173                 + " \"unitType\": \"type\",\n"
174                 + " \"unitFamily\": \"BBU\","
175                 + " \"oamV4IpAddress\": \"10.16.123.234\","
176                 + " \"softwareVersion\": \"v4.5.0.1\""
177                 + "}}}]";
178
179
180         String parsed = "{\"event\": {"
181                 + "\"commonEventHeader\": { "
182                 + " \"sourceName\":\"NOKQTFCOC540002E\","
183                 + " \"nfNamingCode\":\"gNB\" "
184                 + "},"
185                 + "\"pnfRegistrationFields\": {"
186                 + " \"vendorName\": \"nokia\","
187                 + " \"serialNumber\": \"QTFCOC540002E\","
188                 + " \"pnfRegistrationFieldsVersion\": \"2.0\","
189                 + " \"modelNumber\": \"3310\","
190                 + " \"unitType\": \"type\",\n"
191                 + " \"unitFamily\": \"BBU\","
192                 + " \"oamV4IpAddress\": \"10.16.123.234\","
193                 + " \"softwareVersion\": \"v4.5.0.1\""
194                 + "}}}";
195
196
197         ConsumerDmaapModel expectedObject = ImmutableConsumerDmaapModel.builder()
198                 .ipv4("10.16.123.234")
199                 .ipv6("")
200                 .correlationId("NOKQTFCOC540002E")
201                 .serialNumber("QTFCOC540002E")
202                 .equipVendor("nokia")
203                 .equipModel("3310")
204                 .equipType("type")
205                 .nfRole("gNB")
206                 .swVersion("v4.5.0.1")
207                 .build();
208         //when
209         DmaapConsumerJsonParser dmaapConsumerJsonParser = spy(new DmaapConsumerJsonParser());
210         JsonElement jsonElement = new JsonParser().parse(parsed);
211         Mockito.doReturn(Optional.of(jsonElement.getAsJsonObject()))
212             .when(dmaapConsumerJsonParser).getJsonObjectFromAnArray(jsonElement);
213         ConsumerDmaapModel consumerDmaapModel = dmaapConsumerJsonParser.getJsonObject(Mono.just((message)))
214             .blockFirst();
215         //then
216         Assertions.assertNotNull(consumerDmaapModel);
217         Assertions.assertEquals(expectedObject, consumerDmaapModel);
218     }
219
220     @Test
221     void whenPassingCorrectJsonWithoutIpv4andIpv6_validationAddingAnException() {
222         //given
223         String message = "[{\"event\": {"
224                 + "\"commonEventHeader\": { "
225                 + " \"sourceName\":\"NOKQTFCOC540002E\","
226                 + " \"nfNamingCode\":\"gNB\" "
227                 + "},"
228                 + "\"pnfRegistrationFields\": {"
229                 + " \"vendorName\": \"nokia\","
230                 + " \"serialNumber\": \"QTFCOC540002E\","
231                 + " \"pnfRegistrationFieldsVersion\": \"2.0\","
232                 + " \"modelNumber\": \"3310\","
233                 + " \"unitType\": \"type\",\n"
234                 + " \"unitFamily\": \"BBU\","
235                 + " \"softwareVersion\": \"v4.5.0.1\""
236                 + "}}}]";
237
238         String parsed = "{\"event\": {"
239                 + "\"commonEventHeader\": { "
240                 + " \"sourceName\":\"NOKQTFCOC540002E\","
241                 + " \"nfNamingCode\":\"gNB\" "
242                 + "},"
243                 + "\"pnfRegistrationFields\": {"
244                 + " \"vendorName\": \"nokia\","
245                 + " \"serialNumber\": \"QTFCOC540002E\","
246                 + " \"pnfRegistrationFieldsVersion\": \"2.0\","
247                 + " \"modelNumber\": \"3310\","
248                 + " \"unitType\": \"type\",\n"
249                 + " \"unitFamily\": \"BBU\","
250                 + " \"softwareVersion\": \"v4.5.0.1\""
251                 + "}}}";
252
253         DmaapConsumerJsonParser dmaapConsumerJsonParser = spy(new DmaapConsumerJsonParser());
254         JsonElement jsonElement = new JsonParser().parse(parsed);
255         Mockito.doReturn(Optional.of(jsonElement.getAsJsonObject()))
256             .when(dmaapConsumerJsonParser).getJsonObjectFromAnArray(jsonElement);
257         StepVerifier.create(dmaapConsumerJsonParser.getJsonObject(Mono.just(message)))
258             .expectSubscription().thenRequest(1).verifyComplete();
259
260     }
261
262     @Test
263     void whenPassingJsonWithoutMandatoryHeaderInformation_validationAddingAnException() {
264         String parsed = "{\"event\": {"
265             + "\"commonEventHeader\": {},"
266             + "\"pnfRegistrationFields\": {"
267             + " \"unitType\": \"AirScale\","
268             + " \"serialNumber\": \"QTFCOC540002E\","
269             + " \"pnfRegistrationFieldsVersion\": \"2.0\","
270             + " \"manufactureDate\": \"1535014037024\","
271             + " \"modelNumber\": \"7BEA\",\n"
272             + " \"lastServiceDate\": \"1535014037024\","
273             + " \"unitFamily\": \"BBU\","
274             + " \"vendorName\": \"Nokia\","
275             + " \"softwareVersion\": \"v4.5.0.1\""
276             + "}}}";
277
278         DmaapConsumerJsonParser dmaapConsumerJsonParser = spy(new DmaapConsumerJsonParser());
279         JsonElement jsonElement = new JsonParser().parse(parsed);
280         Mockito.doReturn(Optional.of(jsonElement.getAsJsonObject()))
281             .when(dmaapConsumerJsonParser).getJsonObjectFromAnArray(jsonElement);
282         String incorrectMessage = "[{\"event\": {"
283             + "\"commonEventHeader\": {},"
284             + "\"pnfRegistrationFields\": {"
285             + " \"unitType\": \"AirScale\","
286             + " \"serialNumber\": \"QTFCOC540002E\","
287             + " \"pnfRegistrationFieldsVersion\": \"2.0\","
288             + " \"manufactureDate\": \"1535014037024\","
289             + " \"modelNumber\": \"7BEA\",\n"
290             + " \"lastServiceDate\": \"1535014037024\","
291             + " \"unitFamily\": \"BBU\","
292             + " \"vendorName\": \"Nokia\","
293             + " \"softwareVersion\": \"v4.5.0.1\""
294             + "}}}]";
295         StepVerifier.create(dmaapConsumerJsonParser.getJsonObject(Mono.just(incorrectMessage)))
296             .expectSubscription().thenRequest(1).verifyComplete();
297     }
298
299     @Test
300     void whenPassingJsonWithoutSourceName_validationAddingAnException() {
301         String parsed = "{\"event\": {"
302             + "\"commonEventHeader\": {},"
303             + "\"pnfRegistrationFields\": {"
304             + " \"unitType\": \"AirScale\","
305             + " \"serialNumber\": \"QTFCOC540002E\","
306             + " \"pnfRegistrationFieldsVersion\": \"2.0\","
307             + " \"manufactureDate\": \"1535014037024\","
308             + " \"modelNumber\": \"7BEA\",\n"
309             + " \"lastServiceDate\": \"1535014037024\","
310             + " \"unitFamily\": \"BBU\","
311             + " \"vendorName\": \"Nokia\","
312             + " \"softwareVersion\": \"v4.5.0.1\","
313             + " \"oamV6IpAddress\": \"0:0:0:0:0:FFFF:0A10:7BEA\""
314             + "}}}";
315
316         DmaapConsumerJsonParser dmaapConsumerJsonParser = spy(new DmaapConsumerJsonParser());
317         JsonElement jsonElement = new JsonParser().parse(parsed);
318         Mockito.doReturn(Optional.of(jsonElement.getAsJsonObject()))
319             .when(dmaapConsumerJsonParser).getJsonObjectFromAnArray(jsonElement);
320         String jsonWithoutSourceName =
321             "[{\"event\": {"
322                 + "\"commonEventHeader\": {},"
323                 + "\"pnfRegistrationFields\": {"
324                 + " \"unitType\": \"AirScale\","
325                 + " \"serialNumber\": \"QTFCOC540002E\","
326                 + " \"pnfRegistrationFieldsVersion\": \"2.0\","
327                 + " \"manufactureDate\": \"1535014037024\","
328                 + " \"modelNumber\": \"7BEA\",\n"
329                 + " \"lastServiceDate\": \"1535014037024\","
330                 + " \"unitFamily\": \"BBU\","
331                 + " \"vendorName\": \"Nokia\","
332                 + " \"softwareVersion\": \"v4.5.0.1\","
333                 + " \"oamV6IpAddress\": \"0:0:0:0:0:FFFF:0A10:7BEA\""
334                 + "}}}]";
335         StepVerifier
336             .create(dmaapConsumerJsonParser.getJsonObject(Mono.just(jsonWithoutSourceName)))
337             .expectSubscription().thenRequest(1)
338             .verifyComplete();
339     }
340
341     @Test
342     void whenPassingJsonWithoutIpInformation_validationAddingAnException() {
343         String parsed =
344             "{\"event\": {"
345                 + "\"commonEventHeader\": {\"sourceName\": \"NOKQTFCOC540002E\"},"
346                 + "\"pnfRegistrationFields\": {"
347                 + " \"unitType\": \"AirScale\","
348                 + " \"serialNumber\": \"QTFCOC540002E\","
349                 + " \"pnfRegistrationFieldsVersion\": \"2.0\","
350                 + " \"manufactureDate\": \"1535014037024\","
351                 + " \"modelNumber\": \"7BEA\",\n"
352                 + " \"lastServiceDate\": \"1535014037024\","
353                 + " \"unitFamily\": \"BBU\","
354                 + " \"vendorName\": \"Nokia\","
355                 + " \"softwareVersion\": \"v4.5.0.1\","
356                 + " \"oamV4IpAddress\": \"\","
357                 + " \"oamV6IpAddress\": \"\""
358                 + "}}}";
359
360         DmaapConsumerJsonParser dmaapConsumerJsonParser = spy(new DmaapConsumerJsonParser());
361         JsonElement jsonElement = new JsonParser().parse(parsed);
362         Mockito.doReturn(Optional.of(jsonElement.getAsJsonObject()))
363             .when(dmaapConsumerJsonParser).getJsonObjectFromAnArray(jsonElement);
364         String jsonWithoutIpInformation =
365             "[{\"event\": {"
366                 + "\"commonEventHeader\": {\"sourceName\": \"NOKQTFCOC540002E\"},"
367                 + "\"pnfRegistrationFields\": {"
368                 + " \"unitType\": \"AirScale\","
369                 + " \"serialNumber\": \"QTFCOC540002E\","
370                 + " \"pnfRegistrationFieldsVersion\": \"2.0\","
371                 + " \"manufactureDate\": \"1535014037024\","
372                 + " \"modelNumber\": \"7BEA\",\n"
373                 + " \"lastServiceDate\": \"1535014037024\","
374                 + " \"unitFamily\": \"BBU\","
375                 + " \"vendorName\": \"Nokia\","
376                 + " \"softwareVersion\": \"v4.5.0.1\","
377                 + " \"oamV4IpAddress\": \"\","
378                 + " \"oamV6IpAddress\": \"\""
379                 + "}}}]";
380         StepVerifier.create(dmaapConsumerJsonParser.getJsonObject(Mono.just(jsonWithoutIpInformation)))
381             .expectSubscription().thenRequest(1).verifyComplete();
382     }
383
384     @Test
385     void whenPassingJsonWithoutSourceNameValue_validationAddingAnException() {
386         String parsed =
387             "{\"event\": {"
388                 + "\"commonEventHeader\": {\"sourceName\": \"\"},"
389                 + "\"pnfRegistrationFields\": {"
390                 + " \"unitType\": \"AirScale\","
391                 + " \"serialNumber\": \"QTFCOC540002E\","
392                 + " \"pnfRegistrationFieldsVersion\": \"2.0\","
393                 + " \"manufactureDate\": \"1535014037024\","
394                 + " \"modelNumber\": \"7BEA\",\n"
395                 + " \"lastServiceDate\": \"1535014037024\","
396                 + " \"unitFamily\": \"BBU\","
397                 + " \"vendorName\": \"Nokia\","
398                 + " \"softwareVersion\": \"v4.5.0.1\","
399                 + " \"oamV4IpAddress\": \"10.16.123.234\","
400                 + " \"oamV6IpAddress\": \"0:0:0:0:0:FFFF:0A10:7BEA\""
401                 + "}}}";
402
403         DmaapConsumerJsonParser dmaapConsumerJsonParser = spy(new DmaapConsumerJsonParser());
404         JsonElement jsonElement = new JsonParser().parse(parsed);
405         Mockito.doReturn(Optional.of(jsonElement.getAsJsonObject()))
406             .when(dmaapConsumerJsonParser).getJsonObjectFromAnArray(jsonElement);
407         String jsonWithoutIpInformation =
408             "[{\"event\": {"
409                 + "\"commonEventHeader\": {\"sourceName\": \"\"},"
410                 + "\"pnfRegistrationFields\": {"
411                 + " \"unitType\": \"AirScale\","
412                 + " \"serialNumber\": \"QTFCOC540002E\","
413                 + " \"pnfRegistrationFieldsVersion\": \"2.0\","
414                 + " \"manufactureDate\": \"1535014037024\","
415                 + " \"modelNumber\": \"7BEA\",\n"
416                 + " \"lastServiceDate\": \"1535014037024\","
417                 + " \"unitFamily\": \"BBU\","
418                 + " \"vendorName\": \"Nokia\","
419                 + " \"softwareVersion\": \"v4.5.0.1\","
420                 + " \"oamV4IpAddress\": \"10.16.123.234\","
421                 + " \"oamV6IpAddress\": \"0:0:0:0:0:FFFF:0A10:7BEA\""
422                 + "}}}]";
423         StepVerifier.create(dmaapConsumerJsonParser.getJsonObject(Mono.just(jsonWithoutIpInformation)))
424             .expectSubscription().thenRequest(1).verifyComplete();
425     }
426
427     @Test
428     void whenPassingCorrectJsoArrayWithoutIpv4_validationNotThrowingAnException() {
429         //given
430         String message = "[{\"event\": {"
431                 + "\"commonEventHeader\": { "
432                 + "  \"sourceName\":\"NOKQTFCOC540002E\","
433                 + "  \"nfNamingCode\":\"gNB\" "
434                 + "  },"
435                 + "\"pnfRegistrationFields\": {"
436                 + " \"vendorName\": \"nokia\","
437                 + " \"serialNumber\": \"QTFCOC540002E\","
438                 + " \"pnfRegistrationFieldsVersion\": \"2.0\","
439                 + " \"modelNumber\": \"3310\","
440                 + " \"unitType\": \"type\",\n"
441                 + " \"unitFamily\": \"BBU\","
442                 + " \"softwareVersion\": \"v4.5.0.1\","
443                 + " \"oamV6IpAddress\": \"0:0:0:0:0:FFFF:0A10:7BEA\""
444                 + "}}},"
445                 + " {\"event\": {"
446                 + "\"commonEventHeader\": { "
447                 + " \"sourceName\":\"NOKQTFCOC540002E\","
448                 + " \"nfNamingCode\":\"gNB\" "
449                 + "},"
450                 + "\"pnfRegistrationFields\": {"
451                 + " \"vendorName\": \"nokia\","
452                 + " \"serialNumber\": \"QTFCOC540002E\","
453                 + " \"pnfRegistrationFieldsVersion\": \"2.0\","
454                 + " \"modelNumber\": \"3310\","
455                 + " \"unitType\": \"type\",\n"
456                 + " \"unitFamily\": \"BBU\","
457                 + " \"softwareVersion\": \"v4.5.0.1\","
458                 + " \"oamV6IpAddress\": \"0:0:0:0:0:FFFF:0A10:7BEA\""
459                 + "}}}]";
460
461
462
463
464
465         ConsumerDmaapModel expectedObject = ImmutableConsumerDmaapModel.builder()
466                 .ipv4("")
467                 .ipv6("0:0:0:0:0:FFFF:0A10:7BEA")
468                 .correlationId("NOKQTFCOC540002E")
469                 .serialNumber("QTFCOC540002E")
470                 .equipVendor("nokia")
471                 .equipModel("3310")
472                 .equipType("type")
473                 .nfRole("gNB")
474                 .swVersion("v4.5.0.1")
475                 .build();
476         //when
477         DmaapConsumerJsonParser dmaapConsumerJsonParser = new DmaapConsumerJsonParser();
478
479         //then
480         StepVerifier.create(dmaapConsumerJsonParser.getJsonObject(Mono.just(message)))
481             .expectSubscription().expectNext(expectedObject).expectNext(expectedObject).verifyComplete();
482     }
483 }