Package org.sonatype.nexus.component.source.api.http

Examples of org.sonatype.nexus.component.source.api.http.UsernameAuthenticationConfig


{

  @Override
  public Map<String, Object> toMap(final AuthenticationConfig config) {
    checkNotNull(config, "config");
    UsernameAuthenticationConfig cfg = (UsernameAuthenticationConfig) config;
    Map<String, Object> configMap = Maps.newHashMapWithExpectedSize(2);
    configMap.put("username", cfg.getUsername());
    configMap.put("password", cfg.getPassword());
    return configMap;
  }
View Full Code Here


  }

  @Override
  public AuthenticationConfig fromMap(final Map<String, Object> configMap) {
    checkNotNull(configMap, "config map");
    return new UsernameAuthenticationConfig()
        .withUsername((String) configMap.get("username"))
        .withPassword((String) configMap.get("password"));
  }
View Full Code Here

            .withRetries(2)
            .withUrlParameters("params")
            .withUserAgentCustomisation("ua")
            .withUseTrustStore(true)
        )
        .withAuthenticationConfig(new UsernameAuthenticationConfig()
            .withUsername("foo")
            .withPassword("bar")
        )
        .withProxyConfig(new ProxyConfig()
            .withHttpProxyConfig(new HttpProxyConfig()
                .withHostname("httpHost")
                .withPort(3)
                .withAuthenticationConfig(new UsernameAuthenticationConfig()
                    .withUsername("foo1")
                    .withPassword("bar1")
                )
            )
            .withHttpsProxyConfig(new HttpProxyConfig()
View Full Code Here

    assertThat(config.getConnectionConfig().getRetries(), is(2));
    assertThat(config.getConnectionConfig().getUrlParameters(), is("params"));
    assertThat(config.getConnectionConfig().getUserAgentCustomisation(), is("ua"));
    assertThat(config.getConnectionConfig().getUseTrustStore(), is(true));

    UsernameAuthenticationConfig a1 = (UsernameAuthenticationConfig) config.getAuthenticationConfig();
    assertThat(a1.getUsername(), is("foo"));
    assertThat(a1.getPassword(), is("bar"));

    assertThat(config.getProxyConfig().getHttpProxyConfig().getHostname(), is("httpHost"));
    assertThat(config.getProxyConfig().getHttpProxyConfig().getPort(), is(3));
    UsernameAuthenticationConfig a2 = (UsernameAuthenticationConfig) config.getProxyConfig().getHttpProxyConfig()
        .getAuthenticationConfig();
    assertThat(a2.getUsername(), is("foo1"));
    assertThat(a2.getPassword(), is("bar1"));

    assertThat(config.getProxyConfig().getHttpsProxyConfig().getHostname(), is("httpsHost"));
    assertThat(config.getProxyConfig().getHttpsProxyConfig().getPort(), is(4));
    NtlmAuthenticationConfig a3 = (NtlmAuthenticationConfig) config.getProxyConfig().getHttpsProxyConfig()
        .getAuthenticationConfig();
View Full Code Here

TOP

Related Classes of org.sonatype.nexus.component.source.api.http.UsernameAuthenticationConfig

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.