Package org.sonatype.nexus.proxy.events

Examples of org.sonatype.nexus.proxy.events.RepositoryEventProxyModeChanged


          // this one should be fired _always_
          eventBus().post(new RepositoryEventProxyModeSet(this, oldProxyMode, proxyMode, cause));

          if (proxyMode != null && !proxyMode.equals(oldProxyMode)) {
            // this one should be fired on _transition_ only
            eventBus().post(new RepositoryEventProxyModeChanged(this, oldProxyMode, proxyMode, cause));
          }
        }
      }
    }
  }
View Full Code Here


  @Test
  public void repositoryIsAutoBlocked() {
    assertThat(underTest.isSatisfied(), is(true));

    when(repository.getProxyMode()).thenReturn(ProxyMode.BLOCKED_AUTO);
    underTest.handle(new RepositoryEventProxyModeChanged(
        repository, ProxyMode.ALLOW, ProxyMode.BLOCKED_AUTO, null
    ));
    assertThat(underTest.isSatisfied(), is(false));

    verifyEventBusEvents(satisfied(underTest), unsatisfied(underTest));
View Full Code Here

  @Test
  public void satisfiedWhenRepositoryIsManuallyBlocked() {
    assertThat(underTest.isSatisfied(), is(true));

    when(repository.getProxyMode()).thenReturn(ProxyMode.BLOCKED_MANUAL);
    underTest.handle(new RepositoryEventProxyModeChanged(
        repository, ProxyMode.ALLOW, ProxyMode.BLOCKED_MANUAL, null
    ));
    assertThat(underTest.isSatisfied(), is(false));

    verifyEventBusEvents(satisfied(underTest), unsatisfied(underTest));
View Full Code Here

  @Test
  public void satisfiedWhenRepositoryIsNotBlockingAnymore() {
    assertThat(underTest.isSatisfied(), is(true));

    when(repository.getProxyMode()).thenReturn(ProxyMode.BLOCKED_AUTO);
    underTest.handle(new RepositoryEventProxyModeChanged(
        repository, ProxyMode.ALLOW, ProxyMode.BLOCKED_AUTO, null
    ));

    when(repository.getProxyMode()).thenReturn(ProxyMode.ALLOW);
    underTest.handle(new RepositoryEventProxyModeChanged(
        repository, ProxyMode.BLOCKED_AUTO, ProxyMode.ALLOW, null
    ));
    assertThat(underTest.isSatisfied(), is(true));

    verifyEventBusEvents(satisfied(underTest), unsatisfied(underTest), satisfied(underTest));
View Full Code Here

TOP

Related Classes of org.sonatype.nexus.proxy.events.RepositoryEventProxyModeChanged

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.