blob: 2191b2750bfa5c6ad90c754598e045cbef45cfa4 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.messagebus.network;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
/**
* @author <a href="mailto:simon@yahoo-inc.com">Simon Thoresen Hult</a>
*/
public class IdentityTestCase {
@Test
public void requireThatAccessorsWork() {
Identity id = new Identity("foo");
assertNotNull(id.getHostname());
assertEquals("foo", id.getServicePrefix());
}
@Test
public void requireThatCopyConstructorWorks() {
Identity lhs = new Identity("foo");
Identity rhs = new Identity(lhs);
assertEquals(lhs.getHostname(), rhs.getHostname());
assertEquals(lhs.getServicePrefix(), rhs.getServicePrefix());
}
}
|