📍Use lombok, reformat, and optimize the code (#1560)
* Use lombok, reformat, and optimize the code * Fix merge conflicts and some sonar issues Co-authored-by: va1m <va1m@email.com>
This commit is contained in:
@@ -23,13 +23,6 @@
|
||||
|
||||
package com.iluwatar.halfsynchalfasync;
|
||||
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.mockito.InOrder;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.concurrent.LinkedBlockingQueue;
|
||||
|
||||
import static org.mockito.Matchers.eq;
|
||||
import static org.mockito.Mockito.doThrow;
|
||||
import static org.mockito.Mockito.inOrder;
|
||||
@@ -40,6 +33,11 @@ import static org.mockito.Mockito.verify;
|
||||
import static org.mockito.Mockito.verifyNoMoreInteractions;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.concurrent.LinkedBlockingQueue;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
/**
|
||||
* Date: 12/12/15 - 11:15 PM
|
||||
*
|
||||
@@ -56,7 +54,7 @@ public class AsynchronousServiceTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testPerfectExecution() throws Exception {
|
||||
void testPerfectExecution() throws Exception {
|
||||
final var result = new Object();
|
||||
when(task.call()).thenReturn(result);
|
||||
service.execute(task);
|
||||
@@ -72,7 +70,7 @@ public class AsynchronousServiceTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCallException() throws Exception {
|
||||
void testCallException() throws Exception {
|
||||
final var exception = new IOException();
|
||||
when(task.call()).thenThrow(exception);
|
||||
service.execute(task);
|
||||
@@ -88,7 +86,7 @@ public class AsynchronousServiceTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testPreCallException() {
|
||||
void testPreCallException() {
|
||||
final var exception = new IllegalStateException();
|
||||
doThrow(exception).when(task).onPreCall();
|
||||
service.execute(task);
|
||||
|
Reference in New Issue
Block a user