📍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:
@ -26,18 +26,17 @@ package com;
|
||||
import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
|
||||
|
||||
import com.iluwatar.leaderfollowers.App;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
/**
|
||||
*
|
||||
* Application test
|
||||
*
|
||||
*/
|
||||
class AppTest {
|
||||
|
||||
@Test
|
||||
void shouldExecuteApplicationWithoutException() {
|
||||
assertDoesNotThrow(() -> App.main(new String[]{}));
|
||||
}
|
||||
@Test
|
||||
void shouldExecuteApplicationWithoutException() {
|
||||
assertDoesNotThrow(() -> App.main(new String[]{}));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -34,12 +34,12 @@ import org.junit.jupiter.api.Test;
|
||||
*/
|
||||
class TaskHandlerTest {
|
||||
|
||||
@Test
|
||||
void testHandleTask() throws InterruptedException {
|
||||
var taskHandler = new TaskHandler();
|
||||
var handle = new Task(100);
|
||||
taskHandler.handleTask(handle);
|
||||
assertTrue(handle.isFinished());
|
||||
}
|
||||
@Test
|
||||
void testHandleTask() throws InterruptedException {
|
||||
var taskHandler = new TaskHandler();
|
||||
var handle = new Task(100);
|
||||
taskHandler.handleTask(handle);
|
||||
assertTrue(handle.isFinished());
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -34,20 +34,20 @@ import org.junit.jupiter.api.Test;
|
||||
*/
|
||||
class TaskSetTest {
|
||||
|
||||
@Test
|
||||
void testAddTask() throws InterruptedException {
|
||||
var taskSet = new TaskSet();
|
||||
taskSet.addTask(new Task(10));
|
||||
assertEquals(1, taskSet.getSize());
|
||||
}
|
||||
@Test
|
||||
void testAddTask() throws InterruptedException {
|
||||
var taskSet = new TaskSet();
|
||||
taskSet.addTask(new Task(10));
|
||||
assertEquals(1, taskSet.getSize());
|
||||
}
|
||||
|
||||
@Test
|
||||
void testGetTask() throws InterruptedException {
|
||||
var taskSet = new TaskSet();
|
||||
taskSet.addTask(new Task(100));
|
||||
Task task = taskSet.getTask();
|
||||
assertEquals(100, task.getTime());
|
||||
assertEquals(0, taskSet.getSize());
|
||||
}
|
||||
@Test
|
||||
void testGetTask() throws InterruptedException {
|
||||
var taskSet = new TaskSet();
|
||||
taskSet.addTask(new Task(100));
|
||||
Task task = taskSet.getTask();
|
||||
assertEquals(100, task.getTime());
|
||||
assertEquals(0, taskSet.getSize());
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user