"cdap-site.xml. Currently configured as: %s", configuration.get(Constants.Zookeeper.QUORUM))); authServer.startAndWait(); } catch (Exception e) { Throwable rootCause = Throwables.getRootCause(e);
@BeforeClass public static void setup() throws IOException, InterruptedException { initAuthTestProps(); externalHandlerServer = injector.getInstance(ExternalHandlerServer.class); externalHandlerServer.startAndWait(); externalAuthenticationServer = injector.getInstance(ExternalAuthenticationServer.class); externalAuthenticationServer.startAndWait(); // Wait *SLEEP_TIME_IN_SEC* for the complete service start Thread.sleep(1000 * SLEEP_TIME_IN_SEC); testServerPort = externalHandlerServer.getBindAddress().getPort(); authURL = String.format("http://%s:%d/token", externalAuthenticationServer.getSocketAddress().getHostName(), externalAuthenticationServer.getSocketAddress().getPort()); }
if (securityEnabled) { externalAuthenticationServer = injector.getInstance(ExternalAuthenticationServer.class); externalAuthenticationServer.startAndWait();
protected void setup() throws Exception { Assert.assertNotNull("CConfiguration needs to be set by derived classes", configuration); // Intentionally set "security.auth.server.announce.urls" to invalid // values verify that they are not used by external authentication server configuration.set(Constants.Security.AUTH_SERVER_ANNOUNCE_URLS, "invalid.urls"); Module securityModule = Modules.override(new SecurityModules().getInMemoryModules()).with( new AbstractModule() { @Override protected void configure() { bind(AuditLogHandler.class) .annotatedWith(Names.named( ExternalAuthenticationServer.NAMED_EXTERNAL_AUTH)) .toInstance(new AuditLogHandler(TEST_AUDIT_LOGGER)); } } ); Injector injector = Guice.createInjector(new IOModule(), securityModule, new ConfigModule(getConfiguration(configuration), HBaseConfiguration.create(), sConfiguration), new InMemoryDiscoveryModule()); server = injector.getInstance(ExternalAuthenticationServer.class); tokenCodec = injector.getInstance(AccessTokenCodec.class); discoveryServiceClient = injector.getInstance(DiscoveryServiceClient.class); startExternalAuthenticationServer(); server.startAndWait(); LOG.info("Auth server running on address {}", server.getSocketAddress()); TimeUnit.SECONDS.sleep(3); }
externalAuthenticationServer.startAndWait();
externalAuthenticationServer.startAndWait();