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