@Test
public void testBuildDTServiceName() {

  SecurityUtil.setTokenServiceUseIp(true);
  assertEquals("127.0.0.1:123",
      SecurityUtil.buildDTServiceName(URI.create("test://LocalHost"), 123)
  );
  assertEquals("127.0.0.1:123",
      SecurityUtil.buildDTServiceName(URI.create("test://LocalHost:123"), 456)
  );
  assertEquals("127.0.0.1:123",
      SecurityUtil.buildDTServiceName(URI.create("test://127.0.0.1"), 123)
  );
  assertEquals("127.0.0.1:123",
      SecurityUtil.buildDTServiceName(URI.create("test://127.0.0.1:123"), 456)
  );
}