2 * Copyright © 2016-2018 European Support Limited
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 package org.openecomp.sdc.logging.api;
19 import static org.testng.Assert.assertEquals;
20 import static org.testng.Assert.assertNull;
22 import org.testng.annotations.Test;
25 * Unit-testing context data builder.
30 public class ContextDataTest {
33 public void allPropertiesReadWhenPopulated() {
35 final String serviceName = "running-service";
36 final String partnerName = "remote-partner";
37 final String requestId = "123412341234";
39 ContextData data = ContextData.builder()
40 .serviceName(serviceName).partnerName(partnerName).requestId(requestId).build();
42 assertEquals(data.getRequestId(), requestId);
43 assertEquals(data.getServiceName(), serviceName);
44 assertEquals(data.getPartnerName(), partnerName);
48 public void allPropertiesEmptyWhenUnpopulated() {
49 ContextData data = ContextData.builder().build();
50 assertNull(data.getRequestId());
51 assertNull(data.getServiceName());
52 assertNull(data.getPartnerName());