mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-05-15 08:59:01 +00:00
Java 11 migrate remaining (g,h,i) (#1116)
* Moves game-loop to Java 11 * Moves guarded-suspension to Java 11 * Moves half-sync-half-async to Java 11 * Moves hexagonal to Java 11 * Moves intercepting-filter to Java 11 * Moves interpreter to Java 11 * Moves iterator to Java 11
This commit is contained in:
committed by
Ilkka Seppälä
parent
7d0a5c0edb
commit
f835d3d516
+6
-6
@@ -57,13 +57,13 @@ public class AsynchronousServiceTest {
|
||||
|
||||
@Test
|
||||
public void testPerfectExecution() throws Exception {
|
||||
final Object result = new Object();
|
||||
final var result = new Object();
|
||||
when(task.call()).thenReturn(result);
|
||||
service.execute(task);
|
||||
|
||||
verify(task, timeout(2000)).onPostCall(eq(result));
|
||||
|
||||
final InOrder inOrder = inOrder(task);
|
||||
final var inOrder = inOrder(task);
|
||||
inOrder.verify(task, times(1)).onPreCall();
|
||||
inOrder.verify(task, times(1)).call();
|
||||
inOrder.verify(task, times(1)).onPostCall(eq(result));
|
||||
@@ -73,13 +73,13 @@ public class AsynchronousServiceTest {
|
||||
|
||||
@Test
|
||||
public void testCallException() throws Exception {
|
||||
final IOException exception = new IOException();
|
||||
final var exception = new IOException();
|
||||
when(task.call()).thenThrow(exception);
|
||||
service.execute(task);
|
||||
|
||||
verify(task, timeout(2000)).onError(eq(exception));
|
||||
|
||||
final InOrder inOrder = inOrder(task);
|
||||
final var inOrder = inOrder(task);
|
||||
inOrder.verify(task, times(1)).onPreCall();
|
||||
inOrder.verify(task, times(1)).call();
|
||||
inOrder.verify(task, times(1)).onError(exception);
|
||||
@@ -89,13 +89,13 @@ public class AsynchronousServiceTest {
|
||||
|
||||
@Test
|
||||
public void testPreCallException() {
|
||||
final IllegalStateException exception = new IllegalStateException();
|
||||
final var exception = new IllegalStateException();
|
||||
doThrow(exception).when(task).onPreCall();
|
||||
service.execute(task);
|
||||
|
||||
verify(task, timeout(2000)).onError(eq(exception));
|
||||
|
||||
final InOrder inOrder = inOrder(task);
|
||||
final var inOrder = inOrder(task);
|
||||
inOrder.verify(task, times(1)).onPreCall();
|
||||
inOrder.verify(task, times(1)).onError(exception);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user