SessionCreateHandler extends SessionHandler { static ApplicationId getFromApplicationId(HttpRequest request) { String from = request.getProperty("from"); if (from == null || "".equals(from)) { throw new BadRequestException("Parameter 'from' has illegal value '" + from + "'"); } return getAndValidateFromParameter(URI.create(from)); } @Inject  SessionCreateHandler(Context ctx,
                                ApplicationRepository applicationRepository,
                                ConfigserverConfig configserverConfig);   }
@Test public void require_that_application_urls_can_be_given_as_from_parameter() throws Exception { ApplicationId applicationId = ApplicationId.from(tenant.value(), "foo", "quux"); HttpRequest request = post(Collections.singletonMap( "from", "http: assertEquals(applicationId, SessionCreateHandler.getFromApplicationId(request)); }