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
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=========================================================
21 package org.onap.dcaegen2.services.prh.service.config;
23 import org.junit.jupiter.api.Assertions;
24 import org.junit.jupiter.api.Test;
25 import org.onap.dcaegen2.services.prh.config.DmaapPublisherConfiguration;
26 import org.onap.dcaegen2.services.prh.config.ImmutableDmaapPublisherConfiguration;
28 class DmaapPublisherConfigurationTest {
32 void builder_shouldBuildConfigurationObject() {
35 DmaapPublisherConfiguration configuration;
36 String dmaapHostName = "localhost";
37 Integer dmaapPortNumber = 2222;
38 String dmaapTopicName = "temp";
39 String dmaapProtocol = "http";
40 String dmaapUserName = "admin";
41 String dmaapUserPassword = "admin";
42 String dmaapContentType = "application/json";
45 configuration = new ImmutableDmaapPublisherConfiguration.Builder()
46 .dmaapHostName(dmaapHostName)
47 .dmaapPortNumber(dmaapPortNumber)
48 .dmaapTopicName(dmaapTopicName)
49 .dmaapProtocol(dmaapProtocol)
50 .dmaapUserName(dmaapUserName)
51 .dmaapUserPassword(dmaapUserPassword)
52 .dmaapContentType(dmaapContentType)
56 Assertions.assertNotNull(configuration);
57 Assertions.assertEquals(dmaapHostName, configuration.dmaapHostName());
58 Assertions.assertEquals(dmaapPortNumber, configuration.dmaapPortNumber());
59 Assertions.assertEquals(dmaapTopicName, configuration.dmaapTopicName());
60 Assertions.assertEquals(dmaapProtocol, configuration.dmaapProtocol());
61 Assertions.assertEquals(dmaapUserName, configuration.dmaapUserName());
62 Assertions.assertEquals(dmaapUserPassword, configuration.dmaapUserPassword());