mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-05-14 10:58:42 +00:00
refactor: remove code smell java:S5786 (#2159)
https://sonarcloud.io/organizations/iluwatar/rules?open=java%3AS5786&rule_key=java%3AS5786
This commit is contained in:
+1
-1
@@ -74,7 +74,7 @@ class ConfigureForDosVisitorTest {
|
||||
|
||||
@BeforeEach
|
||||
@AfterEach
|
||||
public void clearLoggers() {
|
||||
void clearLoggers() {
|
||||
TestLoggerFactory.clear();
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -44,7 +44,7 @@ class ConfigureForUnixVisitorTest {
|
||||
|
||||
@BeforeEach
|
||||
@AfterEach
|
||||
public void clearLoggers() {
|
||||
void clearLoggers() {
|
||||
TestLoggerFactory.clear();
|
||||
}
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ class AdapterPatternTest {
|
||||
* This method runs before the test execution and sets the bean objects in the beans Map.
|
||||
*/
|
||||
@BeforeEach
|
||||
public void setup() {
|
||||
void setup() {
|
||||
beans = new HashMap<>();
|
||||
|
||||
var fishingBoatAdapter = spy(new FishingBoatAdapter());
|
||||
|
||||
+1
-1
@@ -48,7 +48,7 @@ class AggregatorTest {
|
||||
private ProductInventoryClient inventoryClient;
|
||||
|
||||
@BeforeEach
|
||||
public void setup() {
|
||||
void setup() {
|
||||
MockitoAnnotations.openMocks(this);
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -48,7 +48,7 @@ class ApiGatewayTest {
|
||||
private PriceClient priceClient;
|
||||
|
||||
@BeforeEach
|
||||
public void setup() {
|
||||
void setup() {
|
||||
MockitoAnnotations.openMocks(this);
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -49,7 +49,7 @@ class BusinessDelegateTest {
|
||||
* execution of every test.
|
||||
*/
|
||||
@BeforeEach
|
||||
public void setup() {
|
||||
void setup() {
|
||||
netflixService = spy(new NetflixService());
|
||||
youTubeService = spy(new YouTubeService());
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ class CachingTest {
|
||||
* Setup of application test includes: initializing DB connection and cache size/capacity.
|
||||
*/
|
||||
@BeforeEach
|
||||
public void setUp() {
|
||||
void setUp() {
|
||||
// VirtualDB (instead of MongoDB) was used in running the JUnit tests
|
||||
// to avoid Maven compilation errors. Set flag to true to run the
|
||||
// tests with MongoDB (provided that MongoDB is installed and socket
|
||||
|
||||
@@ -34,7 +34,7 @@ import org.junit.jupiter.api.Test;
|
||||
* <p>
|
||||
* Could be done with mock objects as well where the call method call is verified.
|
||||
*/
|
||||
public class CallbackTest {
|
||||
class CallbackTest {
|
||||
|
||||
private Integer callingCount = 0;
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ import org.slf4j.LoggerFactory;
|
||||
/**
|
||||
* App Test showing usage of circuit breaker.
|
||||
*/
|
||||
public class AppTest {
|
||||
class AppTest {
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(AppTest.class);
|
||||
|
||||
@@ -60,7 +60,7 @@ public class AppTest {
|
||||
* and retry time period of 2 seconds.
|
||||
*/
|
||||
@BeforeEach
|
||||
public void setupCircuitBreakers() {
|
||||
void setupCircuitBreakers() {
|
||||
var delayedService = new DelayedRemoteService(System.nanoTime(), STARTUP_DELAY);
|
||||
//Set the circuit Breaker parameters
|
||||
delayedServiceCircuitBreaker = new DefaultCircuitBreaker(delayedService, 3000,
|
||||
@@ -78,7 +78,7 @@ public class AppTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_OpenStateTransition() {
|
||||
void testFailure_OpenStateTransition() {
|
||||
//Calling delayed service, which will be unhealthy till 4 seconds
|
||||
assertEquals("Delayed service is down", monitoringService.delayedServiceResponse());
|
||||
//As failure threshold is "1", the circuit breaker is changed to OPEN
|
||||
@@ -93,7 +93,7 @@ public class AppTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_HalfOpenStateTransition() {
|
||||
void testFailure_HalfOpenStateTransition() {
|
||||
//Calling delayed service, which will be unhealthy till 4 seconds
|
||||
assertEquals("Delayed service is down", monitoringService.delayedServiceResponse());
|
||||
//As failure threshold is "1", the circuit breaker is changed to OPEN
|
||||
@@ -112,7 +112,7 @@ public class AppTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRecovery_ClosedStateTransition() {
|
||||
void testRecovery_ClosedStateTransition() {
|
||||
//Calling delayed service, which will be unhealthy till 4 seconds
|
||||
assertEquals("Delayed service is down", monitoringService.delayedServiceResponse());
|
||||
//As failure threshold is "1", the circuit breaker is changed to OPEN
|
||||
|
||||
+1
-1
@@ -31,7 +31,7 @@ import org.junit.jupiter.api.Test;
|
||||
/**
|
||||
* Circuit Breaker test
|
||||
*/
|
||||
public class DefaultCircuitBreakerTest {
|
||||
class DefaultCircuitBreakerTest {
|
||||
|
||||
//long timeout, int failureThreshold, long retryTimePeriod
|
||||
@Test
|
||||
|
||||
+1
-1
@@ -53,7 +53,7 @@ class DelayedRemoteServiceTest {
|
||||
* @throws RemoteServiceException
|
||||
*/
|
||||
@Test
|
||||
public void testParameterizedConstructor() throws RemoteServiceException {
|
||||
void testParameterizedConstructor() throws RemoteServiceException {
|
||||
var obj = new DelayedRemoteService(System.nanoTime()-2000*1000*1000,1);
|
||||
assertEquals("Delayed service is working",obj.call());
|
||||
}
|
||||
|
||||
+4
-4
@@ -58,7 +58,7 @@ import static org.mockito.Mockito.*;
|
||||
* Unit test for Function class.
|
||||
*/
|
||||
@ExtendWith(MockitoExtension.class)
|
||||
public class UsageCostProcessorFunctionTest {
|
||||
class UsageCostProcessorFunctionTest {
|
||||
|
||||
@Mock
|
||||
MessageHandlerUtility<UsageDetail> mockMessageHandlerUtilityForUsageADetail;
|
||||
@@ -74,7 +74,7 @@ public class UsageCostProcessorFunctionTest {
|
||||
UsageCostProcessorFunction usageCostProcessorFunction;
|
||||
|
||||
@BeforeEach
|
||||
public void setUp() {
|
||||
void setUp() {
|
||||
var messageBodyUsageDetail = new MessageBody<UsageDetail>();
|
||||
var usageDetailsList = new ArrayList<UsageDetail>();
|
||||
|
||||
@@ -122,7 +122,7 @@ public class UsageCostProcessorFunctionTest {
|
||||
* Unit test for HttpTriggerJava method.
|
||||
*/
|
||||
@Test
|
||||
public void shouldTriggerHttpAzureFunctionJavaWithSubscriptionValidationEventType() throws Exception {
|
||||
void shouldTriggerHttpAzureFunctionJavaWithSubscriptionValidationEventType() throws Exception {
|
||||
|
||||
// Setup
|
||||
@SuppressWarnings("unchecked")
|
||||
@@ -148,7 +148,7 @@ public class UsageCostProcessorFunctionTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void shouldTriggerHttpAzureFunctionJavaWithUsageDetailEventType() throws Exception {
|
||||
void shouldTriggerHttpAzureFunctionJavaWithUsageDetailEventType() throws Exception {
|
||||
// Setup
|
||||
@SuppressWarnings("unchecked")
|
||||
final HttpRequestMessage<Optional<String>> req = mock(HttpRequestMessage.class);
|
||||
|
||||
+3
-3
@@ -52,7 +52,7 @@ import static org.mockito.Mockito.*;
|
||||
* Unit test for Function class.
|
||||
*/
|
||||
@ExtendWith(MockitoExtension.class)
|
||||
public class UsageDetailPublisherFunctionTest {
|
||||
class UsageDetailPublisherFunctionTest {
|
||||
@Mock
|
||||
MessageHandlerUtility<UsageDetail> mockMessageHandlerUtility;
|
||||
@Mock
|
||||
@@ -65,7 +65,7 @@ public class UsageDetailPublisherFunctionTest {
|
||||
* Unit test for HttpTriggerJava method.
|
||||
*/
|
||||
@Test
|
||||
public void shouldTriggerHttpAzureFunctionJavaWithSubscriptionValidationEventType() throws Exception {
|
||||
void shouldTriggerHttpAzureFunctionJavaWithSubscriptionValidationEventType() throws Exception {
|
||||
|
||||
// Setup
|
||||
@SuppressWarnings("unchecked")
|
||||
@@ -91,7 +91,7 @@ public class UsageDetailPublisherFunctionTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void shouldTriggerHttpAzureFunctionJavaWithUsageDetailEventType() throws Exception {
|
||||
void shouldTriggerHttpAzureFunctionJavaWithUsageDetailEventType() throws Exception {
|
||||
|
||||
// Setup
|
||||
@SuppressWarnings("unchecked")
|
||||
|
||||
+2
-2
@@ -40,7 +40,7 @@ import org.mockito.Mock;
|
||||
import org.mockito.junit.jupiter.MockitoExtension;
|
||||
|
||||
@ExtendWith(MockitoExtension.class)
|
||||
public class EventHandlerUtilityTest {
|
||||
class EventHandlerUtilityTest {
|
||||
|
||||
@Mock
|
||||
EventGridPublisherClient<BinaryData> mockCustomEventClient;
|
||||
@@ -49,7 +49,7 @@ public class EventHandlerUtilityTest {
|
||||
EventHandlerUtility<Message<UsageDetail>> eventHandlerUtility;
|
||||
|
||||
@BeforeEach
|
||||
public void setUp() {
|
||||
void setUp() {
|
||||
|
||||
System.setProperty("EventGridURL", "https://www.dummyEndpoint.com/api/events");
|
||||
System.setProperty("EventGridKey", "EventGridURL");
|
||||
|
||||
+2
-2
@@ -46,7 +46,7 @@ import static org.mockito.ArgumentMatchers.anyString;
|
||||
import static org.mockito.Mockito.*;
|
||||
|
||||
@ExtendWith(MockitoExtension.class)
|
||||
public class MessageHandlerUtilityTest {
|
||||
class MessageHandlerUtilityTest {
|
||||
@Mock
|
||||
private BlobClient mockBlobClient;
|
||||
|
||||
@@ -63,7 +63,7 @@ public class MessageHandlerUtilityTest {
|
||||
private MessageReference messageReference;
|
||||
|
||||
@BeforeEach
|
||||
public void setUp() {
|
||||
void setUp() {
|
||||
System.setProperty("BlobStorageConnectionString", "https://www.dummyEndpoint.com/api/blobs");
|
||||
|
||||
var messageBody = new MessageBody<UsageDetail>();
|
||||
|
||||
@@ -39,7 +39,7 @@ import static org.junit.Assert.*;
|
||||
and https://stackoverflow.com/questions/50211433/servlets-unit-testing
|
||||
*/
|
||||
|
||||
public class AppServletTest extends Mockito{
|
||||
class AppServletTest extends Mockito{
|
||||
private String msgPartOne = "<h1>This Server Doesn't Support";
|
||||
private String msgPartTwo = "Requests</h1>\n"
|
||||
+ "<h2>Use a GET request with boolean values for the following parameters<h2>\n"
|
||||
@@ -47,7 +47,7 @@ public class AppServletTest extends Mockito{
|
||||
private String destination = "newsDisplay.jsp";
|
||||
|
||||
@Test
|
||||
public void testDoGet() throws Exception {
|
||||
void testDoGet() throws Exception {
|
||||
HttpServletRequest mockReq = Mockito.mock(HttpServletRequest.class);
|
||||
HttpServletResponse mockResp = Mockito.mock(HttpServletResponse.class);
|
||||
RequestDispatcher mockDispatcher = Mockito.mock(RequestDispatcher.class);
|
||||
@@ -64,7 +64,7 @@ public class AppServletTest extends Mockito{
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDoPost() throws Exception {
|
||||
void testDoPost() throws Exception {
|
||||
HttpServletRequest mockReq = Mockito.mock(HttpServletRequest.class);
|
||||
HttpServletResponse mockResp = Mockito.mock(HttpServletResponse.class);
|
||||
StringWriter stringWriter = new StringWriter();
|
||||
@@ -78,7 +78,7 @@ public class AppServletTest extends Mockito{
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDoPut() throws Exception {
|
||||
void testDoPut() throws Exception {
|
||||
HttpServletRequest mockReq = Mockito.mock(HttpServletRequest.class);
|
||||
HttpServletResponse mockResp = Mockito.mock(HttpServletResponse.class);
|
||||
StringWriter stringWriter = new StringWriter();
|
||||
@@ -92,7 +92,7 @@ public class AppServletTest extends Mockito{
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDoDelete() throws Exception {
|
||||
void testDoDelete() throws Exception {
|
||||
HttpServletRequest mockReq = Mockito.mock(HttpServletRequest.class);
|
||||
HttpServletResponse mockResp = Mockito.mock(HttpServletResponse.class);
|
||||
StringWriter stringWriter = new StringWriter();
|
||||
|
||||
@@ -30,9 +30,9 @@ import org.mockito.Mockito;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
public class JavaBeansTest {
|
||||
class JavaBeansTest {
|
||||
@Test
|
||||
public void testDefaultConstructor() {
|
||||
void testDefaultConstructor() {
|
||||
ClientPropertiesBean newBean = new ClientPropertiesBean();
|
||||
assertEquals("DEFAULT_NAME", newBean.getName());
|
||||
assertTrue(newBean.isBusinessInterest());
|
||||
@@ -43,7 +43,7 @@ public class JavaBeansTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testNameGetterSetter() {
|
||||
void testNameGetterSetter() {
|
||||
ClientPropertiesBean newBean = new ClientPropertiesBean();
|
||||
assertEquals("DEFAULT_NAME", newBean.getName());
|
||||
newBean.setName("TEST_NAME_ONE");
|
||||
@@ -51,7 +51,7 @@ public class JavaBeansTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testBusinessSetterGetter() {
|
||||
void testBusinessSetterGetter() {
|
||||
ClientPropertiesBean newBean = new ClientPropertiesBean();
|
||||
assertTrue(newBean.isBusinessInterest());
|
||||
newBean.setBusinessInterest(false);
|
||||
@@ -59,7 +59,7 @@ public class JavaBeansTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testScienceSetterGetter() {
|
||||
void testScienceSetterGetter() {
|
||||
ClientPropertiesBean newBean = new ClientPropertiesBean();
|
||||
assertTrue(newBean.isScienceNewsInterest());
|
||||
newBean.setScienceNewsInterest(false);
|
||||
@@ -67,7 +67,7 @@ public class JavaBeansTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSportsSetterGetter() {
|
||||
void testSportsSetterGetter() {
|
||||
ClientPropertiesBean newBean = new ClientPropertiesBean();
|
||||
assertTrue(newBean.isSportsInterest());
|
||||
newBean.setSportsInterest(false);
|
||||
@@ -75,7 +75,7 @@ public class JavaBeansTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testWorldSetterGetter() {
|
||||
void testWorldSetterGetter() {
|
||||
ClientPropertiesBean newBean = new ClientPropertiesBean();
|
||||
assertTrue(newBean.isWorldNewsInterest());
|
||||
newBean.setWorldNewsInterest(false);
|
||||
@@ -83,7 +83,7 @@ public class JavaBeansTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRequestConstructor(){
|
||||
void testRequestConstructor(){
|
||||
HttpServletRequest mockReq = Mockito.mock(HttpServletRequest.class);
|
||||
ClientPropertiesBean newBean = new ClientPropertiesBean((mockReq));
|
||||
assertEquals("DEFAULT_NAME", newBean.getName());
|
||||
|
||||
@@ -70,7 +70,7 @@ class DbCustomerDaoTest {
|
||||
* Represents the scenario where DB connectivity is present.
|
||||
*/
|
||||
@Nested
|
||||
public class ConnectionSuccess {
|
||||
class ConnectionSuccess {
|
||||
|
||||
/**
|
||||
* Setup for connection success scenario.
|
||||
@@ -78,7 +78,7 @@ class DbCustomerDaoTest {
|
||||
* @throws Exception if any error occurs.
|
||||
*/
|
||||
@BeforeEach
|
||||
public void setUp() throws Exception {
|
||||
void setUp() throws Exception {
|
||||
var dataSource = new JdbcDataSource();
|
||||
dataSource.setURL(DB_URL);
|
||||
dao = new DbCustomerDao(dataSource);
|
||||
@@ -191,7 +191,7 @@ class DbCustomerDaoTest {
|
||||
* @throws SQLException if any error occurs.
|
||||
*/
|
||||
@BeforeEach
|
||||
public void setUp() throws SQLException {
|
||||
void setUp() throws SQLException {
|
||||
dao = new DbCustomerDao(mockedDatasource());
|
||||
}
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ import org.junit.jupiter.api.Test;
|
||||
*
|
||||
* @author Jeroen Meulemeester
|
||||
*/
|
||||
public class ContentTest {
|
||||
class ContentTest {
|
||||
|
||||
@Test
|
||||
void testToString() {
|
||||
|
||||
@@ -34,7 +34,7 @@ import org.junit.jupiter.api.Test;
|
||||
*
|
||||
* @author Jeroen Meulemeester
|
||||
*/
|
||||
public class MenuItemTest {
|
||||
class MenuItemTest {
|
||||
|
||||
@Test
|
||||
void testToString() {
|
||||
|
||||
@@ -49,7 +49,7 @@ import org.mockito.ArgumentCaptor;
|
||||
*
|
||||
* @author Jeroen Meulemeester
|
||||
*/
|
||||
public class DispatcherTest {
|
||||
class DispatcherTest {
|
||||
|
||||
/**
|
||||
* Dispatcher is a singleton with no way to reset it's internal state back to the beginning.
|
||||
@@ -57,7 +57,7 @@ public class DispatcherTest {
|
||||
* influence on each other.
|
||||
*/
|
||||
@BeforeEach
|
||||
public void setUp() throws Exception {
|
||||
void setUp() throws Exception {
|
||||
final var constructor = Dispatcher.class.getDeclaredConstructor();
|
||||
constructor.setAccessible(true);
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ import org.junit.jupiter.api.Test;
|
||||
*
|
||||
* @author Jeroen Meulemeester
|
||||
*/
|
||||
public class ContentStoreTest {
|
||||
class ContentStoreTest {
|
||||
|
||||
@Test
|
||||
void testOnAction() {
|
||||
|
||||
@@ -44,7 +44,7 @@ import org.junit.jupiter.api.Test;
|
||||
*
|
||||
* @author Jeroen Meulemeester
|
||||
*/
|
||||
public class MenuStoreTest {
|
||||
class MenuStoreTest {
|
||||
|
||||
@Test
|
||||
void testOnAction() {
|
||||
|
||||
@@ -39,7 +39,7 @@ import org.junit.jupiter.api.Test;
|
||||
*
|
||||
* @author Jeroen Meulemeester
|
||||
*/
|
||||
public class ContentViewTest {
|
||||
class ContentViewTest {
|
||||
|
||||
@Test
|
||||
void testStoreChanged() {
|
||||
|
||||
@@ -43,7 +43,7 @@ import org.junit.jupiter.api.Test;
|
||||
*
|
||||
* @author Jeroen Meulemeester
|
||||
*/
|
||||
public class MenuViewTest {
|
||||
class MenuViewTest {
|
||||
|
||||
@Test
|
||||
void testStoreChanged() {
|
||||
|
||||
@@ -35,7 +35,7 @@ import org.junit.jupiter.api.Test;
|
||||
*
|
||||
* @author Jeroen Meulemeester
|
||||
*/
|
||||
public class AlchemistShopTest {
|
||||
class AlchemistShopTest {
|
||||
|
||||
@Test
|
||||
void testShop() {
|
||||
|
||||
+1
-1
@@ -33,7 +33,7 @@ import org.junit.jupiter.api.Test;
|
||||
*
|
||||
* @author Jeroen Meulemeester
|
||||
*/
|
||||
public class ApplicationExceptionTest {
|
||||
class ApplicationExceptionTest {
|
||||
|
||||
@Test
|
||||
void testCause() {
|
||||
|
||||
@@ -38,17 +38,17 @@ import org.junit.jupiter.params.provider.MethodSource;
|
||||
*
|
||||
* @author Jeroen Meulemeester
|
||||
*/
|
||||
public class CommandTest {
|
||||
class CommandTest {
|
||||
|
||||
private InMemoryAppender appender;
|
||||
|
||||
@BeforeEach
|
||||
public void setUp() {
|
||||
void setUp() {
|
||||
appender = new InMemoryAppender();
|
||||
}
|
||||
|
||||
@AfterEach
|
||||
public void tearDown() {
|
||||
void tearDown() {
|
||||
appender.stop();
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@ public class CommandTest {
|
||||
*/
|
||||
@ParameterizedTest
|
||||
@MethodSource("dataProvider")
|
||||
public void testDisplay(String request, String displayMessage) {
|
||||
void testDisplay(String request, String displayMessage) {
|
||||
final var frontController = new FrontController();
|
||||
assertEquals(0, appender.getLogSize());
|
||||
frontController.handleRequest(request);
|
||||
|
||||
+4
-4
@@ -38,17 +38,17 @@ import org.junit.jupiter.params.provider.MethodSource;
|
||||
*
|
||||
* @author Jeroen Meulemeester
|
||||
*/
|
||||
public class FrontControllerTest {
|
||||
class FrontControllerTest {
|
||||
|
||||
private InMemoryAppender appender;
|
||||
|
||||
@BeforeEach
|
||||
public void setUp() {
|
||||
void setUp() {
|
||||
appender = new InMemoryAppender();
|
||||
}
|
||||
|
||||
@AfterEach
|
||||
public void tearDown() {
|
||||
void tearDown() {
|
||||
appender.stop();
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@ public class FrontControllerTest {
|
||||
*/
|
||||
@ParameterizedTest
|
||||
@MethodSource("dataProvider")
|
||||
public void testDisplay(Command command, String displayMessage) {
|
||||
void testDisplay(Command command, String displayMessage) {
|
||||
assertEquals(0, appender.getLogSize());
|
||||
command.process();
|
||||
assertEquals(displayMessage, appender.getLastMessage());
|
||||
|
||||
@@ -38,17 +38,17 @@ import org.junit.jupiter.params.provider.MethodSource;
|
||||
*
|
||||
* @author Jeroen Meulemeester
|
||||
*/
|
||||
public class ViewTest {
|
||||
class ViewTest {
|
||||
|
||||
private InMemoryAppender appender;
|
||||
|
||||
@BeforeEach
|
||||
public void setUp() {
|
||||
void setUp() {
|
||||
appender = new InMemoryAppender();
|
||||
}
|
||||
|
||||
@AfterEach
|
||||
public void tearDown() {
|
||||
void tearDown() {
|
||||
appender.stop();
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@ public class ViewTest {
|
||||
*/
|
||||
@ParameterizedTest
|
||||
@MethodSource("dataProvider")
|
||||
public void testDisplay(View view, String displayMessage) {
|
||||
void testDisplay(View view, String displayMessage) {
|
||||
assertEquals(0, appender.getLogSize());
|
||||
view.display();
|
||||
assertEquals(displayMessage, appender.getLastMessage());
|
||||
|
||||
@@ -31,7 +31,7 @@ import org.junit.jupiter.api.Test;
|
||||
/**
|
||||
* App unit test class.
|
||||
*/
|
||||
public class AppTest {
|
||||
class AppTest {
|
||||
|
||||
@Test
|
||||
void shouldExecuteApplicationWithoutException() {
|
||||
|
||||
@@ -33,17 +33,17 @@ import org.junit.jupiter.api.BeforeEach;
|
||||
/**
|
||||
* FixedStepGameLoop unit test class.
|
||||
*/
|
||||
public class FixedStepGameLoopTest {
|
||||
class FixedStepGameLoopTest {
|
||||
|
||||
private FixedStepGameLoop gameLoop;
|
||||
|
||||
@BeforeEach
|
||||
public void setup() {
|
||||
void setup() {
|
||||
gameLoop = new FixedStepGameLoop();
|
||||
}
|
||||
|
||||
@AfterEach
|
||||
public void tearDown() {
|
||||
void tearDown() {
|
||||
gameLoop = null;
|
||||
}
|
||||
|
||||
|
||||
@@ -35,12 +35,12 @@ class GameControllerTest {
|
||||
private GameController controller;
|
||||
|
||||
@BeforeEach
|
||||
public void setup() {
|
||||
void setup() {
|
||||
controller = new GameController();
|
||||
}
|
||||
|
||||
@AfterEach
|
||||
public void tearDown() {
|
||||
void tearDown() {
|
||||
controller = null;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -33,7 +33,7 @@ import org.junit.jupiter.api.Test;
|
||||
/**
|
||||
* Test for Guarded Queue
|
||||
*/
|
||||
public class GuardedQueueTest {
|
||||
class GuardedQueueTest {
|
||||
private volatile Integer value;
|
||||
|
||||
@Test
|
||||
|
||||
+2
-2
@@ -44,12 +44,12 @@ import org.junit.jupiter.api.Test;
|
||||
*
|
||||
* @author Jeroen Meulemeester
|
||||
*/
|
||||
public class AsynchronousServiceTest {
|
||||
class AsynchronousServiceTest {
|
||||
private AsynchronousService service;
|
||||
private AsyncTask<Object> task;
|
||||
|
||||
@BeforeEach
|
||||
public void setUp() {
|
||||
void setUp() {
|
||||
service = new AsynchronousService(new LinkedBlockingQueue<>());
|
||||
task = mock(AsyncTask.class);
|
||||
}
|
||||
|
||||
+1
-1
@@ -39,7 +39,7 @@ import org.junit.jupiter.api.Test;
|
||||
*
|
||||
* @author Jeroen Meulemeester
|
||||
*/
|
||||
public class FilterManagerTest {
|
||||
class FilterManagerTest {
|
||||
|
||||
@Test
|
||||
void testFilterRequest() {
|
||||
|
||||
@@ -38,7 +38,7 @@ import org.junit.jupiter.params.provider.MethodSource;
|
||||
*
|
||||
* @author Jeroen Meulemeester
|
||||
*/
|
||||
public class FilterTest {
|
||||
class FilterTest {
|
||||
|
||||
private static final Order PERFECT_ORDER =
|
||||
new Order("name", "12345678901", "addr", "dep", "order");
|
||||
@@ -89,7 +89,7 @@ public class FilterTest {
|
||||
|
||||
@ParameterizedTest
|
||||
@MethodSource("getTestData")
|
||||
public void testExecute(Filter filter, Order order, String expectedResult) {
|
||||
void testExecute(Filter filter, Order order, String expectedResult) {
|
||||
final var result = filter.execute(order);
|
||||
assertNotNull(result);
|
||||
assertEquals(expectedResult, result.trim());
|
||||
@@ -97,7 +97,7 @@ public class FilterTest {
|
||||
|
||||
@ParameterizedTest
|
||||
@MethodSource("getTestData")
|
||||
public void testNext(Filter filter) {
|
||||
void testNext(Filter filter) {
|
||||
assertNull(filter.getNext());
|
||||
assertSame(filter, filter.getLast());
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ import org.junit.jupiter.api.Test;
|
||||
*
|
||||
* @author Jeroen Meulemeester
|
||||
*/
|
||||
public class OrderTest {
|
||||
class OrderTest {
|
||||
|
||||
private static final String EXPECTED_VALUE = "test";
|
||||
|
||||
|
||||
@@ -102,7 +102,7 @@ public abstract class ExpressionTest<E extends Expression> {
|
||||
*/
|
||||
@ParameterizedTest
|
||||
@MethodSource("expressionProvider")
|
||||
public void testInterpret(NumberExpression first, NumberExpression second, int result) {
|
||||
void testInterpret(NumberExpression first, NumberExpression second, int result) {
|
||||
final var expression = factory.apply(first, second);
|
||||
assertNotNull(expression);
|
||||
assertEquals(result, expression.interpret());
|
||||
@@ -113,7 +113,7 @@ public abstract class ExpressionTest<E extends Expression> {
|
||||
*/
|
||||
@ParameterizedTest
|
||||
@MethodSource("expressionProvider")
|
||||
public void testToString(NumberExpression first, NumberExpression second) {
|
||||
void testToString(NumberExpression first, NumberExpression second) {
|
||||
final var expression = factory.apply(first, second);
|
||||
assertNotNull(expression);
|
||||
assertEquals(expectedToString, expression.toString());
|
||||
|
||||
@@ -32,7 +32,7 @@ import org.junit.jupiter.params.provider.Arguments;
|
||||
*
|
||||
* @author Jeroen Meulemeester
|
||||
*/
|
||||
public class MinusExpressionTest extends ExpressionTest<MinusExpression> {
|
||||
class MinusExpressionTest extends ExpressionTest<MinusExpression> {
|
||||
|
||||
/**
|
||||
* Create a new set of test entries with the expected result
|
||||
|
||||
@@ -32,7 +32,7 @@ import org.junit.jupiter.params.provider.Arguments;
|
||||
*
|
||||
* @author Jeroen Meulemeester
|
||||
*/
|
||||
public class MultiplyExpressionTest extends ExpressionTest<MultiplyExpression> {
|
||||
class MultiplyExpressionTest extends ExpressionTest<MultiplyExpression> {
|
||||
|
||||
/**
|
||||
* Create a new set of test entries with the expected result
|
||||
|
||||
@@ -36,7 +36,7 @@ import org.junit.jupiter.params.provider.MethodSource;
|
||||
*
|
||||
* @author Jeroen Meulemeester
|
||||
*/
|
||||
public class NumberExpressionTest extends ExpressionTest<NumberExpression> {
|
||||
class NumberExpressionTest extends ExpressionTest<NumberExpression> {
|
||||
|
||||
/**
|
||||
* Create a new set of test entries with the expected result
|
||||
@@ -60,7 +60,7 @@ public class NumberExpressionTest extends ExpressionTest<NumberExpression> {
|
||||
*/
|
||||
@ParameterizedTest
|
||||
@MethodSource("expressionProvider")
|
||||
public void testFromString(NumberExpression first) throws Exception {
|
||||
void testFromString(NumberExpression first) throws Exception {
|
||||
final var expectedValue = first.interpret();
|
||||
final var testStringValue = String.valueOf(expectedValue);
|
||||
final var numberExpression = new NumberExpression(testStringValue);
|
||||
|
||||
@@ -32,7 +32,7 @@ import org.junit.jupiter.params.provider.Arguments;
|
||||
*
|
||||
* @author Jeroen Meulemeester
|
||||
*/
|
||||
public class PlusExpressionTest extends ExpressionTest<PlusExpression> {
|
||||
class PlusExpressionTest extends ExpressionTest<PlusExpression> {
|
||||
|
||||
/**
|
||||
* Create a new set of test entries with the expected result
|
||||
|
||||
@@ -37,7 +37,7 @@ import org.junit.jupiter.params.provider.MethodSource;
|
||||
*
|
||||
* @author Jeroen Meulemeester
|
||||
*/
|
||||
public class TreasureChestTest {
|
||||
class TreasureChestTest {
|
||||
|
||||
/**
|
||||
* Create a list of all expected items in the chest.
|
||||
@@ -65,7 +65,7 @@ public class TreasureChestTest {
|
||||
*/
|
||||
@ParameterizedTest
|
||||
@MethodSource("dataProvider")
|
||||
public void testIterator(Item expectedItem) {
|
||||
void testIterator(Item expectedItem) {
|
||||
final var chest = new TreasureChest();
|
||||
final var iterator = chest.iterator(expectedItem.getType());
|
||||
assertNotNull(iterator);
|
||||
@@ -92,7 +92,7 @@ public class TreasureChestTest {
|
||||
*/
|
||||
@ParameterizedTest
|
||||
@MethodSource("dataProvider")
|
||||
public void testGetItems(Item expectedItem) throws Exception {
|
||||
void testGetItems(Item expectedItem) throws Exception {
|
||||
final var chest = new TreasureChest();
|
||||
final var items = chest.getItems();
|
||||
assertNotNull(items);
|
||||
|
||||
@@ -38,7 +38,7 @@ import org.junit.jupiter.api.Test;
|
||||
*
|
||||
* @author Jeroen Meulemeester
|
||||
*/
|
||||
public class CakeTest {
|
||||
class CakeTest {
|
||||
|
||||
@Test
|
||||
void testSetId() {
|
||||
|
||||
@@ -34,7 +34,7 @@ import org.junit.jupiter.api.Test;
|
||||
*
|
||||
* @author Jeroen Meulemeester
|
||||
*/
|
||||
public class CakeBakingExceptionTest {
|
||||
class CakeBakingExceptionTest {
|
||||
|
||||
@Test
|
||||
void testConstructor() {
|
||||
|
||||
@@ -43,7 +43,7 @@ import org.junit.jupiter.api.Test;
|
||||
*
|
||||
* @author Jeroen Meulemeester
|
||||
*/
|
||||
public class CakeBakingServiceImplTest {
|
||||
class CakeBakingServiceImplTest {
|
||||
|
||||
@Test
|
||||
void testLayers() {
|
||||
|
||||
@@ -47,17 +47,17 @@ import org.slf4j.LoggerFactory;
|
||||
*
|
||||
* @author Jeroen Meulemeester
|
||||
*/
|
||||
public class CakeViewImplTest {
|
||||
class CakeViewImplTest {
|
||||
|
||||
private InMemoryAppender appender;
|
||||
|
||||
@BeforeEach
|
||||
public void setUp() {
|
||||
void setUp() {
|
||||
appender = new InMemoryAppender(CakeViewImpl.class);
|
||||
}
|
||||
|
||||
@AfterEach
|
||||
public void tearDown() {
|
||||
void tearDown() {
|
||||
appender.stop();
|
||||
}
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ import java.lang.reflect.Field;
|
||||
*
|
||||
* @author Jeroen Meulemeester
|
||||
*/
|
||||
public class HolderNaiveTest extends AbstractHolderTest {
|
||||
class HolderNaiveTest extends AbstractHolderTest {
|
||||
|
||||
private final HolderNaive holder = new HolderNaive();
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ import java.lang.reflect.Field;
|
||||
*
|
||||
* @author Jeroen Meulemeester
|
||||
*/
|
||||
public class HolderThreadSafeTest extends AbstractHolderTest {
|
||||
class HolderThreadSafeTest extends AbstractHolderTest {
|
||||
|
||||
private final HolderThreadSafe holder = new HolderThreadSafe();
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ import java.util.function.Supplier;
|
||||
*
|
||||
* @author Jeroen Meulemeester
|
||||
*/
|
||||
public class Java8HolderTest extends AbstractHolderTest {
|
||||
class Java8HolderTest extends AbstractHolderTest {
|
||||
|
||||
private final Java8Holder holder = new Java8Holder();
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ import org.junit.jupiter.api.Test;
|
||||
/**
|
||||
* Message test case.
|
||||
*/
|
||||
public class MessageTest {
|
||||
class MessageTest {
|
||||
|
||||
@Test
|
||||
void testGetType() {
|
||||
|
||||
+1
-1
@@ -39,7 +39,7 @@ import org.junit.jupiter.api.Test;
|
||||
/**
|
||||
* BullyMessageManager unit test.
|
||||
*/
|
||||
public class BullyMessageManagerTest {
|
||||
class BullyMessageManagerTest {
|
||||
|
||||
@Test
|
||||
void testSendHeartbeatMessage() {
|
||||
|
||||
+1
-1
@@ -37,7 +37,7 @@ import org.junit.jupiter.api.Test;
|
||||
/**
|
||||
* BullyInstance unit test.
|
||||
*/
|
||||
public class BullyinstanceTest {
|
||||
class BullyinstanceTest {
|
||||
|
||||
@Test
|
||||
void testOnMessage() {
|
||||
|
||||
+1
-1
@@ -37,7 +37,7 @@ import org.junit.jupiter.api.Test;
|
||||
/**
|
||||
* RingInstance unit test.
|
||||
*/
|
||||
public class RingInstanceTest {
|
||||
class RingInstanceTest {
|
||||
|
||||
@Test
|
||||
void testOnMessage() {
|
||||
|
||||
+1
-1
@@ -39,7 +39,7 @@ import org.junit.jupiter.api.Test;
|
||||
/**
|
||||
* RingMessageManager unit test.
|
||||
*/
|
||||
public class RingMessageManagerTest {
|
||||
class RingMessageManagerTest {
|
||||
|
||||
@Test
|
||||
void testSendHeartbeatMessage() {
|
||||
|
||||
@@ -31,7 +31,7 @@ import org.junit.jupiter.api.Test;
|
||||
/**
|
||||
* Thief test
|
||||
*/
|
||||
public class ThiefTest {
|
||||
class ThiefTest {
|
||||
@Test
|
||||
void testThief() {
|
||||
var thief = new Thief();
|
||||
|
||||
@@ -36,7 +36,7 @@ import org.junit.jupiter.api.Test;
|
||||
*
|
||||
* @author Jeroen Meulemeester
|
||||
*/
|
||||
public class PartyImplTest {
|
||||
class PartyImplTest {
|
||||
|
||||
/**
|
||||
* Verify if a member is notified when it's joining a party. Generate an action and see if the
|
||||
|
||||
@@ -47,7 +47,7 @@ import org.slf4j.LoggerFactory;
|
||||
*
|
||||
* @author Jeroen Meulemeester
|
||||
*/
|
||||
public class PartyMemberTest {
|
||||
class PartyMemberTest {
|
||||
|
||||
static Stream<Arguments> dataProvider() {
|
||||
return Stream.of(
|
||||
@@ -61,12 +61,12 @@ public class PartyMemberTest {
|
||||
private InMemoryAppender appender;
|
||||
|
||||
@BeforeEach
|
||||
public void setUp() {
|
||||
void setUp() {
|
||||
appender = new InMemoryAppender(PartyMemberBase.class);
|
||||
}
|
||||
|
||||
@AfterEach
|
||||
public void tearDown() {
|
||||
void tearDown() {
|
||||
appender.stop();
|
||||
}
|
||||
|
||||
@@ -75,7 +75,7 @@ public class PartyMemberTest {
|
||||
*/
|
||||
@ParameterizedTest
|
||||
@MethodSource("dataProvider")
|
||||
public void testPartyAction(Supplier<PartyMember> memberSupplier) {
|
||||
void testPartyAction(Supplier<PartyMember> memberSupplier) {
|
||||
final var member = memberSupplier.get();
|
||||
|
||||
for (final var action : Action.values()) {
|
||||
@@ -91,7 +91,7 @@ public class PartyMemberTest {
|
||||
*/
|
||||
@ParameterizedTest
|
||||
@MethodSource("dataProvider")
|
||||
public void testAct(Supplier<PartyMember> memberSupplier) {
|
||||
void testAct(Supplier<PartyMember> memberSupplier) {
|
||||
final var member = memberSupplier.get();
|
||||
|
||||
member.act(Action.GOLD);
|
||||
@@ -115,7 +115,7 @@ public class PartyMemberTest {
|
||||
*/
|
||||
@ParameterizedTest
|
||||
@MethodSource("dataProvider")
|
||||
public void testToString(Supplier<PartyMember> memberSupplier) {
|
||||
void testToString(Supplier<PartyMember> memberSupplier) {
|
||||
final var member = memberSupplier.get();
|
||||
final var memberClass = member.getClass();
|
||||
assertEquals(memberClass.getSimpleName(), member.toString());
|
||||
|
||||
@@ -33,7 +33,7 @@ import org.junit.jupiter.api.Test;
|
||||
*
|
||||
* @author Jeroen Meulemeester
|
||||
*/
|
||||
public class StarTest {
|
||||
class StarTest {
|
||||
|
||||
/**
|
||||
* Verify the stages of a dying sun, without going back in time
|
||||
|
||||
+1
-1
@@ -36,7 +36,7 @@ import org.junit.jupiter.api.Test;
|
||||
*
|
||||
* @author Jeroen Meulemeester
|
||||
*/
|
||||
public class GiantControllerTest {
|
||||
class GiantControllerTest {
|
||||
|
||||
/**
|
||||
* Verify if the controller passes the health level through to the model and vice versa
|
||||
|
||||
+1
-1
@@ -33,7 +33,7 @@ import org.junit.jupiter.api.Test;
|
||||
*
|
||||
* @author Jeroen Meulemeester
|
||||
*/
|
||||
public class GiantModelTest {
|
||||
class GiantModelTest {
|
||||
|
||||
/**
|
||||
* Verify if the health value is set properly though the constructor and setter
|
||||
|
||||
+3
-3
@@ -42,17 +42,17 @@ import org.slf4j.LoggerFactory;
|
||||
*
|
||||
* @author Jeroen Meulemeester
|
||||
*/
|
||||
public class GiantViewTest {
|
||||
class GiantViewTest {
|
||||
|
||||
private InMemoryAppender appender;
|
||||
|
||||
@BeforeEach
|
||||
public void setUp() {
|
||||
void setUp() {
|
||||
appender = new InMemoryAppender(GiantView.class);
|
||||
}
|
||||
|
||||
@AfterEach
|
||||
public void tearDown() {
|
||||
void tearDown() {
|
||||
appender.stop();
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -33,7 +33,7 @@ import org.junit.jupiter.api.Test;
|
||||
*
|
||||
* @author Jeroen Meulemeester
|
||||
*/
|
||||
public class FileLoaderTest {
|
||||
class FileLoaderTest {
|
||||
|
||||
@Test
|
||||
void testLoadData() {
|
||||
|
||||
+2
-2
@@ -36,7 +36,7 @@ import org.junit.jupiter.api.Test;
|
||||
* This test case is responsible for testing our application by taking advantage of the
|
||||
* Model-View-Controller architectural pattern.
|
||||
*/
|
||||
public class FileSelectorPresenterTest {
|
||||
class FileSelectorPresenterTest {
|
||||
|
||||
/**
|
||||
* The Presenter component.
|
||||
@@ -57,7 +57,7 @@ public class FileSelectorPresenterTest {
|
||||
* Initializes the components of the test case.
|
||||
*/
|
||||
@BeforeEach
|
||||
public void setUp() {
|
||||
void setUp() {
|
||||
this.stub = new FileSelectorStub();
|
||||
this.loader = new FileLoader();
|
||||
presenter = new FileSelectorPresenter(this.stub);
|
||||
|
||||
@@ -33,7 +33,7 @@ import org.junit.jupiter.api.Test;
|
||||
/**
|
||||
* Test for Monad Pattern
|
||||
*/
|
||||
public class MonadTest {
|
||||
class MonadTest {
|
||||
|
||||
@Test
|
||||
void testForInvalidName() {
|
||||
|
||||
@@ -30,7 +30,7 @@ import org.junit.jupiter.api.Test;
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
import static org.junit.jupiter.api.Assumptions.*;
|
||||
|
||||
public class BankTest {
|
||||
class BankTest {
|
||||
|
||||
private static final int ACCOUNT_NUM = 4;
|
||||
private static final int BASE_AMOUNT = 1000;
|
||||
|
||||
@@ -41,7 +41,7 @@ import org.junit.jupiter.api.Test;
|
||||
*
|
||||
* @author Jeroen Meulemeester
|
||||
*/
|
||||
public class LoadBalancerTest {
|
||||
class LoadBalancerTest {
|
||||
|
||||
@Test
|
||||
void testSameStateAmongstAllInstances() {
|
||||
|
||||
@@ -35,7 +35,7 @@ import org.junit.jupiter.api.Test;
|
||||
*
|
||||
* @author Jeroen Meulemeester
|
||||
*/
|
||||
public class NazgulTest {
|
||||
class NazgulTest {
|
||||
|
||||
/**
|
||||
* Verify if {@link Nazgul#getInstance(NazgulName)} returns the correct Nazgul multiton instance
|
||||
|
||||
@@ -33,17 +33,17 @@ import org.junit.Test;
|
||||
/**
|
||||
* Test for SimpleObject
|
||||
*/
|
||||
public class SimpleObjectTest {
|
||||
class SimpleObjectTest {
|
||||
|
||||
SimpleObject simpleObject;
|
||||
|
||||
@Before
|
||||
public void setUp() {
|
||||
void setUp() {
|
||||
simpleObject = new SimpleObject();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testName() {
|
||||
void testName() {
|
||||
// given
|
||||
String name = "Foobar";
|
||||
assertNull(simpleObject.getName());
|
||||
|
||||
@@ -41,7 +41,7 @@ import org.junit.Test;
|
||||
/**
|
||||
* Test for SimpleObjects
|
||||
*/
|
||||
public class SimpleObjectsTest {
|
||||
class SimpleObjectsTest {
|
||||
|
||||
@Rule
|
||||
public JUnitRuleMockery2 context = JUnitRuleMockery2.createFor(Mode.INTERFACES_AND_CLASSES);
|
||||
@@ -52,13 +52,13 @@ public class SimpleObjectsTest {
|
||||
SimpleObjects simpleObjects;
|
||||
|
||||
@Before
|
||||
public void setUp() {
|
||||
void setUp() {
|
||||
simpleObjects = new SimpleObjects();
|
||||
simpleObjects.container = mockContainer;
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCreate() {
|
||||
void testCreate() {
|
||||
|
||||
// given
|
||||
final SimpleObject simpleObject = new SimpleObject();
|
||||
@@ -85,7 +85,7 @@ public class SimpleObjectsTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testListAll() {
|
||||
void testListAll() {
|
||||
|
||||
// given
|
||||
final List<SimpleObject> all = Lists.newArrayList();
|
||||
|
||||
@@ -44,17 +44,17 @@ import org.slf4j.LoggerFactory;
|
||||
*
|
||||
* @author Jeroen Meulemeester
|
||||
*/
|
||||
public class TreeTest {
|
||||
class TreeTest {
|
||||
|
||||
private InMemoryAppender appender;
|
||||
|
||||
@BeforeEach
|
||||
public void setUp() {
|
||||
void setUp() {
|
||||
appender = new InMemoryAppender();
|
||||
}
|
||||
|
||||
@AfterEach
|
||||
public void tearDown() {
|
||||
void tearDown() {
|
||||
appender.stop();
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -36,7 +36,7 @@ import org.junit.jupiter.api.Test;
|
||||
/**
|
||||
* Test Generation of Royalty Types using the object-mother
|
||||
*/
|
||||
public class RoyaltyObjectMotherTest {
|
||||
class RoyaltyObjectMotherTest {
|
||||
|
||||
@Test
|
||||
void unsuccessfulKingFlirt() {
|
||||
|
||||
@@ -32,7 +32,7 @@ import java.util.List;
|
||||
*
|
||||
* @author Jeroen Meulemeester
|
||||
*/
|
||||
public class HobbitsTest extends WeatherObserverTest<Hobbits> {
|
||||
class HobbitsTest extends WeatherObserverTest<Hobbits> {
|
||||
|
||||
@Override
|
||||
public Collection<Object[]> dataProvider() {
|
||||
|
||||
@@ -32,7 +32,7 @@ import java.util.List;
|
||||
*
|
||||
* @author Jeroen Meulemeester
|
||||
*/
|
||||
public class OrcsTest extends WeatherObserverTest<Orcs> {
|
||||
class OrcsTest extends WeatherObserverTest<Orcs> {
|
||||
|
||||
@Override
|
||||
public Collection<Object[]> dataProvider() {
|
||||
|
||||
@@ -50,12 +50,12 @@ public abstract class WeatherObserverTest<O extends WeatherObserver> {
|
||||
private InMemoryAppender appender;
|
||||
|
||||
@BeforeEach
|
||||
public void setUp() {
|
||||
void setUp() {
|
||||
appender = new InMemoryAppender();
|
||||
}
|
||||
|
||||
@AfterEach
|
||||
public void tearDown() {
|
||||
void tearDown() {
|
||||
appender.stop();
|
||||
}
|
||||
|
||||
@@ -80,7 +80,7 @@ public abstract class WeatherObserverTest<O extends WeatherObserver> {
|
||||
*/
|
||||
@ParameterizedTest
|
||||
@MethodSource("dataProvider")
|
||||
public void testObserver(WeatherType weather, String response) {
|
||||
void testObserver(WeatherType weather, String response) {
|
||||
final var observer = this.factory.get();
|
||||
assertEquals(0, appender.getLogSize());
|
||||
|
||||
|
||||
@@ -41,17 +41,17 @@ import org.junit.jupiter.api.Test;
|
||||
*
|
||||
* @author Jeroen Meulemeester
|
||||
*/
|
||||
public class WeatherTest {
|
||||
class WeatherTest {
|
||||
|
||||
private InMemoryAppender appender;
|
||||
|
||||
@BeforeEach
|
||||
public void setUp() {
|
||||
void setUp() {
|
||||
appender = new InMemoryAppender(Weather.class);
|
||||
}
|
||||
|
||||
@AfterEach
|
||||
public void tearDown() {
|
||||
void tearDown() {
|
||||
appender.stop();
|
||||
}
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ import java.util.List;
|
||||
*
|
||||
* @author Jeroen Meulemeester
|
||||
*/
|
||||
public class GHobbitsTest extends ObserverTest<GHobbits> {
|
||||
class GHobbitsTest extends ObserverTest<GHobbits> {
|
||||
|
||||
@Override
|
||||
public Collection<Object[]> dataProvider() {
|
||||
|
||||
@@ -43,17 +43,17 @@ import org.junit.jupiter.api.Test;
|
||||
*
|
||||
* @author Jeroen Meulemeester
|
||||
*/
|
||||
public class GWeatherTest {
|
||||
class GWeatherTest {
|
||||
|
||||
private InMemoryAppender appender;
|
||||
|
||||
@BeforeEach
|
||||
public void setUp() {
|
||||
void setUp() {
|
||||
appender = new InMemoryAppender(GWeather.class);
|
||||
}
|
||||
|
||||
@AfterEach
|
||||
public void tearDown() {
|
||||
void tearDown() {
|
||||
appender.stop();
|
||||
}
|
||||
|
||||
|
||||
@@ -49,12 +49,12 @@ public abstract class ObserverTest<O extends Observer<?, ?, WeatherType>> {
|
||||
private InMemoryAppender appender;
|
||||
|
||||
@BeforeEach
|
||||
public void setUp() {
|
||||
void setUp() {
|
||||
appender = new InMemoryAppender();
|
||||
}
|
||||
|
||||
@AfterEach
|
||||
public void tearDown() {
|
||||
void tearDown() {
|
||||
appender.stop();
|
||||
}
|
||||
|
||||
@@ -79,7 +79,7 @@ public abstract class ObserverTest<O extends Observer<?, ?, WeatherType>> {
|
||||
*/
|
||||
@ParameterizedTest
|
||||
@MethodSource("dataProvider")
|
||||
public void testObserver(WeatherType weather, String response) {
|
||||
void testObserver(WeatherType weather, String response) {
|
||||
final var observer = this.factory.get();
|
||||
assertEquals(0, appender.getLogSize());
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ import java.util.List;
|
||||
*
|
||||
* @author Jeroen Meulemeester
|
||||
*/
|
||||
public class OrcsTest extends ObserverTest<GOrcs> {
|
||||
class OrcsTest extends ObserverTest<GOrcs> {
|
||||
|
||||
@Override
|
||||
public Collection<Object[]> dataProvider() {
|
||||
|
||||
@@ -34,12 +34,12 @@ import org.junit.jupiter.api.Test;
|
||||
/**
|
||||
* Test Album Selection and Album Listing
|
||||
*/
|
||||
public class AlbumListPageTest {
|
||||
class AlbumListPageTest {
|
||||
|
||||
private final AlbumListPage albumListPage = new AlbumListPage(new WebClient());
|
||||
|
||||
@BeforeEach
|
||||
public void setUp() {
|
||||
void setUp() {
|
||||
albumListPage.navigateToPage();
|
||||
}
|
||||
|
||||
|
||||
@@ -34,12 +34,12 @@ import org.junit.jupiter.api.Test;
|
||||
/**
|
||||
* Test Album Page Operations
|
||||
*/
|
||||
public class AlbumPageTest {
|
||||
class AlbumPageTest {
|
||||
|
||||
private final AlbumPage albumPage = new AlbumPage(new WebClient());
|
||||
|
||||
@BeforeEach
|
||||
public void setUp() {
|
||||
void setUp() {
|
||||
albumPage.navigateToPage();
|
||||
}
|
||||
|
||||
|
||||
@@ -34,12 +34,12 @@ import org.junit.jupiter.api.Test;
|
||||
/**
|
||||
* Test Login Page Object
|
||||
*/
|
||||
public class LoginPageTest {
|
||||
class LoginPageTest {
|
||||
|
||||
private final LoginPage loginPage = new LoginPage(new WebClient());
|
||||
|
||||
@BeforeEach
|
||||
public void setUp() {
|
||||
void setUp() {
|
||||
loginPage.navigateToPage();
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -33,12 +33,12 @@ import org.junit.jupiter.api.Test;
|
||||
/**
|
||||
* Test Album Selection and Album Listing
|
||||
*/
|
||||
public class AlbumListPageTest {
|
||||
class AlbumListPageTest {
|
||||
|
||||
private final AlbumListPage albumListPage = new AlbumListPage(new WebClient());
|
||||
|
||||
@BeforeEach
|
||||
public void setUp() {
|
||||
void setUp() {
|
||||
albumListPage.navigateToPage();
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -33,12 +33,12 @@ import org.junit.jupiter.api.Test;
|
||||
/**
|
||||
* Test Album Page Operations
|
||||
*/
|
||||
public class AlbumPageTest {
|
||||
class AlbumPageTest {
|
||||
|
||||
private final AlbumPage albumPage = new AlbumPage(new WebClient());
|
||||
|
||||
@BeforeEach
|
||||
public void setUp() {
|
||||
void setUp() {
|
||||
albumPage.navigateToPage();
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -33,12 +33,12 @@ import org.junit.jupiter.api.Test;
|
||||
/**
|
||||
* Test Login Page Object
|
||||
*/
|
||||
public class LoginPageTest {
|
||||
class LoginPageTest {
|
||||
|
||||
private final LoginPage loginPage = new LoginPage(new WebClient());
|
||||
|
||||
@BeforeEach
|
||||
public void setUp() {
|
||||
void setUp() {
|
||||
loginPage.navigateToPage();
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -35,7 +35,7 @@ class ParameterObjectTest {
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(ParameterObjectTest.class);
|
||||
|
||||
@Test
|
||||
public void testForDefaultSortBy() {
|
||||
void testForDefaultSortBy() {
|
||||
//Creating parameter object with default value for SortBy set
|
||||
ParameterObject params = ParameterObject.newBuilder()
|
||||
.withType("sneakers")
|
||||
@@ -49,7 +49,7 @@ class ParameterObjectTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testForDefaultSortOrder() {
|
||||
void testForDefaultSortOrder() {
|
||||
//Creating parameter object with default value for SortOrder set
|
||||
ParameterObject params = ParameterObject.newBuilder()
|
||||
.withType("sneakers")
|
||||
|
||||
@@ -37,7 +37,7 @@ class SearchServiceTest {
|
||||
private SearchService searchService;
|
||||
|
||||
@BeforeEach
|
||||
public void setUp() {
|
||||
void setUp() {
|
||||
//Creating parameter object with default values set
|
||||
parameterObject = ParameterObject.newBuilder()
|
||||
.withType("sneakers")
|
||||
@@ -50,7 +50,7 @@ class SearchServiceTest {
|
||||
* Testing parameter object against the overloaded method to verify if the behaviour is same.
|
||||
*/
|
||||
@Test
|
||||
public void testDefaultParametersMatch() {
|
||||
void testDefaultParametersMatch() {
|
||||
assertEquals(searchService.search(parameterObject), searchService.search("sneakers",
|
||||
SortOrder.ASC), "Default Parameter values do not not match.");
|
||||
LOGGER.info("SortBy Default parameter value matches.");
|
||||
|
||||
@@ -31,7 +31,7 @@ import org.junit.jupiter.api.Test;
|
||||
/**
|
||||
* Test for {@link Pipeline}
|
||||
*/
|
||||
public class PipelineTest {
|
||||
class PipelineTest {
|
||||
|
||||
@Test
|
||||
void testAddHandlersToPipeline() {
|
||||
|
||||
@@ -42,17 +42,17 @@ import org.slf4j.LoggerFactory;
|
||||
*
|
||||
* @author Jeroen Meulemeester
|
||||
*/
|
||||
public class ConsumerTest {
|
||||
class ConsumerTest {
|
||||
|
||||
private InMemoryAppender appender;
|
||||
|
||||
@BeforeEach
|
||||
public void setUp() {
|
||||
void setUp() {
|
||||
appender = new InMemoryAppender(Consumer.class);
|
||||
}
|
||||
|
||||
@AfterEach
|
||||
public void tearDown() {
|
||||
void tearDown() {
|
||||
appender.stop();
|
||||
}
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ import org.junit.jupiter.api.Test;
|
||||
*
|
||||
* @author Jeroen Meulemeester
|
||||
*/
|
||||
public class PoisonMessageTest {
|
||||
class PoisonMessageTest {
|
||||
|
||||
@Test
|
||||
void testAddHeader() {
|
||||
|
||||
@@ -41,7 +41,7 @@ import org.mockito.ArgumentCaptor;
|
||||
*
|
||||
* @author Jeroen Meulemeester
|
||||
*/
|
||||
public class ProducerTest {
|
||||
class ProducerTest {
|
||||
|
||||
@Test
|
||||
void testSend() throws Exception {
|
||||
|
||||
@@ -37,7 +37,7 @@ import org.junit.jupiter.api.Test;
|
||||
*
|
||||
* @author Jeroen Meulemeester
|
||||
*/
|
||||
public class SimpleMessageTest {
|
||||
class SimpleMessageTest {
|
||||
|
||||
@Test
|
||||
void testGetHeaders() {
|
||||
|
||||
+1
-1
@@ -32,7 +32,7 @@ import org.junit.jupiter.api.Test;
|
||||
/**
|
||||
* Test case for order of messages
|
||||
*/
|
||||
public class PriorityMessageQueueTest {
|
||||
class PriorityMessageQueueTest {
|
||||
|
||||
|
||||
@Test
|
||||
|
||||
@@ -31,7 +31,7 @@ import org.junit.jupiter.api.Test;
|
||||
/**
|
||||
* Check queue manager
|
||||
*/
|
||||
public class QueueManagerTest {
|
||||
class QueueManagerTest {
|
||||
|
||||
@Test
|
||||
void publishMessage() {
|
||||
|
||||
+3
-3
@@ -36,17 +36,17 @@ import org.junit.jupiter.api.Test;
|
||||
*
|
||||
* @author Jeroen Meulemeester
|
||||
*/
|
||||
public class ImmutableStewTest {
|
||||
class ImmutableStewTest {
|
||||
|
||||
private InMemoryAppender appender;
|
||||
|
||||
@BeforeEach
|
||||
public void setUp() {
|
||||
void setUp() {
|
||||
appender = new InMemoryAppender();
|
||||
}
|
||||
|
||||
@AfterEach
|
||||
public void tearDown() {
|
||||
void tearDown() {
|
||||
appender.stop();
|
||||
}
|
||||
|
||||
|
||||
@@ -36,17 +36,17 @@ import org.junit.jupiter.api.Test;
|
||||
*
|
||||
* @author Jeroen Meulemeester
|
||||
*/
|
||||
public class StewTest {
|
||||
class StewTest {
|
||||
|
||||
private InMemoryAppender appender;
|
||||
|
||||
@BeforeEach
|
||||
public void setUp() {
|
||||
void setUp() {
|
||||
appender = new InMemoryAppender();
|
||||
}
|
||||
|
||||
@AfterEach
|
||||
public void tearDown() {
|
||||
void tearDown() {
|
||||
appender.stop();
|
||||
}
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ import org.junit.jupiter.api.Test;
|
||||
*
|
||||
* @author Jeroen Meulemeester
|
||||
*/
|
||||
public class ConsumerTest {
|
||||
class ConsumerTest {
|
||||
|
||||
private static final int ITEM_COUNT = 5;
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ import org.junit.jupiter.api.Test;
|
||||
*
|
||||
* @author Jeroen Meulemeester
|
||||
*/
|
||||
public class ProducerTest {
|
||||
class ProducerTest {
|
||||
|
||||
@Test
|
||||
void testProduce() {
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user