ServiceContext { public static ServiceContext create() { return create(DEFAULT_APP_NAME, DEFAULT_API_NAME); } private  ServiceContext(String appHostname, String defaultApiName); static ServiceContext create(); static ServiceContext create(String applicationId, String apiName); static ServiceContext createFromHostname(String hostname, String apiName); String getDefaultApiName(); String getAppHostname(); String getTransferProtocol(); static final String DEFAULT_API_NAME; static final String DEFAULT_APP_NAME; }
@Test public void testInvalidDomain() { try { ServiceContext c = ServiceContext.create("123.com:abc", "xyz"); fail("invalid domain should have failed"); } catch (IllegalArgumentException e) { } }