Skip to content

Commit

Permalink
Fix the build, reduce method visibility
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephan202 committed Nov 19, 2018
1 parent d9e6dce commit 1eb22e5
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 29 deletions.
1 change: 0 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -670,7 +670,6 @@
<mutators>
<mutator>ALL</mutator>
</mutators>
<testPlugin>testng</testPlugin>
<!-- Use multple threads to speed things up. Extend
timeouts to prevent false positives as a result of
contention. -->
Expand Down
5 changes: 5 additions & 0 deletions rxjava-support/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@
<artifactId>junit-jupiter-api</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;

public final class PicnicRxPluginsTest {
final class PicnicRxPluginsTest {
private final ConcurrentMap<Context, AtomicInteger> verificationCounters =
new ConcurrentHashMap<>();

Expand All @@ -36,7 +36,7 @@ static void tearDown() {
}

@Test
public void testPropagate() {
void testPropagate() {
Observable<Integer> obs = Observable.just(1, 2, 3);

// Without context propagation
Expand All @@ -59,7 +59,7 @@ public void testPropagate() {
}

@Test
public void testObserveOnAnotherScheduler() {
void testObserveOnAnotherScheduler() {
Observable<Integer> obs = Observable.just(1, 2, 3);

Context ctx = Context.createRandom().applyToCurrentThread();
Expand All @@ -73,7 +73,7 @@ public void testObserveOnAnotherScheduler() {
}

@Test
public void testPropagateOnMultipleSchedulers() {
void testPropagateOnMultipleSchedulers() {
Observable<Integer> obs = Observable.just(1, 2, 3);

Context ctx = Context.createRandom().applyToCurrentThread();
Expand All @@ -87,7 +87,7 @@ public void testPropagateOnMultipleSchedulers() {
}

@Test
public void testNotLeaking() throws InterruptedException {
void testNotLeaking() throws InterruptedException {
Observable<Integer> obs = Observable.just(1, 2, 3);
Scheduler singleScheduler = Schedulers.single();

Expand Down Expand Up @@ -127,7 +127,7 @@ public void testNotLeaking() throws InterruptedException {
}

@Test
public void testContextSwitchBeforeConsumption() {
void testContextSwitchBeforeConsumption() {
Observable<Integer> obs = Observable.just(1, 2, 3);

// Context is propagated on scheduling, not on observable creation.
Expand All @@ -140,7 +140,7 @@ public void testContextSwitchBeforeConsumption() {
}

@Test
public void testPropagationOnSameThread() {
void testPropagationOnSameThread() {
Observable<Integer> obs = Observable.just(1, 2, 3);

Context ctx = Context.createRandom().applyToCurrentThread();
Expand All @@ -153,7 +153,7 @@ public void testPropagationOnSameThread() {
}

@Test
public void testEmptyContextIsPropagated() {
void testEmptyContextIsPropagated() {
Observable<Integer> obs = Observable.just(1, 2, 3);

ExecutorService es = Executors.newSingleThreadExecutor();
Expand All @@ -173,7 +173,7 @@ public void testEmptyContextIsPropagated() {
}

@Test
public void testTestSchedulerContextPropagation() throws InterruptedException {
void testTestSchedulerContextPropagation() throws InterruptedException {
Context ctx = Context.createRandom().applyToCurrentThread();

TestScheduler testScheduler = new TestScheduler();
Expand All @@ -190,7 +190,7 @@ public void testTestSchedulerContextPropagation() throws InterruptedException {
}

@Test
public void testDirectExecutor() {
void testDirectExecutor() {
Context ctx = Context.createRandom().applyToCurrentThread();

TestScheduler io = new TestScheduler();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
import java.util.concurrent.atomic.AtomicInteger;
import org.junit.jupiter.api.Test;

public final class RetryStrategyTest {
final class RetryStrategyTest {
@Test
public void testOnlyIf() throws Exception {
void testOnlyIf() throws Exception {
errorSource(2)
.retryWhen(
RetryStrategy.onlyIf(
Expand All @@ -31,7 +31,7 @@ public void testOnlyIf() throws Exception {
}

@Test
public void testExponentialBackoff() {
void testExponentialBackoff() {
AtomicInteger retries = new AtomicInteger();
TestScheduler scheduler = new TestScheduler();
TestSubscriber<Integer> test =
Expand All @@ -57,7 +57,7 @@ public void testExponentialBackoff() {
}

@Test
public void testBoundedExponentialBackoff() {
void testBoundedExponentialBackoff() {
AtomicInteger retries = new AtomicInteger();
TestScheduler scheduler = new TestScheduler();
TestSubscriber<Integer> test =
Expand Down Expand Up @@ -90,7 +90,7 @@ public void testBoundedExponentialBackoff() {
}

@Test
public void testFixedBackoff() {
void testFixedBackoff() {
TestScheduler scheduler = new TestScheduler();
TestSubscriber<Integer> test =
errorSource(10)
Expand All @@ -107,7 +107,7 @@ public void testFixedBackoff() {
}

@Test
public void testCustomBackoff() {
void testCustomBackoff() {
TestScheduler scheduler = new TestScheduler();
TestSubscriber<Integer> test =
errorSource(10)
Expand All @@ -124,7 +124,7 @@ public void testCustomBackoff() {
}

@Test
public void testTimes() throws Exception {
void testTimes() throws Exception {
errorSource(10)
.retryWhen(RetryStrategy.always().times(5).build())
.test()
Expand Down
22 changes: 11 additions & 11 deletions rxjava-support/src/test/java/tech/picnic/rx/RxSpring4UtilTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
import org.springframework.web.servlet.mvc.method.annotation.SseEmitter;

@TestInstance(Lifecycle.PER_CLASS)
public final class RxSpring4UtilTest {
final class RxSpring4UtilTest {
private final TestScheduler testScheduler = new TestScheduler();

@SuppressWarnings("NullAway")
Expand All @@ -69,20 +69,20 @@ void setUp() {
}

@Test
public void testSingleToDeferredResult() throws Exception {
void testSingleToDeferredResult() throws Exception {
verifyAsyncGetRequest("/singleToDeferredResult?value=foo", OK, "foo");
verifyAsyncGetRequest("/singleToDeferredResult?value=error", BAD_REQUEST, "");
}

@Test
public void testMaybeToDeferredResult() throws Exception {
void testMaybeToDeferredResult() throws Exception {
verifyAsyncGetRequest("/maybeToDeferredResult", NOT_FOUND, "");
verifyAsyncGetRequest("/maybeToDeferredResult?value=foo", OK, "foo");
verifyAsyncGetRequest("/maybeToDeferredResult?value=error", BAD_REQUEST, "");
}

@Test
public void testObservableToDeferredResult() throws Exception {
void testObservableToDeferredResult() throws Exception {
verifyAsyncGetRequest("/observableToDeferredResult?value=foo", OK, "[\"foo\"]");
verifyAsyncGetRequest(
"/observableToDeferredResult?value=bar&repeat=2", OK, "[\"bar\",\"bar\"]");
Expand All @@ -91,37 +91,37 @@ public void testObservableToDeferredResult() throws Exception {
}

@Test
public void testPublisherToDeferredResult() throws Exception {
void testPublisherToDeferredResult() throws Exception {
verifyAsyncGetRequest("/publisherToDeferredResult?value=foo", OK, "[\"foo\"]");
verifyAsyncGetRequest("/publisherToDeferredResult?value=bar&repeat=2", OK, "[\"bar\",\"bar\"]");
verifyAsyncGetRequest("/publisherToDeferredResult?value=baz&repeat=0", OK, "[]");
verifyAsyncGetRequest("/publisherToDeferredResult?value=error", BAD_REQUEST, "");
}

@Test
public void testCompletableToDeferredResult() throws Exception {
void testCompletableToDeferredResult() throws Exception {
verifyAsyncGetRequest("/completableToDeferredResult?fail=false", OK, "");
verifyAsyncGetRequest("/completableToDeferredResult?fail=true", BAD_REQUEST, "");
}

@Test
public void testObservableToSse() throws Exception {
void testObservableToSse() throws Exception {
verifySyncGetRequest("/observableToSse?value=foo", OK, "data:foo\n\n");
verifySyncGetRequest("/observableToSse?value=bar&repeat=2", OK, "data:bar\n\ndata:bar\n\n");
verifySyncGetRequest("/observableToSse?value=baz&repeat=0", OK, "");
verifyAsyncGetRequest("/observableToSse?value=error", BAD_REQUEST, "");
}

@Test
public void testPublisherToSse() throws Exception {
void testPublisherToSse() throws Exception {
verifySyncGetRequest("/publisherToSse?value=foo", OK, "data:foo\n\n");
verifySyncGetRequest("/publisherToSse?value=bar&repeat=2", OK, "data:bar\n\ndata:bar\n\n");
verifySyncGetRequest("/publisherToSse?value=baz&repeat=0", OK, "");
verifyAsyncGetRequest("/publisherToSse?value=error", BAD_REQUEST, "");
}

@Test
public void testPublisherToSseWithKeepAlive() throws Exception {
void testPublisherToSseWithKeepAlive() throws Exception {
testScheduler.advanceTimeTo(0, MILLISECONDS);
MockHttpServletResponse response =
doGet("/publisherToSse/with-keep-alive?value=foo&repeat=2&interval=250")
Expand Down Expand Up @@ -157,7 +157,7 @@ public void testPublisherToSseWithKeepAlive() throws Exception {
}

@Test
public void testPublisherToSseWithKeepAliveAndError() throws Exception {
void testPublisherToSseWithKeepAliveAndError() throws Exception {
testScheduler.advanceTimeTo(0, MILLISECONDS);
MockHttpServletResponse response =
doGet("/publisherToSse/with-keep-alive?value=error&repeat=1&interval=150")
Expand All @@ -172,7 +172,7 @@ public void testPublisherToSseWithKeepAliveAndError() throws Exception {
}

@Test
public void testPublisherToSseWithComplexObject() throws Exception {
void testPublisherToSseWithComplexObject() throws Exception {
verifySyncGetRequest(
"/publisherToSse/with-complex-object?repeat=2",
OK,
Expand Down

0 comments on commit 1eb22e5

Please sign in to comment.