Package org.sonatype.nexus.rest.model

Examples of org.sonatype.nexus.rest.model.RemoteProxySettingsDTO


  private GlobalConfigurationResource configuration = new GlobalConfigurationResource();

  @Test
  public void noSettings() {
    final RemoteProxy underTest = createJerseyHttpProxy();
    final RemoteProxySettingsDTO settings = underTest.settings();

    assertThat(settings, is(notNullValue()));

    settings.setHttpProxySettings(new RemoteHttpProxySettingsDTO());
    settings.getHttpProxySettings().setProxyHostname("bar");

    settings.setHttpsProxySettings(new RemoteHttpProxySettingsDTO());
    settings.getHttpsProxySettings().setProxyHostname("car");

    settings.addNonProxyHost("foo");

    underTest.save();

    assertThat(configuration.getRemoteProxySettings(), is(notNullValue()));
View Full Code Here


    assertThat(configuration.getRemoteProxySettings().getNonProxyHosts(), hasItem("foo"));
  }

  @Test
  public void existingSettings() {
    final RemoteProxySettingsDTO configSettings = new RemoteProxySettingsDTO();
    configSettings.setHttpProxySettings(new RemoteHttpProxySettingsDTO());
    configSettings.getHttpProxySettings().setProxyHostname("foo");
    configSettings.setHttpsProxySettings(new RemoteHttpProxySettingsDTO());
    configSettings.getHttpsProxySettings().setProxyHostname("bar");
    configSettings.addNonProxyHost("car1");
    configuration.setRemoteProxySettings(configSettings);

    final RemoteProxy underTest = createJerseyHttpProxy();
    final RemoteProxySettingsDTO settings = underTest.settings();

    assertThat(settings, is(notNullValue()));
    assertThat(settings.getHttpProxySettings(), is(notNullValue()));
    assertThat(settings.getHttpProxySettings().getProxyHostname(), is("foo"));
    assertThat(settings.getHttpsProxySettings(), is(notNullValue()));
    assertThat(settings.getHttpsProxySettings().getProxyHostname(), is("bar"));
    assertThat(settings.getNonProxyHosts(), hasItem("car1"));

    configSettings.getHttpProxySettings().setProxyHostname("foo1");
    configSettings.getHttpsProxySettings().setProxyHostname("bar1");
    configSettings.addNonProxyHost("car2");
    underTest.save();
View Full Code Here

  }

  @Test
  public void reset() {
    final RemoteProxy underTest = createJerseyHttpProxy();
    final RemoteProxySettingsDTO settings = underTest.settings();

    assertThat(settings, is(notNullValue()));

    settings.addNonProxyHost("bar");
    underTest.refresh();

    assertThat(settings.getNonProxyHosts(), not(hasItem("bar")));
  }
View Full Code Here

TOP

Related Classes of org.sonatype.nexus.rest.model.RemoteProxySettingsDTO

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.