2 * ============LICENSE_START=======================================================
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
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.policy.drools.utils;
23 import org.junit.Assert;
24 import org.junit.Test;
26 public class TripleTest {
30 Triple<String, String, String> triple =
31 new Triple<>("one", "two", "three");
33 Assert.assertTrue("one".equals(triple.first()));
34 Assert.assertTrue("one".equals(triple.getFirst()));
36 Assert.assertTrue("two".equals(triple.second()));
37 Assert.assertTrue("two".equals(triple.getSecond()));
39 Assert.assertTrue("three".equals(triple.third()));
40 Assert.assertTrue("three".equals(triple.getThird()));
43 Assert.assertTrue("I".equals(triple.first()));
46 Assert.assertTrue("1".equals(triple.first()));
49 Assert.assertTrue("2".equals(triple.second()));
51 triple.setSecond("II");
52 Assert.assertTrue("II".equals(triple.second()));
55 Assert.assertTrue("3".equals(triple.third()));
57 triple.setThird("III");
58 Assert.assertTrue("III".equals(triple.third()));