public HttpConfiguration httpBuilder() throws Exception {
   HttpConfiguration springSecurityFilterChain = new HttpConfiguration(authenticationManager());
   springSecurityFilterChain.setSharedObject(
       UserDetailsService.class, authenticationRegistry.userDetailsService());
   applyDefaults(springSecurityFilterChain);
   configure(springSecurityFilterChain);
   return springSecurityFilterChain;
 }
コード例 #2
0
 public EndpointIdentity getEndpointIdentity() {
   if (getNetworkConfiguration().getTransportType().equals(TransportType.HTTP)) {
     return EndpointIdentityFactory.createUrlEndpointIdentity(mHttpConfiguration.getUrlEndpoint());
   } else {
     return EndpointIdentityFactory.createServiceIdentity("DeviceMetricsService");
   }
 }
コード例 #3
0
 @Test(priority = 7)
 public void getRetryDelayTest() {
   Assert.assertEquals(httpConf.getRetryDelay(), 1000);
 }
コード例 #4
0
 @Test(priority = 6)
 public void getReadTimeoutTest() {
   Assert.assertEquals(httpConf.getReadTimeout(), 0);
 }
コード例 #5
0
 public EndpointIdentity getStaticCredentialEndpointIdentity() {
   return EndpointIdentityFactory.createUrlEndpointIdentity(
       mHttpConfiguration.getStaticCredentialUrlEndpoint());
 }
コード例 #6
0
 @Test(priority = 17)
 public void setAndGetProxyPortTest() {
   httpConf.setProxyPort(8080);
   Assert.assertEquals(httpConf.getProxyPort(), 8080);
 }
コード例 #7
0
 @Test(priority = 15)
 public void setAndGetMaxRetryTest() {
   httpConf.setMaxRetry(2);
   Assert.assertEquals(httpConf.getMaxRetry(), 2);
 }
コード例 #8
0
 @Test(priority = 12)
 public void setAndGetEndPointUrlTest() {
   httpConf.setEndPointUrl("https://svcs.sandbox.paypal.com/Invoice/CreateInvoice");
   Assert.assertEquals(
       httpConf.getEndPointUrl(), "https://svcs.sandbox.paypal.com/Invoice/CreateInvoice");
 }
コード例 #9
0
 @Test(priority = 0)
 public void getConnectionTimeoutTest() {
   Assert.assertEquals(httpConf.getConnectionTimeout(), 0);
 }
コード例 #10
0
 @Test(priority = 22)
 public void setAndGetProxyPassword() {
   httpConf.setProxyPassword("proxyPassword");
   Assert.assertEquals(httpConf.getProxyPassword(), "proxyPassword");
 }
コード例 #11
0
 @Test(priority = 21)
 public void setAndGetProxyUserName() {
   httpConf.setProxyUserName("proxyUser");
   Assert.assertEquals(httpConf.getProxyUserName(), "proxyUser");
 }
コード例 #12
0
 @Test(priority = 20)
 public void setAndGetRetryDelayTest() {
   httpConf.setRetryDelay(30);
   Assert.assertEquals(httpConf.getRetryDelay(), 30);
 }
コード例 #13
0
 @Test(priority = 19)
 public void setAndGetReadTimeoutTest() {
   httpConf.setReadTimeout(10);
   Assert.assertEquals(httpConf.getReadTimeout(), 10);
 }
コード例 #14
0
 @Test(priority = 18)
 public void setAndIsProxySetTest() {
   httpConf.setProxySet(true);
   Assert.assertEquals(httpConf.isProxySet(), true);
 }
コード例 #15
0
ファイル: ConfigurationTest.java プロジェクト: vincentx/i0
  @Test
  public void should_use_default_value_for_configuration() throws IOException {
    Configuration configuration =
        read(fixture("use_default_value_for_configuration.yml"), Configuration.class);

    HttpConfiguration http = configuration.getHttp();
    assertThat(http.getPort(), is(DEFAULT_PORT));
    assertThat(http.getHost().isPresent(), is(false));
    assertThat(http.getMinThread(), is(DEFAULT_MIN_THREAD));
    assertThat(http.getMaxThread(), is(DEFAULT_MAX_THREAD));
    assertThat(http.getAcceptorThreads(), is(DEFAULT_ACCEPTOR_THREADS));
    assertThat(http.getSelectorThreads(), is(DEFAULT_SELECTOR_THREADS));
    assertThat(http.getAcceptQueueSize(), is(DEFAULT_ACCEPT_QUEUE_SIZE));
    assertThat(http.getMaxIdleTime(), is(DEFAULT_MAX_IDLE_TIME));
    assertThat(http.getIdleTimeout(), is(DEFAULT_IDLE_TIMEOUT));
    assertThat(http.getSoLingerTime().isPresent(), is(false));

    assertThat(http.getSsl(), is(Optional.<SslConfiguration>absent()));

    LoggingConfiguration logging = configuration.getLogging();
    assertThat(logging.getLevel(), is(LogLevel.INFO));
    assertThat(logging.getLoggers().isEmpty(), is(true));
    assertThat(logging.getConsole().isPresent(), is(false));
    assertThat(logging.getFile().isPresent(), is(false));
  }
コード例 #16
0
 @Test(priority = 9)
 public void isProxySetTest() {
   Assert.assertEquals(httpConf.isProxySet(), false);
 }
コード例 #17
0
 @Test(priority = 11)
 public void setAndGetConnectionTimeoutTest() {
   httpConf.setConnectionTimeout(5000);
   Assert.assertEquals(httpConf.getConnectionTimeout(), 5000);
 }
コード例 #18
0
 @Test(priority = 1)
 public void getEndPointUrlTest() {
   Assert.assertEquals(httpConf.getEndPointUrl(), null);
 }
コード例 #19
0
 @Test(priority = 14)
 public void setAndGetMaxHttpConnectionTest() {
   httpConf.setMaxHttpConnection(3);
   Assert.assertEquals(httpConf.getMaxHttpConnection(), 3);
 }
コード例 #20
0
 @Test(priority = 2)
 public void getMaxHttpConnectionTest() {
   Assert.assertEquals(httpConf.getMaxHttpConnection(), 10);
 }
コード例 #21
0
 @Test(priority = 16)
 public void setAndGetProxyHostTest() {
   httpConf.setProxyHost(null);
   Assert.assertEquals(httpConf.getProxyHost(), null);
 }
コード例 #22
0
 @Test(priority = 3)
 public void getMaxRetryTest() {
   Assert.assertEquals(httpConf.getMaxRetry(), 2);
 }
コード例 #23
0
 @Test(priority = 4)
 public void getProxyHostTest() {
   Assert.assertEquals(httpConf.getProxyHost(), null);
 }
コード例 #24
0
 @Test(priority = 5)
 public void getProxyPortTest() {
   Assert.assertEquals(httpConf.getProxyPort(), -1);
 }
コード例 #25
0
 public String getUrl() {
   return http != null ? http.getUrl() : url;
 }
 protected void applyDefaults(HttpConfiguration http) throws Exception {
   http.applyDefaultConfigurators();
   authorizeUrls(http.authorizeUrls());
 }