Skip to content

Instantly share code, notes, and snippets.

Created July 30, 2020 08:23
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
package de.cronos.mad.messages.backend;
import java.util.List;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.function.Supplier;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import reactor.core.publisher.EmitterProcessor;
import reactor.core.publisher.Mono;
public class RepeatTest {
private static class TestSubject {
EmitterProcessor<Boolean> shutdown = EmitterProcessor.create();
StringBuffer sb = new StringBuffer();
public void logMonoValues(Supplier<Mono<String>> monoSupplier) {
public void repeatTest() {
LinkedBlockingQueue<String> data = new LinkedBlockingQueue<>(List.of("Hello", "World"));
TestSubject testSubject = new TestSubject();
testSubject.logMonoValues(() -> {
if (data.isEmpty()) {
return Mono.empty();
return Mono.just(data.remove());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment