@Test public void contributed_hostname() { expect(request.getServerPort()).andReturn(80).once(); expect(request.isSecure()).andReturn(false); replay(); BaseURLSource baseURLSource = new BaseURLSourceImpl(request, "my.server.com", 0, 0); assertEquals(baseURLSource.getBaseURL(false), "http: verify(); }
public String getBaseURL(boolean secure) { return String.format("%s: secure ? "https" : "http", hostname(), portExtension(secure)); }
BaseURLSourceImpl implements BaseURLSource { public String getBaseURL(boolean secure) { return String.format("%s: secure ? "https" : "http", hostname(), portExtension(secure)); } }
BaseURLSourceImpl implements BaseURLSource { public String getBaseURL(boolean secure) { return String.format("%s: secure ? "https" : "http", hostname(), portExtension(secure)); } BaseURLSourceImpl(Request request, @Inject @Symbol(SymbolConstants.HOSTNAME) String hostname,
                             @Symbol(SymbolConstants.HOSTPORT) int hostPort, @Symbol(SymbolConstants.HOSTPORT_SECURE) int secureHostPort); }
BaseURLSourceImpl implements BaseURLSource { public String getBaseURL(boolean secure) { return String.format("%s: secure ? "https" : "http", hostname(), portExtension(secure)); } BaseURLSourceImpl(Request request, @Inject @Symbol(SymbolConstants.HOSTNAME) String hostname,
                             @Symbol(SymbolConstants.HOSTPORT) int hostPort, @Symbol(SymbolConstants.HOSTPORT_SECURE) int secureHostPort); String getBaseURL(boolean secure); }
BaseURLSourceImpl implements BaseURLSource { public String getBaseURL(boolean secure) { return String.format("%s: secure ? "https" : "http", hostname(), portExtension(secure)); } BaseURLSourceImpl(Request request, @Inject @Symbol(SymbolConstants.HOSTNAME) String hostname,
                             @Symbol(SymbolConstants.HOSTPORT) int hostPort, @Symbol(SymbolConstants.HOSTPORT_SECURE) int secureHostPort); String getBaseURL(boolean secure);  }