blob: 0cdbe5811aeea44549b4725176e9132a1c978bc8 [file] [log] [blame]
Brian O'Connor7cbbbb72016-04-09 02:13:23 -07001/*
2 * Copyright 2016-present Open Networking Laboratory
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 */
Madan Jampanif2f086c2016-01-13 16:15:39 -080016package org.onosproject.event;
17
18import org.junit.Test;
19
20import com.google.common.testing.EqualsTester;
21
22import static org.junit.Assert.*;
23
24/**
25 * Unit tests for {@link Change}.
26 */
27public class ChangeTest {
28
29 @Test
30 public void getters() {
31 Change<String> change = new Change<>("a", "b");
32 assertEquals("a", change.oldValue());
33 assertEquals("b", change.newValue());
34 }
35
36 @Test
37 public void equality() {
38 new EqualsTester()
39 .addEqualityGroup(new Change<>("foo", "bar"),
40 new Change<>("foo", "bar"))
41 .addEqualityGroup(new Change<>("bar", "car"))
42 .testEquals();
43 }
44}