Skip to content

Commit f67efa7

Browse files
committed
Removed the unnecessary 'catch' and 'fail'
1 parent 782909f commit f67efa7

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

rxjava-core/src/main/java/rx/operators/OperationNext.java

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ public void testOnError() throws Throwable {
234234
}
235235

236236
@Test
237-
public void testOnErrorViaHasNext() throws Throwable {
237+
public void testOnErrorViaHasNext() throws InterruptedException, ExecutionException {
238238
Subject<String, String> obs = PublishSubject.create();
239239

240240
Iterator<String> it = next(obs).iterator();
@@ -253,15 +253,10 @@ public void testOnErrorViaHasNext() throws Throwable {
253253
obs.onError(new TestException());
254254

255255
// this should not throw an exception but instead just return false
256-
try {
257-
assertFalse(it.hasNext());
258-
} catch (Throwable e) {
259-
fail("should not have received exception");
260-
e.printStackTrace();
261-
}
256+
assertFalse(it.hasNext());
262257
}
263258

264-
private Future<String> nextAsync(final Iterator<String> it) throws Throwable {
259+
private Future<String> nextAsync(final Iterator<String> it) {
265260

266261
return executor.submit(new Callable<String>() {
267262

0 commit comments

Comments
 (0)