mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-05-17 02:59:23 +00:00
Minor refactorings and code style changes (#807)
* Made minor changes in some patterns such as removed throws clause where not needed, changed incorrect order of arguments in assertEquals * Minor refactorings and code style changes. 1) Removed several use of raw types 2) Removed unnecessary throws clauses 3) Used lambda expressions wherever applicable 4) Used apt assertion methods for readability 5) Use of try with resources wherever applicable 6) Corrected incorrect order of assertXXX arguments * Removed unused import from Promise * Addressed review comments * Addressed checkstyle issue
This commit is contained in:
@@ -22,9 +22,7 @@
|
||||
*/
|
||||
package com.iluwatar.monostate;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.mockito.Matchers.any;
|
||||
import static org.mockito.Mockito.doNothing;
|
||||
import static org.mockito.Mockito.mock;
|
||||
@@ -34,6 +32,8 @@ import static org.mockito.Mockito.verifyNoMoreInteractions;
|
||||
import static org.mockito.Mockito.verifyZeroInteractions;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
/**
|
||||
* Date: 12/21/15 - 12:26 PM
|
||||
*
|
||||
@@ -47,9 +47,9 @@ public class LoadBalancerTest {
|
||||
final LoadBalancer secondBalancer = new LoadBalancer();
|
||||
firstBalancer.addServer(new Server("localhost", 8085, 6));
|
||||
// Both should have the same number of servers.
|
||||
assertTrue(firstBalancer.getNoOfServers() == secondBalancer.getNoOfServers());
|
||||
assertEquals(firstBalancer.getNoOfServers(), secondBalancer.getNoOfServers());
|
||||
// Both Should have the same LastServedId
|
||||
assertTrue(firstBalancer.getLastServedId() == secondBalancer.getLastServedId());
|
||||
assertEquals(firstBalancer.getLastServedId(), secondBalancer.getLastServedId());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user