Search in sources :

Example 11 with AssemblySnapshot

use of reactor.core.publisher.FluxOnAssembly.AssemblySnapshot in project reactor-core by reactor.

the class MonoCallableOnAssemblyTest method scanOperator.

@Test
public void scanOperator() {
    AssemblySnapshot stacktrace = new AssemblySnapshot(null, Traces.callSiteSupplierFactory.get());
    Mono<Object> source = Mono.empty();
    MonoCallableOnAssembly<?> test = new MonoCallableOnAssembly<>(source, stacktrace);
    assertThat(test.scan(Scannable.Attr.ACTUAL_METADATA)).isTrue();
    assertThat(test.scan(Scannable.Attr.PARENT)).isSameAs(source);
    assertThat(test.scan(Scannable.Attr.PREFETCH)).isEqualTo(Integer.MAX_VALUE);
    assertThat(test.scan(Scannable.Attr.RUN_STYLE)).isSameAs(Scannable.Attr.RunStyle.SYNC);
}
Also used : AssemblySnapshot(reactor.core.publisher.FluxOnAssembly.AssemblySnapshot) Test(org.junit.jupiter.api.Test)

Example 12 with AssemblySnapshot

use of reactor.core.publisher.FluxOnAssembly.AssemblySnapshot in project reactor-core by reactor.

the class ConnectableFluxOnAssemblyTest method stepNameAndToString.

@Test
public void stepNameAndToString() {
    AssemblySnapshot stacktrace = new AssemblySnapshot(null, Traces.callSiteSupplierFactory.get());
    ConnectableFluxOnAssembly<?> test = new ConnectableFluxOnAssembly<>(Flux.empty().publish(), stacktrace);
    assertThat(test.toString()).isEqualTo(test.stepName()).startsWith("reactor.core.publisher.ConnectableFluxOnAssemblyTest.stepNameAndToString(ConnectableFluxOnAssemblyTest.java:");
}
Also used : AssemblySnapshot(reactor.core.publisher.FluxOnAssembly.AssemblySnapshot) Test(org.junit.jupiter.api.Test)

Example 13 with AssemblySnapshot

use of reactor.core.publisher.FluxOnAssembly.AssemblySnapshot in project reactor-core by reactor.

the class MonoOnAssemblyTest method stepNameAndToString.

@Test
public void stepNameAndToString() {
    AssemblySnapshot stacktrace = new AssemblySnapshot(null, Traces.callSiteSupplierFactory.get());
    MonoOnAssembly<?> test = new MonoOnAssembly<>(Mono.empty(), stacktrace);
    assertThat(test.toString()).isEqualTo(test.stepName()).startsWith("reactor.core.publisher.MonoOnAssemblyTest.stepNameAndToString(MonoOnAssemblyTest.java:");
}
Also used : AssemblySnapshot(reactor.core.publisher.FluxOnAssembly.AssemblySnapshot) Test(org.junit.jupiter.api.Test)

Example 14 with AssemblySnapshot

use of reactor.core.publisher.FluxOnAssembly.AssemblySnapshot in project reactor-core by reactor.

the class MonoOnAssemblyTest method scanOperator.

@Test
public void scanOperator() {
    AssemblySnapshot stacktrace = new AssemblySnapshot(null, Traces.callSiteSupplierFactory.get());
    MonoOnAssembly<?> test = new MonoOnAssembly<>(Mono.empty(), stacktrace);
    assertThat(test.scan(Scannable.Attr.ACTUAL_METADATA)).as("ACTUAL_METADATA").isTrue();
    assertThat(test.scan(Scannable.Attr.RUN_STYLE)).isSameAs(Scannable.Attr.RunStyle.SYNC);
}
Also used : AssemblySnapshot(reactor.core.publisher.FluxOnAssembly.AssemblySnapshot) Test(org.junit.jupiter.api.Test)

Example 15 with AssemblySnapshot

use of reactor.core.publisher.FluxOnAssembly.AssemblySnapshot in project reactor-core by reactor.

the class ParallelFluxOnAssemblyTest method parallelism.

@Test
public void parallelism() {
    ParallelFlux<Integer> source = Flux.range(1, 4).parallel(3);
    AssemblySnapshot stacktrace = new AssemblySnapshot(null, Traces.callSiteSupplierFactory.get());
    ParallelFluxOnAssembly<Integer> test = new ParallelFluxOnAssembly<>(source, stacktrace);
    assertThat(test.parallelism()).isEqualTo(3).isEqualTo(source.parallelism());
}
Also used : AssemblySnapshot(reactor.core.publisher.FluxOnAssembly.AssemblySnapshot) Test(org.junit.jupiter.api.Test)

Aggregations

AssemblySnapshot (reactor.core.publisher.FluxOnAssembly.AssemblySnapshot)19 Test (org.junit.jupiter.api.Test)15 Publisher (org.reactivestreams.Publisher)4 CorePublisher (reactor.core.CorePublisher)4 Subscription (org.reactivestreams.Subscription)1