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 static org.junit.jupiter.api.Assertions.assertEquals;
25 import org.junit.jupiter.api.Test;
26 import org.onap.dcaegen2.services.prh.config.DmaapPublisherConfiguration;
27 import org.onap.dcaegen2.services.prh.config.ImmutableDmaapPublisherConfiguration;
29 class DmaapPublisherConfigurationTest {
33 void builder_shouldBuildConfigurationObject() {
36 DmaapPublisherConfiguration configuration;
37 String dmaapHostName = "localhost";
38 Integer dmaapPortNumber = 2222;
39 String dmaapTopicName = "temp";
40 String dmaapProtocol = "http";
41 String dmaapUserName = "admin";
42 String dmaapUserPassword = "admin";
43 String dmaapContentType = "application/json";
44 String keyFile = "keyFile";
45 String trustStore = "trustStore";
46 String trustStorePass = "trustPass";
47 String keyStore = "keyStore";
48 String keyStorePass = "keyPass";
49 Boolean enableDmaapCertAuth = true;
52 configuration = new ImmutableDmaapPublisherConfiguration.Builder()
53 .dmaapHostName(dmaapHostName)
54 .dmaapPortNumber(dmaapPortNumber)
55 .dmaapTopicName(dmaapTopicName)
56 .dmaapProtocol(dmaapProtocol)
57 .dmaapUserName(dmaapUserName)
58 .dmaapUserPassword(dmaapUserPassword)
59 .dmaapContentType(dmaapContentType)
61 .trustStore(trustStore)
62 .trustStorePassword(trustStorePass)
64 .keyStorePassword(keyStorePass)
65 .enableDmaapCertAuth(enableDmaapCertAuth)
69 assertEquals("DmaapPublisherConfiguration{dmaapHostName=localhost, dmaapPortNumber=2222, "
70 + "dmaapTopicName=temp, dmaapProtocol=http, dmaapUserName=admin, dmaapUserPassword=admin, "
71 + "dmaapContentType=application/json, keyFile=keyFile, trustStore=trustStore, "
72 + "trustStorePassword=trustPass, keyStore=keyStore, keyStorePassword=keyPass, "
73 + "enableDmaapCertAuth=true}", configuration.toString());