### Question:
BasicAuthority implements Authority { public String getAuthority() { return Joiner.on(':').join( Objects.firstNonNull(host, getServerHostname()), Objects.firstNonNull(port, getServerPort())); } @Inject  BasicAuthority(@Nullable @Named("shindig.host") String defaultHost,
      @Nullable @Named("shindig.port") String defaultPort); String getAuthority(); String getScheme(); String getOrigin(); final static String JETTY_HOST; final static String JETTY_PORT; }### Answer:
@Test public void testBasicAuthorityWorks() { String host = "myhost"; String port = "9080"; BasicAuthority authority = new BasicAuthority(host,port); assertEquals( "myhost:9080", authority.getAuthority()); }
@Test public void testDefaultHostAndPort() { String host = ""; String port = ""; BasicAuthority authority = new BasicAuthority(host,port); assertEquals("localhost:8080", authority.getAuthority()); }
@Test public void testJettyHostAndPort() { String host = ""; String port = ""; System.setProperty("jetty.host", "localhost"); System.setProperty("jetty.port", "9003"); BasicAuthority authority = new BasicAuthority(host,port); assertEquals("localhost:9003", authority.getAuthority() ); System.clearProperty("jetty.host"); System.clearProperty("jetty.port"); }