Tabnine Logo
EveryTenSecondsScheduler
Code IndexAdd Tabnine to your IDE (free)

How to use
EveryTenSecondsScheduler
in
de.otto.edison.status.scheduler

Best Java code snippets using de.otto.edison.status.scheduler.EveryTenSecondsScheduler (Showing top 4 results out of 315)

origin: de.otto.edison/edison-status

/**
 * Scheduler that is updating the status every ten seconds.
 *
 * This is used by default, if no other scheduler is configured.
 *
 * @return Scheduler
 */
@Bean
@ConditionalOnMissingBean(Scheduler.class)
public Scheduler fixedDelayScheduler() {
  return new EveryTenSecondsScheduler(
      aggregator
  );
}
origin: otto-de/edison-microservice

  /**
   * Scheduler that is updating the status every ten seconds.
   *
   * This is used by default, if no other scheduler is configured.
   *
   * @param applicationStatusAggregator the ApplicationStatusAggregator scheduled for updates
   * @return Scheduler fixed delay scheduler
   */
  @Bean
  @ConditionalOnMissingBean(Scheduler.class)
  public Scheduler fixedDelayScheduler(final ApplicationStatusAggregator applicationStatusAggregator) {
    return new EveryTenSecondsScheduler(
        applicationStatusAggregator
    );
  }
}
origin: otto-de/edison-microservice

@Test
public void shouldDelegateStatusAggregation() throws Exception {
  final ApplicationStatusAggregator statusAggregator = mock(ApplicationStatusAggregator.class);
  when(statusAggregator.aggregatedStatus()).thenReturn(SOME_STATUS);
  final Scheduler scheduler = new EveryTenSecondsScheduler(statusAggregator);
  scheduler.update();
  assertThat(statusAggregator.aggregatedStatus(), is(SOME_STATUS));
}
origin: otto-de/edison-microservice

  @Test
  public void shouldUpdateStatus() throws Exception {
    final ApplicationStatusAggregator statusAggregator = mock(ApplicationStatusAggregator.class);
    when(statusAggregator.aggregatedStatus())
        .thenReturn(SOME_STATUS)
        .thenReturn(SOME_OTHER_STATUS);

    final Scheduler scheduler = new EveryTenSecondsScheduler(statusAggregator);
    // when
    scheduler.update();
    // then
    assertThat(statusAggregator.aggregatedStatus(), is(SOME_STATUS));
    // when
    scheduler.update();
    // then
    assertThat(statusAggregator.aggregatedStatus(), is(SOME_OTHER_STATUS));
  }
}
de.otto.edison.status.schedulerEveryTenSecondsScheduler

Most used methods

  • <init>

Popular in Java

  • Making http requests using okhttp
  • getSystemService (Context)
  • findViewById (Activity)
  • getApplicationContext (Context)
  • Menu (java.awt)
  • Socket (java.net)
    Provides a client-side TCP socket.
  • SecureRandom (java.security)
    This class generates cryptographically secure pseudo-random numbers. It is best to invoke SecureRand
  • Dictionary (java.util)
    Note: Do not use this class since it is obsolete. Please use the Map interface for new implementatio
  • PriorityQueue (java.util)
    A PriorityQueue holds elements on a priority heap, which orders the elements according to their natu
  • Cipher (javax.crypto)
    This class provides access to implementations of cryptographic ciphers for encryption and decryption
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now