blob: bce584f08b856e961568ac08277ba34b14058d10 [file] [log] [blame]
Ray Milkey201f04b2017-09-25 10:13:19 -07001/*
2 * Copyright 2017-present Open Networking Foundation
3 *
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
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
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.
15 */
16
17package org.onosproject.net.behaviour;
18
19import org.junit.Test;
20
21import com.google.common.testing.EqualsTester;
22
23import static org.hamcrest.CoreMatchers.is;
24import static org.hamcrest.MatcherAssert.assertThat;
25import static org.onlab.junit.ImmutableClassChecker.assertThatClassIsImmutable;
26
27public class MirroringNameTest {
28
29 private static final String NAME1 = "name1";
30 private MirroringName name1 = MirroringName.mirroringName(NAME1);
31 private MirroringName sameAsName1 = MirroringName.mirroringName(NAME1);
32 private static final String NAME2 = "name2";
33 private MirroringName name2 = MirroringName.mirroringName(NAME2);
34
35 @Test
36 public void testImmutability() {
37 assertThatClassIsImmutable(MirroringName.class);
38 }
39
40 @Test
41 public void testConstruction() {
42 assertThat(name1.name(), is(NAME1));
43 }
44
45 @Test
46 public void testEquals() {
47 new EqualsTester()
48 .addEqualityGroup(name1, sameAsName1)
49 .addEqualityGroup(name2)
50 .testEquals();
51 }
52}