Java 类io.dropwizard.client.JerseyClientBuilder 实例源码

项目:BloopServer    文件:BloopServerApplication.java   
@Override
public void run(final BloopServerConfiguration configuration,
                final Environment environment) {
    final DBIFactory factory = new DBIFactory();
    final DBI jdbi = factory.build(environment, configuration.getDataSourceFactory(), "postgresql");
    final FlagDAO flagDAO = jdbi.onDemand(FlagDAO.class);
    final NearbyFlagDAO nearbyFlagDAO = jdbi.onDemand(NearbyFlagDAO.class);
    final PlayerDAO playerDAO = jdbi.onDemand(PlayerDAO.class);

    final Client client = new JerseyClientBuilder(environment).using(configuration.getJerseyClientConfiguration())
            .build(getName());
    final String firebaseKey = configuration.getFirebaseKey();

    environment.jersey().register(new FlagResource(flagDAO, nearbyFlagDAO, playerDAO, client, firebaseKey));
    environment.jersey().register(new PlayerResource(playerDAO, flagDAO));
}
项目:dropwizard-auth-example    文件:IntegrationTest.java   
protected Client getNewSecureClient(String keyStoreResourcePath) throws Exception {
    TlsConfiguration tlsConfiguration = new TlsConfiguration();
    tlsConfiguration.setKeyStorePath(new File(resourceFilePath(keyStoreResourcePath)));
    tlsConfiguration.setKeyStorePassword("notsecret");

    tlsConfiguration.setTrustStorePath(new File(resourceFilePath("tls/test-truststore.jks")));
    tlsConfiguration.setTrustStorePassword("notsecret");

    tlsConfiguration.setVerifyHostname(false);

    tlsConfiguration.setSupportedCiphers(Lists.newArrayList("TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384"));
    tlsConfiguration.setSupportedProtocols(Lists.newArrayList("TLSv1.2"));

    JerseyClientConfiguration configuration = new JerseyClientConfiguration();
    configuration.setTlsConfiguration(tlsConfiguration);
    configuration.setTimeout(Duration.seconds(30));
    configuration.setConnectionTimeout(Duration.seconds(30));
    configuration.setConnectionRequestTimeout(Duration.seconds(30));

    return new JerseyClientBuilder(USER_INFO_APP_RULE.getEnvironment())
            .using(configuration)
            .build(UUID.randomUUID().toString());
}
项目:verify-service-provider    文件:AuthnRequestAcceptanceTest.java   
@Test
public void shouldReturn400WhenPassedNoEntityIdForMultiTenantApplication() throws Exception {
    multiTenantApplication.before();
    Client client = new JerseyClientBuilder(multiTenantApplication.getEnvironment()).build("Test Client");

    setupComplianceToolWithEntityId(client, MULTI_ENTITY_ID_1);

    Response authnResponse = client
        .target(URI.create(String.format("http://localhost:%d/generate-request", multiTenantApplication.getLocalPort())))
        .request()
        .buildPost(Entity.json(new RequestGenerationBody(LevelOfAssurance.LEVEL_2, null)))
        .invoke();

    assertThat(authnResponse.getStatus()).isEqualTo(BAD_REQUEST.getStatusCode());

    multiTenantApplication.after();
}
项目:verify-service-provider    文件:AuthnRequestAcceptanceTest.java   
@Test
public void shouldReturn400WhenPassedInvalidEntityIdForMultiTenantApplication() throws Exception {
    multiTenantApplication.before();
    Client client = new JerseyClientBuilder(multiTenantApplication.getEnvironment()).build("Test Client");

    setupComplianceToolWithEntityId(client, MULTI_ENTITY_ID_1);

    Response authnResponse = client
        .target(URI.create(String.format("http://localhost:%d/generate-request", multiTenantApplication.getLocalPort())))
        .request()
        .buildPost(Entity.json(new RequestGenerationBody(LevelOfAssurance.LEVEL_2, "not a valid entityID")))
        .invoke();

    assertThat(authnResponse.getStatus()).isEqualTo(BAD_REQUEST.getStatusCode());

    multiTenantApplication.after();
}
项目:verify-service-provider    文件:MsaMetadataFeatureTest.java   
@Test
public void shouldFailHealthcheckWhenMsaMetadataUnavailable() {
    wireMockServer.stubFor(
        get(urlEqualTo("/matching-service/metadata"))
            .willReturn(aResponse()
                .withStatus(500)
            )
    );

    applicationTestSupport.before();
    Client client = new JerseyClientBuilder(applicationTestSupport.getEnvironment()).build("test client");

    Response response = client
        .target(URI.create(String.format(HEALTHCHECK_URL, applicationTestSupport.getLocalPort())))
        .request()
        .buildGet()
        .invoke();

    String expectedResult = "\"msaMetadata\":{\"healthy\":false";

    wireMockServer.verify(getRequestedFor(urlEqualTo("/matching-service/metadata")));

    assertThat(response.getStatus()).isEqualTo(INTERNAL_SERVER_ERROR.getStatusCode());
    assertThat(response.readEntity(String.class)).contains(expectedResult);
}
项目:verify-service-provider    文件:MsaMetadataFeatureTest.java   
@Test
public void shouldPassHealthcheckWhenMsaMetadataAvailable() {
    wireMockServer.stubFor(
        get(urlEqualTo("/matching-service/metadata"))
            .willReturn(aResponse()
                .withStatus(200)
                .withBody(MockMsaServer.msaMetadata())
            )
    );

    applicationTestSupport.before();
    Client client = new JerseyClientBuilder(applicationTestSupport.getEnvironment()).build("test client");

    Response response = client
        .target(URI.create(String.format(HEALTHCHECK_URL, applicationTestSupport.getLocalPort())))
        .request()
        .buildGet()
        .invoke();

    String expectedResult = "\"msaMetadata\":{\"healthy\":true";

    wireMockServer.verify(getRequestedFor(urlEqualTo("/matching-service/metadata")));

    assertThat(response.getStatus()).isEqualTo(OK.getStatusCode());
    assertThat(response.readEntity(String.class)).contains(expectedResult);
}
项目:verify-service-provider    文件:HubMetadataFeatureTest.java   
@Test
public void shouldFailHealthcheckWhenHubMetadataUnavailable() {
    wireMockServer.stubFor(
        get(urlEqualTo("/SAML2/metadata"))
            .willReturn(aResponse()
                .withStatus(500)
            )
    );

    applicationTestSupport.before();
    Client client = new JerseyClientBuilder(applicationTestSupport.getEnvironment()).build("test client");

    Response response = client
        .target(URI.create(String.format(HEALTHCHECK_URL, applicationTestSupport.getLocalPort())))
        .request()
        .buildGet()
        .invoke();

    String expectedResult = "\"hubMetadata\":{\"healthy\":false";

    wireMockServer.verify(getRequestedFor(urlEqualTo("/SAML2/metadata")));

    assertThat(response.getStatus()).isEqualTo(INTERNAL_SERVER_ERROR.getStatusCode());
    assertThat(response.readEntity(String.class)).contains(expectedResult);
}
项目:dropwizard-zipkin    文件:HelloWorldApplication.java   
@Override
public void run(HelloWorldConfiguration configuration,
        Environment environment) throws Exception {

    final Optional<HttpTracing> tracing = configuration.getZipkinFactory()
            .build(environment);

    final Client client;
    if (tracing.isPresent()) {
        client = new ZipkinClientBuilder(environment, tracing.get())
                .build(configuration.getZipkinClient());
    } else {
        final ZipkinClientConfiguration clientConfig = configuration
                .getZipkinClient();
        client = new JerseyClientBuilder(environment).using(clientConfig)
                .build(clientConfig.getServiceName());
    }

    // Register resources
    final HelloWorldResource resource = new HelloWorldResource(client);
    environment.jersey().register(resource);
}
项目:geocoder-converter    文件:ConverterResourceTest.java   
@Test
public void testHandleForward() {
    Client client = new JerseyClientBuilder(RULE.getEnvironment()).build("test forward client");

    client.property(ClientProperties.CONNECT_TIMEOUT, 100000);
    client.property(ClientProperties.READ_TIMEOUT, 100000);

    Response response = client.target(
            String.format("http://localhost:%d/nominatim?q=berlin", RULE.getLocalPort()))
            .request()
            .get();

    assertThat(response.getStatus()).isEqualTo(200);
    GHResponse entry = response.readEntity(GHResponse.class);
    assertTrue(entry.getLocale().equals("en"));
}
项目:geocoder-converter    文件:ConverterResourceTest.java   
@Test
public void testCorrectLocale() {
    Client client = new JerseyClientBuilder(RULE.getEnvironment()).build("testCorrectLocale");

    client.property(ClientProperties.CONNECT_TIMEOUT, 100000);
    client.property(ClientProperties.READ_TIMEOUT, 100000);

    Response response = client.target(
            String.format("http://localhost:%d/nominatim?q=berlin&locale=de", RULE.getLocalPort()))
            .request()
            .get();

    assertThat(response.getStatus()).isEqualTo(200);
    GHResponse entry = response.readEntity(GHResponse.class);
    assertTrue(entry.getLocale().equals("de"));
}
项目:geocoder-converter    文件:ConverterResourceTest.java   
@Test
public void testCorrectLocaleCountry() {
    Client client = new JerseyClientBuilder(RULE.getEnvironment()).build("testCorrectLocaleCountry");

    client.property(ClientProperties.CONNECT_TIMEOUT, 100000);
    client.property(ClientProperties.READ_TIMEOUT, 100000);

    Response response = client.target(
            String.format("http://localhost:%d/nominatim?q=berlin&locale=de-ch", RULE.getLocalPort()))
            .request()
            .get();

    assertThat(response.getStatus()).isEqualTo(200);
    GHResponse entry = response.readEntity(GHResponse.class);
    assertTrue(entry.getLocale().equals("de-CH"));
}
项目:geocoder-converter    文件:ConverterResourceTest.java   
@Test
public void testIncorrectLocale() {
    Client client = new JerseyClientBuilder(RULE.getEnvironment()).build("testIncorrectLocale");

    client.property(ClientProperties.CONNECT_TIMEOUT, 100000);
    client.property(ClientProperties.READ_TIMEOUT, 100000);

    Response response = client.target(
            String.format("http://localhost:%d/nominatim?q=berlin&locale=IAmNotValid", RULE.getLocalPort()))
            .request()
            .get();

    assertThat(response.getStatus()).isEqualTo(200);
    GHResponse entry = response.readEntity(GHResponse.class);
    assertTrue(entry.getLocale().equals("en"));
}
项目:geocoder-converter    文件:ConverterResourceTest.java   
@Test
public void testIncorrectLocaleCountry() {
    Client client = new JerseyClientBuilder(RULE.getEnvironment()).build("testIncorrectLocaleCountry");

    client.property(ClientProperties.CONNECT_TIMEOUT, 100000);
    client.property(ClientProperties.READ_TIMEOUT, 100000);

    Response response = client.target(
            String.format("http://localhost:%d/nominatim?q=berlin&locale=de-zz", RULE.getLocalPort()))
            .request()
            .get();

    assertThat(response.getStatus()).isEqualTo(200);
    GHResponse entry = response.readEntity(GHResponse.class);
    assertTrue(entry.getLocale().equals("en"));
}
项目:harahachibu    文件:HaraHachiBuApplication.java   
@Override
public void run(HaraHachiBuConfiguration config, Environment environment) throws Exception {
    // Set up the Jersey client - required for HTTP client interactions
    final Client client = new JerseyClientBuilder(environment)
            .using(config.getJerseyClient())
            .build(getName());
    // Build the disk space checker instance -
    // this may add new resources and healthchecks to the environment.
    final DiskSpaceChecker checker = new DiskSpaceCheckerBuilder(environment, client, config.getDiskSpace()).build();

    // Set up the disk space filter
    environment.servlets()
            .addFilter("diskSpaceFilter", new DiskSpaceFilter(checker, config.getProxy(), "/setSpace"))
            .addMappingForUrlPatterns(EnumSet.of(DispatcherType.REQUEST), true, "/*");

    // Set up the proxy servlet - requires some additional configuration
    ServletRegistration.Dynamic diskSpaceProxyServlet = environment.servlets().addServlet("diskSpaceProxyServlet", new DiskSpaceProxyServlet());
    diskSpaceProxyServlet.setInitParameter(DiskSpaceProxyServlet.DESTINATION_SERVER_PARAM, config.getProxy().getDestinationServer());
    diskSpaceProxyServlet.addMapping(DiskSpaceProxyServlet.PROXY_PATH_PREFIX + "/*");

    // Add healthcheck
    environment.healthChecks().register("Generic disk space checker", new DiskSpaceCheckerHealthCheck(checker));
}
项目:sample-dropwizard-service    文件:BaseClient.java   
public BaseClient(Environment environment, ClientConfiguration clientConfiguration,
                        JerseyClientConfiguration jerseyClientConfiguration, String clientName) {
    httpClient = new JerseyClientBuilder(environment)
            .using(jerseyClientConfiguration)
            .build(clientName);

    StringBuilder targetBuilder = new StringBuilder();

    String target = targetBuilder.append(clientConfiguration.host)
            .append(':')
            .append(clientConfiguration.port)
            .append('/')
            .append(clientConfiguration.serviceContext).toString();

    webTarget = httpClient.target(target);
}
项目:hesperides    文件:HesperidesClient.java   
public HesperidesClient(final String url) {

        // Add last '/'
        if (!url.endsWith("/")) {
            this.url = url.concat("/rest/");
        } else {
            this.url = url.concat("rest/");
        }

        this.httpClient = new JerseyClientBuilder(RULE.getEnvironment()).build("test client");

        this.templatePackage = new TemplatePackage();
        this.module = new Module();
        this.application = new Application();
        this.credential = null;
    }
项目:watchtower-workflow    文件:CamundaProviderInstantiateWorkflowRunnable.java   
@Override
public void run() {
  CamundaProviderConfiguration camundaProviderConfiguration =
      (CamundaProviderConfiguration) providerConfiguration;

  JerseyClientConfiguration jerseyClientConfiguration =
      camundaProviderConfiguration.getJerseyClientConfiguration();

  jerseyClientConfiguration.setGzipEnabledForRequests(false);

  Client client =
      new JerseyClientBuilder(environment).using(
          camundaProviderConfiguration.getJerseyClientConfiguration()).build(
          "CamundaWorker" + threadNumber);

  WebTarget target = client.target(camundaProviderConfiguration.getEndpoint());

  Response response =
      target.request(MediaType.APPLICATION_JSON_TYPE).accept(MediaType.APPLICATION_JSON_TYPE)
          .post(Entity.entity(EventUtils.toJson(event), MediaType.APPLICATION_JSON));

  if (response.getStatus() != 200)
    logger.error("Failed to send event to Camunda with HTTP error code: " + response.getStatus());
  else
    logger.info("Incident: {}", response.readEntity(String.class));
}
项目:SPQR    文件:SPQRNodeManagerTest.java   
/**
 * Test case for {@link SPQRNodeManager#registerNode(String, String, int, int)} being provided valid input
 */
@Test
public void testRegisterNode_withValidInput() {

    Client mockClient = Mockito.mock(Client.class);

    JerseyClientBuilder mockClientBuilder = Mockito.mock(JerseyClientBuilder.class);
    Mockito.when(mockClientBuilder.build(Mockito.anyString())).thenReturn(mockClient);

    SPQRNodeManager manager = new SPQRNodeManager(5, mockClientBuilder);
    NodeRegistrationResponse response = manager.registerNode("http", "localhost", 8080, 9090);
    Assert.assertEquals("Node must be registered by now", NodeRegistrationState.OK, response.getState());
    Assert.assertTrue("Node must be registered by now", manager.hasNode(response.getId()));

    Mockito.verify(mockClientBuilder).build(Mockito.anyString());
}
项目:SPQR    文件:SPQRNodeManagerTest.java   
/**
 * Test case for {@link SPQRNodeManager#deregisterNode(String)} being provided the id of an already
 * registered node
 */
@Test
public void testDeRegisterNode_withExistingNodeId() {

    Client mockClient = Mockito.mock(Client.class);

    JerseyClientBuilder mockClientBuilder = Mockito.mock(JerseyClientBuilder.class);
    Mockito.when(mockClientBuilder.build(Mockito.anyString())).thenReturn(mockClient);

    SPQRNodeManager manager = new SPQRNodeManager(5, mockClientBuilder);
    NodeRegistrationResponse response = manager.registerNode("http", "localhost", 8080, 9090);
    Assert.assertEquals("Node must be registered by now", NodeRegistrationState.OK, response.getState());
    Assert.assertTrue("Node must be registered by now", manager.hasNode(response.getId()));

    NodeDeRegistrationResponse deRegistrationResponse = manager.deregisterNode(response.getId());
    Assert.assertEquals("De-Registration should be succesful", NodeDeRegistrationState.OK, deRegistrationResponse.getState());
    Assert.assertEquals("Ids must be equal", response.getId(), deRegistrationResponse.getId());

    deRegistrationResponse = manager.deregisterNode(response.getId());
    Assert.assertEquals("Node already de-registered", NodeDeRegistrationState.NO_SUCH_NODE_ID, deRegistrationResponse.getState());
    Assert.assertFalse("Node is not registered anymore", manager.hasNode(response.getId()));

    Mockito.verify(mockClientBuilder).build(Mockito.anyString());
}
项目:CredentialStorageService    文件:CredentialStorageApplicationTest.java   
@Before
public void createClient() {
    final JerseyClientConfiguration configuration = new JerseyClientConfiguration();
    configuration.setTimeout(Duration.minutes(1L));
    configuration.setConnectionTimeout(Duration.minutes(1L));
    configuration.setConnectionRequestTimeout(Duration.minutes(1L));
    this.client = new JerseyClientBuilder(this.RULE.getEnvironment()).using(configuration)
            .build("test client");

    assertThat(this.client
            .target(String.format(CREDENTIAL_END_POINT, this.RULE.getLocalPort()))
            .request()
            .header(X_AUTH_RSA_HEADER, BASE_64_PUBLIC_KEY)
            .post(Entity.json(this.credential)).getStatus())
                    .isEqualTo(Status.CREATED.getStatusCode());
}
项目:rsc    文件:RSClient.java   
@Override
public void run(final RSClientConfiguration configuration, final Environment environment) throws Exception {
    final URI proxy = URI.create("http://localhost:8090"); // TODO
    System.getProperties().put("http.proxyHost", proxy.getHost());
    System.getProperties().put("http.proxyPort", String.valueOf(proxy.getPort()));

    final Client proxyClient = new JerseyClientBuilder(environment).using(configuration.getProxyConfiguration()).build("proxy");
    final ResourceStore resourceStore = new ResourceStore(proxyClient, configuration.getProxyConfiguration());

    environment.jersey().register(new ProxyResource(resourceStore));

    environment.jersey().register(new ClientHandlerExceptionMapper());
    environment.jersey().register(new UniformInterfaceExceptionMapper());

    final GameClient client = new GameClient(
            configuration.getProxyConfiguration().getRemoteHost().toURL(),
            configuration.getServerHost(),
            configuration.getPublicKey(),
            CLIENT_TITLE
    );
    environment.lifecycle().addLifeCycleListener(new GameClientLifeCycleManager(client));
}
项目:rsc    文件:Server.java   
@Override
    public void run(ServerConfiguration configuration, Environment environment) throws Exception {
        environment.jersey().disable();

        // Create dataserver client
        final JerseyClientBuilder jerseyClientBuilder = new JerseyClientBuilder(environment).using(configuration.getDataserverClientConfig());
        final DataserverClient dataserverClient = new DataserverClient(jerseyClientBuilder.build("dataserver"), configuration.getDataserverClientConfig());

        // Create session manager
        final SessionManager sessionManager = new SessionManager(dataserverClient);
        environment.lifecycle().manage(sessionManager);

        // Create blind acceptor
        final ClientAcceptor acceptor = new ClientAcceptor(environment.metrics(), configuration.getPort());
        environment.lifecycle().manage(acceptor);

        // TODO: This should really be handled in some kind of configuration?
        acceptor.addPacketHandler(67, new PingHandler());
        acceptor.addPacketHandler(0, new LoginHandler(sessionManager, environment.metrics(), (RSAPrivateKey) configuration.getKeyPair().getPrivate()));
        acceptor.addPacketHandler(29, new LogoutHandler());

        // TODO: Register outgoing message types, these should also be in some config
//        acceptor.addPacketType(131, SystemMessagePacket.class); // TODO: I don't think these IDs are correct
//        acceptor.addPacketType(93, ShowBankScreenPacket.class);
//        acceptor.addPacketType(0, SetPositionPacket.class);
    }
项目:tenacity    文件:TenacityAuthenticatorTest.java   
@Test
public void shouldNotTransformAuthenticationExceptionIntoMappedException() throws AuthenticationException {
    when(AuthenticatorApp.getMockAuthenticator().authenticate(any(BasicCredentials.class))).thenThrow(new AuthenticationException("test"));
    final Client client = new JerseyClientBuilder(new MetricRegistry())
            .using(executorService, Jackson.newObjectMapper())
            .build("dropwizard-app-rule");

    client.register(HttpAuthenticationFeature.basicBuilder()
            .nonPreemptive()
            .credentials("user", "stuff")
            .build());

    final Response response = client
            .target(URI.create("http://localhost:" + RULE.getLocalPort() + "/auth"))
            .request()
            .get(Response.class);

    assertThat(response.getStatus()).isEqualTo(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode());

    verify(AuthenticatorApp.getMockAuthenticator(), times(1)).authenticate(any(BasicCredentials.class));
    verifyZeroInteractions(AuthenticatorApp.getTenacityContainerExceptionMapper());
    verify(AuthenticatorApp.getTenacityExceptionMapper(), times(1)).toResponse(any(HystrixRuntimeException.class));
}
项目:ethmmyrss    文件:ThmmyRssApplication.java   
@Override
public void run(ThmmyRssConfiguration configuration, Environment env)
        throws Exception {
    client = new JerseyClientBuilder(env).using(configuration.getJerseyClientConfiguration()).using(env)
            .withProperty("PROPERTY_CHUNKED_ENCODING_SIZE", 0).build("jersey-client");
    DBIFactory factory = new DBIFactory();
    DBI jdbi = factory.build(env, configuration.getDatabase(), "announcement-db");
    announcementDAO = jdbi.onDemand(AnnouncementDAO.class);

    tryCreateAnnouncementTable();
    AnnouncementFetcher announcementFetcher = new AnnouncementFetcher(client, configuration);
    env.healthChecks().register("announcement-fetcher-health", new AnnouncementFetcherHealthCheck(configuration, announcementFetcher));
    this.announcementService = new AnnouncementServiceImpl(announcementDAO, announcementFetcher, configuration);
    env.jersey().register(new FeedResource(announcementService, configuration));
    env.jersey().register(new IndexResource(configuration));
}
项目:event-sourcing-cqrs-examples    文件:ResourcesClient.java   
public ResourcesClient(Environment environment, int port) {
    this.client = new JerseyClientBuilder(checkNotNull(environment))
            .build(ResourcesClient.class.getName())
            .property(CONNECT_TIMEOUT, 2000)
            .property(READ_TIMEOUT, 3000)
            .register(new LoggingFeature(getLogger(DEFAULT_LOGGER_NAME), INFO, PAYLOAD_ANY, 1024));
    this.resourcesUrls = new ResourcesUrls(port);
}
项目:verify-hub    文件:HubMetadataIntegrationTests.java   
@BeforeClass
public static void setUp() throws Exception {
    JerseyClientConfiguration jerseyClientConfiguration = new JerseyClientConfiguration();
    jerseyClientConfiguration.setConnectionTimeout(Duration.seconds(10));
    jerseyClientConfiguration.setTimeout(Duration.seconds(10));
    client = new JerseyClientBuilder(samlProxyAppRule.getEnvironment())
            .using(jerseyClientConfiguration)
            .build(HubMetadataIntegrationTests.class.getName());
    DateTimeFreezer.freezeTime();
}
项目:verify-hub    文件:SamlMessageReceiverApiResourceTest.java   
@BeforeClass
public static void setUpClient() throws Exception {
    JerseyClientConfiguration jerseyClientConfiguration = JerseyClientConfigurationBuilder.aJerseyClientConfiguration().withTimeout(Duration.seconds(10)).build();
    client =  new JerseyClientBuilder(samlProxyAppRule.getEnvironment()).using(jerseyClientConfiguration).build
            (SamlMessageReceiverApiResourceTest.class.getSimpleName());
    eventSinkStubRule.register(Urls.HubSupportUrls.HUB_SUPPORT_EVENT_SINK_RESOURCE, Response.Status.OK.getStatusCode());
}
项目:verify-hub    文件:SamlMessageReceiverApiResourceEidasEnabledTest.java   
@BeforeClass
public static void setUpClient() throws Exception {
    JerseyClientConfiguration jerseyClientConfiguration = JerseyClientConfigurationBuilder.aJerseyClientConfiguration().withTimeout(Duration.seconds(10)).build();
    client =  new JerseyClientBuilder(samlProxyAppRule.getEnvironment()).using(jerseyClientConfiguration).build
            (SamlMessageReceiverApiResourceEidasEnabledTest.class.getSimpleName());
    eventSinkStubRule.register(Urls.HubSupportUrls.HUB_SUPPORT_EVENT_SINK_RESOURCE, Response.Status.OK.getStatusCode());
}
项目:verify-hub    文件:SamlMessageReceiverApiResourceEidasDisabledTest.java   
@BeforeClass
public static void setUpClient() throws Exception {
    JerseyClientConfiguration jerseyClientConfiguration = JerseyClientConfigurationBuilder.aJerseyClientConfiguration().withTimeout(Duration.seconds(10)).build();
    client =  new JerseyClientBuilder(samlProxyAppRule.getEnvironment()).using(jerseyClientConfiguration).build
            (SamlMessageReceiverApiResourceEidasDisabledTest.class.getSimpleName());
    eventSinkStubRule.register(Urls.HubSupportUrls.HUB_SUPPORT_EVENT_SINK_RESOURCE, Response.Status.OK.getStatusCode());
}
项目:verify-hub    文件:EidasSessionResourceContractTest.java   
@BeforeClass
public static void beforeClass() throws Exception {
    IdaSamlBootstrap.bootstrap();
    JerseyClientConfiguration jerseyClientConfiguration = JerseyClientConfigurationBuilder.aJerseyClientConfiguration().withTimeout(Duration.seconds(10)).build();
    client = new JerseyClientBuilder(policy.getEnvironment())
        .using(jerseyClientConfiguration)
        .build(EidasSessionResourceContractTest.class.getSimpleName());
    sessionId = SessionId.createNewSessionId();
    samlAuthnResponseContainerDto = createAuthnResponseSignedByKeyPair(sessionId, TestCertificateStrings.STUB_IDP_PUBLIC_PRIMARY_CERT, TestCertificateStrings.STUB_IDP_PUBLIC_PRIMARY_PRIVATE_KEY);
    encryptedIdentityAssertion = AssertionBuilder.anAssertion().withId(UUID.randomUUID().toString()).build();
    encryptedIdentityAssertionString = XML_OBJECT_XML_OBJECT_TO_BASE_64_ENCODED_STRING_TRANSFORMER.apply(encryptedIdentityAssertion);
}
项目:verify-hub    文件:EidasSessionResourceIntegrationTest.java   
@BeforeClass
public static void beforeClass() {
    JerseyClientConfiguration jerseyClientConfiguration = JerseyClientConfigurationBuilder.aJerseyClientConfiguration().withTimeout(Duration.seconds(10)).build();
    client = new JerseyClientBuilder(policy.getEnvironment())
            .using(jerseyClientConfiguration)
            .build(EidasSessionResourceIntegrationTest.class.getSimpleName());
}
项目:verify-hub    文件:EidasDisabledIntegrationTest.java   
@BeforeClass
public static void beforeClass() {
    JerseyClientConfiguration
        jerseyClientConfiguration =
        JerseyClientConfigurationBuilder.aJerseyClientConfiguration().withTimeout(Duration.seconds(10)).build();
    client =
        new JerseyClientBuilder(policy.getEnvironment()).using(jerseyClientConfiguration).build(EidasDisabledIntegrationTest.class.getSimpleName());
}
项目:verify-hub    文件:EidasMatchingServiceResourceIntegrationTest.java   
@BeforeClass
public static void beforeClass() {
    JerseyClientConfiguration jerseyClientConfiguration = JerseyClientConfigurationBuilder.aJerseyClientConfiguration().withTimeout(Duration.seconds(10)).build();
    client = new JerseyClientBuilder(policy.getEnvironment())
        .using(jerseyClientConfiguration)
        .build(EidasMatchingServiceResourceIntegrationTest.class.getSimpleName());
}
项目:verify-hub    文件:MatchingServiceHealthcheckResponseTranslatorResourceTest.java   
@BeforeClass
public static void setup() throws Exception {
    JerseyClientConfiguration jerseyClientConfiguration = JerseyClientConfigurationBuilder
            .aJerseyClientConfiguration().withTimeout(Duration.seconds(10)).build();
    client = new JerseyClientBuilder(samlEngineAppRule.getEnvironment()).using(jerseyClientConfiguration)
            .build(MatchingServiceHealthcheckResponseTranslatorResourceTest.class.getSimpleName());
}
项目:verify-hub    文件:CountryMatchingServiceRequestGeneratorResourceTest.java   
@BeforeClass
public static void setupClass() throws Exception {
    JerseyClientConfiguration jerseyClientConfiguration = JerseyClientConfigurationBuilder
        .aJerseyClientConfiguration().withTimeout(Duration.seconds(10)).build();
    client = new JerseyClientBuilder(samlEngineAppRule.getEnvironment()).using(jerseyClientConfiguration)
        .build(CountryMatchingServiceRequestGeneratorResourceTest.class.getSimpleName());
}
项目:verify-hub    文件:HealthCheckWithoutCountryTest.java   
@BeforeClass
public static void setupClass() throws Exception {
    JerseyClientConfiguration jerseyClientConfiguration = JerseyClientConfigurationBuilder
        .aJerseyClientConfiguration().withTimeout(Duration.seconds(10)).build();
    client = new JerseyClientBuilder(samlEngineAppRule.getEnvironment()).using(jerseyClientConfiguration)
        .build(HealthCheckWithoutCountryTest.class.getSimpleName());
}
项目:verify-hub    文件:MatchingServiceRequestGeneratorResourceTest.java   
@BeforeClass
public static void setup() throws Exception {
    JerseyClientConfiguration jerseyClientConfiguration = JerseyClientConfigurationBuilder
            .aJerseyClientConfiguration().withTimeout(Duration.seconds(10)).build();
    client = new JerseyClientBuilder(samlEngineAppRule.getEnvironment()).using(jerseyClientConfiguration)
            .build(MatchingServiceRequestGeneratorResourceTest.class.getSimpleName());
}
项目:verify-hub    文件:MatchingServiceHealthcheckRequestGeneratorResourceTest.java   
@BeforeClass
public static void setup() throws Exception {
    JerseyClientConfiguration jerseyClientConfiguration = JerseyClientConfigurationBuilder
            .aJerseyClientConfiguration().withTimeout(Duration.seconds(10)).build();
    client = new JerseyClientBuilder(samlEngineAppRule.getEnvironment()).using(jerseyClientConfiguration)
            .build(MatchingServiceHealthcheckRequestGeneratorResourceTest.class.getSimpleName());
}
项目:verify-hub    文件:MatchingServiceRequestSenderTest.java   
@BeforeClass
public static void setUpClass() throws Exception {
    JerseyClientConfiguration jerseyClientConfiguration = JerseyClientConfigurationBuilder.aJerseyClientConfiguration().withTimeout(Duration.seconds(10)).build();
    client = new JerseyClientBuilder(samlSoapProxyAppRule.getEnvironment()).using(jerseyClientConfiguration).build(MatchingServiceRequestSenderTest.class.getSimpleName());
    eventSinkStubRule.setupStubForLogging();
    configStub.setupStubForCertificates(TEST_RP_MS);
    String soap = createMsaResponse();
    final String attibute_query_resource = "/attribute-query-request";
    RequestAndResponse requestAndResponse = ExpectedRequestBuilder.expectRequest().withPath(attibute_query_resource).andWillRespondWith().withStatus(200).withBody(soap).withContentType(MediaType.TEXT_XML_TYPE.toString()).build();
    msaStubRule.register(requestAndResponse);
}
项目:verify-hub    文件:MatchingServiceHealthCheckIntegrationTests.java   
@BeforeClass
public static void setUp() throws Exception {
    JerseyClientConfiguration jerseyClientConfiguration = JerseyClientConfigurationBuilder.aJerseyClientConfiguration()
            .withTimeout(Duration.seconds(10)).build();
    client = new JerseyClientBuilder(samlSoapProxyAppRule.getEnvironment()).using(jerseyClientConfiguration)
            .build(MatchingServiceHealthCheckIntegrationTests.class.getSimpleName());
    eventSinkStub.setupStubForLogging();
    configStub.setupStubForCertificates(msaEntityId, TEST_RP_MS_PUBLIC_SIGNING_CERT, TEST_RP_MS_PUBLIC_ENCRYPTION_CERT);
    configStub.setupStubForCertificates(msaEntityId2, TEST_RP_MS_PUBLIC_SIGNING_CERT, TEST_RP_MS_PUBLIC_ENCRYPTION_CERT);
}