Merge "Exclude unneccessary artifact - jackson-databind"
[logging-analytics.git] / reference / logging-filter / logging-filter-base / src / test / java / org / onap / logging / filter / base / PropertyUtilTest.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * ONAP - Logging
4  * ================================================================================
5  * Copyright (C) 2019 AT&T 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.logging.filter.base;
22
23 import static org.junit.Assert.assertEquals;
24 import org.junit.After;
25 import org.junit.Test;
26 import org.onap.logging.filter.base.PropertyUtil;
27
28 public class PropertyUtilTest {
29
30     private PropertyUtil propertyUtil = new PropertyUtil();
31
32     @After
33     public void tearDown() {
34         System.clearProperty("partnerName");
35     }
36
37     @Test
38     public void getPropertyTest() {
39         System.setProperty("partnerName", "partnerName");
40
41         String partnerName = propertyUtil.getProperty("partnerName");
42         assertEquals("partnerName", partnerName);
43     }
44
45     @Test
46     public void getPropertyNullTest() {
47         String partnerName = propertyUtil.getProperty("partner");
48         assertEquals("UNKNOWN", partnerName);
49     }
50 }