Package com.sonatype.nexus.ssl.plugin

Examples of com.sonatype.nexus.ssl.plugin.TrustStore


      throws Exception
  {
    final Repository repository = mock(Repository.class);
    when(repository.getId()).thenReturn("foo");

    final TrustStore trustStore = mock(TrustStore.class);
    when(trustStore.getSSLContextFor(repositoryTrustStoreKey("foo"))).thenReturn(SSLContext.getDefault());

    final HttpContext httpContext = mock(HttpContext.class);
    when(httpContext.getAttribute(HttpClientFactory.HTTP_CTX_KEY_REPOSITORY)).thenReturn(repository);

    final RepositoryClientConnectionOperatorSelector underTest = new RepositoryClientConnectionOperatorSelector(
View Full Code Here


      throws Exception
  {
    final Repository repository = mock(Repository.class);
    when(repository.getId()).thenReturn("foo");

    final TrustStore trustStore = mock(TrustStore.class);
    when(trustStore.getSSLContextFor(repositoryTrustStoreKey("foo"))).thenReturn(null);

    final HttpContext httpContext = mock(HttpContext.class);
    when(httpContext.getAttribute(HttpClientFactory.HTTP_CTX_KEY_REPOSITORY)).thenReturn(repository);

    final RepositoryClientConnectionOperatorSelector underTest = new RepositoryClientConnectionOperatorSelector(
View Full Code Here

      throws Exception
  {
    final Repository repository = mock(Repository.class);
    when(repository.getId()).thenReturn("foo");

    final TrustStore trustStore = mock(TrustStore.class);
    when(trustStore.getSSLContextFor(repositoryTrustStoreKey("foo"))).thenReturn(SSLContext.getDefault());

    final HttpContext httpContext = mock(HttpContext.class);

    final RepositoryClientConnectionOperatorSelector underTest = new RepositoryClientConnectionOperatorSelector(
        trustStore
View Full Code Here

      throws Exception
  {
    final Repository repository = mock(Repository.class);
    when(repository.getId()).thenReturn("foo");

    final TrustStore trustStore = mock(TrustStore.class);
    when(trustStore.getSSLContextFor(repositoryTrustStoreKey("foo"))).thenReturn(SSLContext.getDefault());

    final HttpContext httpContext = mock(HttpContext.class);
    when(httpContext.getAttribute(HttpClientFactory.HTTP_CTX_KEY_REPOSITORY)).thenReturn(new Object());

    final RepositoryClientConnectionOperatorSelector underTest = new RepositoryClientConnectionOperatorSelector(
View Full Code Here

   */
  @Test
  public void socketFactoryAddedToParams()
      throws Exception
  {
    final TrustStore trustStore = mock(TrustStore.class);
    when(trustStore.getSSLContextFor(smtpTrustStoreKey())).thenReturn(SSLContext.getDefault());

    final SMTPSessionParametersCustomizer underTest = new SMTPSessionParametersCustomizer(trustStore);
    final Properties properties = new Properties();
    properties.setProperty("mail.smtp.socketFactory.class", "Foo.class");
    underTest.customize(properties);
View Full Code Here

   */
  @Test
  public void socketFactoryNotAddedToParamsWhenTrustStoreNotEnabled()
      throws Exception
  {
    final TrustStore trustStore = mock(TrustStore.class);
    when(trustStore.getSSLContextFor(smtpTrustStoreKey())).thenReturn(null);

    final SMTPSessionParametersCustomizer underTest = new SMTPSessionParametersCustomizer(trustStore);
    final Properties properties = new Properties();
    properties.setProperty("mail.smtp.socketFactory.class", "Foo.class");
    underTest.customize(properties);
View Full Code Here

   */
  @Test
  public void socketFactoryNotAddedToParamsWhenSSLParamsNotPresent()
      throws Exception
  {
    final TrustStore trustStore = mock(TrustStore.class);
    when(trustStore.getSSLContextFor(smtpTrustStoreKey())).thenReturn(SSLContext.getDefault());

    final SMTPSessionParametersCustomizer underTest = new SMTPSessionParametersCustomizer(trustStore);
    final Properties properties = new Properties();
    underTest.customize(properties);

View Full Code Here

TOP

Related Classes of com.sonatype.nexus.ssl.plugin.TrustStore

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.