feature-eelf: eelf-core from: 1.0.0 -> 2.0.0-oss
[policy/drools-pdp.git] / policy-utils / src / test / java / org / onap / policy / drools / utils / TripleTest.java
1 /*
2  * ============LICENSE_START=======================================================
3  * ONAP
4  * ================================================================================
5  * Copyright (C) 2018 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.policy.drools.utils;
22
23 import org.junit.Assert;
24 import org.junit.Test;
25
26 public class TripleTest {
27
28     @Test
29     public void test() {
30         Triple<String, String, String> triple  =
31                 new Triple<>("one", "two", "three");
32
33         Assert.assertTrue("one".equals(triple.first()));
34         Assert.assertTrue("one".equals(triple.getFirst()));
35
36         Assert.assertTrue("two".equals(triple.second()));
37         Assert.assertTrue("two".equals(triple.getSecond()));
38
39         Assert.assertTrue("three".equals(triple.third()));
40         Assert.assertTrue("three".equals(triple.getThird()));
41
42         triple.first("I");
43         Assert.assertTrue("I".equals(triple.first()));
44
45         triple.setFirst("1");
46         Assert.assertTrue("1".equals(triple.first()));
47
48         triple.second("2");
49         Assert.assertTrue("2".equals(triple.second()));
50
51         triple.setSecond("II");
52         Assert.assertTrue("II".equals(triple.second()));
53
54         triple.third("3");
55         Assert.assertTrue("3".equals(triple.third()));
56
57         triple.setThird("III");
58         Assert.assertTrue("III".equals(triple.third()));
59     }
60 }