From 4cd814950215cb6e03eb91f78020ee6e4977be58 Mon Sep 17 00:00:00 2001
From: Robert Volkmann <20912167+robertvolkmann@users.noreply.github.com>
Date: Sun, 30 Oct 2022 17:21:21 +0100
Subject: [PATCH] refactor: remove code smell java:S5786 (#2159)
https://sonarcloud.io/organizations/iluwatar/rules?open=java%3AS5786&rule_key=java%3AS5786
---
.../ConfigureForDosVisitorTest.java | 2 +-
.../ConfigureForUnixVisitorTest.java | 2 +-
.../iluwatar/adapter/AdapterPatternTest.java | 2 +-
.../microservices/AggregatorTest.java | 2 +-
.../iluwatar/api/gateway/ApiGatewayTest.java | 2 +-
.../delegate/BusinessDelegateTest.java | 2 +-
.../java/com/iluwatar/caching/CachingTest.java | 2 +-
.../com/iluwatar/callback/CallbackTest.java | 2 +-
.../com/iluwatar/circuitbreaker/AppTest.java | 10 +++++-----
.../DefaultCircuitBreakerTest.java | 2 +-
.../DelayedRemoteServiceTest.java | 2 +-
.../UsageCostProcessorFunctionTest.java | 8 ++++----
.../UsageDetailPublisherFunctionTest.java | 6 +++---
.../utility/EventHandlerUtilityTest.java | 4 ++--
.../utility/MessageHandlerUtilityTest.java | 4 ++--
.../iluwatar/compositeview/AppServletTest.java | 10 +++++-----
.../iluwatar/compositeview/JavaBeansTest.java | 16 ++++++++--------
.../com/iluwatar/dao/DbCustomerDaoTest.java | 6 +++---
.../com/iluwatar/flux/action/ContentTest.java | 2 +-
.../com/iluwatar/flux/action/MenuItemTest.java | 2 +-
.../flux/dispatcher/DispatcherTest.java | 4 ++--
.../iluwatar/flux/store/ContentStoreTest.java | 2 +-
.../com/iluwatar/flux/store/MenuStoreTest.java | 2 +-
.../iluwatar/flux/view/ContentViewTest.java | 2 +-
.../com/iluwatar/flux/view/MenuViewTest.java | 2 +-
.../iluwatar/flyweight/AlchemistShopTest.java | 2 +-
.../controller/ApplicationExceptionTest.java | 2 +-
.../iluwatar/front/controller/CommandTest.java | 8 ++++----
.../front/controller/FrontControllerTest.java | 8 ++++----
.../iluwatar/front/controller/ViewTest.java | 8 ++++----
.../java/com/iluwatar/gameloop/AppTest.java | 2 +-
.../gameloop/FixedStepGameLoopTest.java | 6 +++---
.../iluwatar/gameloop/GameControllerTest.java | 4 ++--
.../guarded/suspension/GuardedQueueTest.java | 2 +-
.../AsynchronousServiceTest.java | 4 ++--
.../intercepting/filter/FilterManagerTest.java | 2 +-
.../intercepting/filter/FilterTest.java | 6 +++---
.../intercepting/filter/OrderTest.java | 2 +-
.../iluwatar/interpreter/ExpressionTest.java | 4 ++--
.../interpreter/MinusExpressionTest.java | 2 +-
.../interpreter/MultiplyExpressionTest.java | 2 +-
.../interpreter/NumberExpressionTest.java | 4 ++--
.../interpreter/PlusExpressionTest.java | 2 +-
.../iterator/list/TreasureChestTest.java | 6 +++---
.../com/iluwatar/layers/entity/CakeTest.java | 2 +-
.../exception/CakeBakingExceptionTest.java | 2 +-
.../service/CakeBakingServiceImplTest.java | 2 +-
.../iluwatar/layers/view/CakeViewImplTest.java | 6 +++---
.../iluwatar/lazy/loading/HolderNaiveTest.java | 2 +-
.../lazy/loading/HolderThreadSafeTest.java | 2 +-
.../iluwatar/lazy/loading/Java8HolderTest.java | 2 +-
.../iluwatar/leaderelection/MessageTest.java | 2 +-
.../bully/BullyMessageManagerTest.java | 2 +-
.../bully/BullyinstanceTest.java | 2 +-
.../leaderelection/ring/RingInstanceTest.java | 2 +-
.../ring/RingMessageManagerTest.java | 2 +-
marker/src/test/java/ThiefTest.java | 2 +-
.../com/iluwatar/mediator/PartyImplTest.java | 2 +-
.../com/iluwatar/mediator/PartyMemberTest.java | 12 ++++++------
.../java/com/iluwatar/memento/StarTest.java | 2 +-
.../view/controller/GiantControllerTest.java | 2 +-
.../model/view/controller/GiantModelTest.java | 2 +-
.../model/view/controller/GiantViewTest.java | 6 +++---
.../model/view/presenter/FileLoaderTest.java | 2 +-
.../presenter/FileSelectorPresenterTest.java | 4 ++--
.../java/com/iluwatar/monad/MonadTest.java | 2 +-
.../java/com/iluwatar/monitor/BankTest.java | 2 +-
.../iluwatar/monostate/LoadBalancerTest.java | 2 +-
.../java/com/iluwatar/multiton/NazgulTest.java | 2 +-
.../dom/modules/simple/SimpleObjectTest.java | 6 +++---
.../dom/modules/simple/SimpleObjectsTest.java | 8 ++++----
.../java/com/iluwatar/nullobject/TreeTest.java | 6 +++---
.../test/RoyaltyObjectMotherTest.java | 2 +-
.../com/iluwatar/observer/HobbitsTest.java | 2 +-
.../java/com/iluwatar/observer/OrcsTest.java | 2 +-
.../iluwatar/observer/WeatherObserverTest.java | 6 +++---
.../com/iluwatar/observer/WeatherTest.java | 6 +++---
.../observer/generic/GHobbitsTest.java | 2 +-
.../observer/generic/GWeatherTest.java | 6 +++---
.../observer/generic/ObserverTest.java | 6 +++---
.../iluwatar/observer/generic/OrcsTest.java | 2 +-
.../iluwatar/pageobject/AlbumListPageTest.java | 4 ++--
.../com/iluwatar/pageobject/AlbumPageTest.java | 4 ++--
.../com/iluwatar/pageobject/LoginPageTest.java | 4 ++--
.../iluwatar/pageobject/AlbumListPageTest.java | 4 ++--
.../com/iluwatar/pageobject/AlbumPageTest.java | 4 ++--
.../com/iluwatar/pageobject/LoginPageTest.java | 4 ++--
.../parameter/object/ParameterObjectTest.java | 4 ++--
.../parameter/object/SearchServiceTest.java | 4 ++--
.../com/iluwatar/pipeline/PipelineTest.java | 2 +-
.../com/iluwatar/poison/pill/ConsumerTest.java | 6 +++---
.../poison/pill/PoisonMessageTest.java | 2 +-
.../com/iluwatar/poison/pill/ProducerTest.java | 2 +-
.../poison/pill/SimpleMessageTest.java | 2 +-
.../queue/PriorityMessageQueueTest.java | 2 +-
.../priority/queue/QueueManagerTest.java | 2 +-
.../privateclassdata/ImmutableStewTest.java | 6 +++---
.../iluwatar/privateclassdata/StewTest.java | 6 +++---
.../producer/consumer/ConsumerTest.java | 2 +-
.../producer/consumer/ProducerTest.java | 2 +-
.../java/com/iluwatar/promise/PromiseTest.java | 2 +-
.../com/iluwatar/property/CharacterTest.java | 2 +-
.../com/iluwatar/proxy/IvoryTowerTest.java | 4 ++--
.../iluwatar/proxy/WizardTowerProxyTest.java | 4 ++--
.../writer/lock/ReaderAndWriterTest.java | 4 ++--
.../reader/writer/lock/ReaderTest.java | 4 ++--
.../reader/writer/lock/WriterTest.java | 4 ++--
.../registry/CustomerRegistryTest.java | 4 ++--
.../AnnotationBasedRepositoryTest.java | 4 ++--
.../iluwatar/repository/RepositoryTest.java | 4 ++--
.../is/initialization/ClosableTest.java | 6 +++---
.../baas/api/FindPersonApiHandlerTest.java | 2 +-
.../baas/api/SavePersonApiHandlerTest.java | 2 +-
.../servicelayer/common/BaseDaoTest.java | 4 ++--
.../sharding/HashShardManagerTest.java | 2 +-
.../sharding/LookupShardManagerTest.java | 2 +-
.../sharding/RangeShardManagerTest.java | 2 +-
.../java/com/iluwatar/sharding/ShardTest.java | 2 +-
.../iluwatar/singleton/EnumIvoryTowerTest.java | 2 +-
.../InitializingOnDemandHolderIdiomTest.java | 2 +-
.../com/iluwatar/singleton/IvoryTowerTest.java | 2 +-
.../ThreadSafeLazyLoadedIvoryTowerTest.java | 2 +-
.../java/com/iluwatar/specialcase/AppTest.java | 2 +-
.../iluwatar/specialcase/SpecialCasesTest.java | 14 +++++++-------
.../selector/MassSelectorTest.java | 2 +-
.../selector/MovementSelectorTest.java | 2 +-
.../selector/SizeSelectorTest.java | 2 +-
.../java/com/iluwatar/state/MammothTest.java | 6 +++---
.../stepbuilder/CharacterStepBuilderTest.java | 2 +-
.../com/iluwatar/strangler/HalfSourceTest.java | 2 +-
.../com/iluwatar/strangler/NewSourceTest.java | 2 +-
.../com/iluwatar/strangler/OldSourceTest.java | 2 +-
.../iluwatar/strategy/DragonSlayerTest.java | 2 +-
.../strategy/DragonSlayingStrategyTest.java | 8 ++++----
.../templatemethod/HalflingThiefTest.java | 2 +-
.../templatemethod/HitAndRunMethodTest.java | 2 +-
.../templatemethod/StealingMethodTest.java | 4 ++--
.../templatemethod/SubtleMethodTest.java | 2 +-
.../threadpool/CoffeeMakingTaskTest.java | 2 +-
.../threadpool/PotatoPeelingTaskTest.java | 2 +-
.../com/iluwatar/threadpool/WorkerTest.java | 2 +-
.../iluwatar/throttling/BarCustomerTest.java | 2 +-
.../com/iluwatar/throttling/BartenderTest.java | 2 +-
.../iluwatar/tls/DateFormatCallableTest.java | 2 +-
.../transactionscript/HotelDaoImplTest.java | 18 +++++++++---------
.../iluwatar/transactionscript/HotelTest.java | 2 +-
.../java/com/iluwatar/twin/BallItemTest.java | 8 ++++----
.../versionnumber/BookRepositoryTest.java | 2 +-
.../com/iluwatar/visitor/CommanderTest.java | 2 +-
.../iluwatar/visitor/CommanderVisitorTest.java | 2 +-
.../com/iluwatar/visitor/SergeantTest.java | 2 +-
.../iluwatar/visitor/SergeantVisitorTest.java | 2 +-
.../java/com/iluwatar/visitor/SoldierTest.java | 2 +-
.../iluwatar/visitor/SoldierVisitorTest.java | 2 +-
.../java/com/iluwatar/visitor/VisitorTest.java | 4 ++--
155 files changed, 273 insertions(+), 273 deletions(-)
diff --git a/acyclic-visitor/src/test/java/com/iluwatar/acyclicvisitor/ConfigureForDosVisitorTest.java b/acyclic-visitor/src/test/java/com/iluwatar/acyclicvisitor/ConfigureForDosVisitorTest.java
index 7697fc367..c6aec8bef 100644
--- a/acyclic-visitor/src/test/java/com/iluwatar/acyclicvisitor/ConfigureForDosVisitorTest.java
+++ b/acyclic-visitor/src/test/java/com/iluwatar/acyclicvisitor/ConfigureForDosVisitorTest.java
@@ -74,7 +74,7 @@ class ConfigureForDosVisitorTest {
@BeforeEach
@AfterEach
- public void clearLoggers() {
+ void clearLoggers() {
TestLoggerFactory.clear();
}
}
diff --git a/acyclic-visitor/src/test/java/com/iluwatar/acyclicvisitor/ConfigureForUnixVisitorTest.java b/acyclic-visitor/src/test/java/com/iluwatar/acyclicvisitor/ConfigureForUnixVisitorTest.java
index 4e887b222..587b82911 100644
--- a/acyclic-visitor/src/test/java/com/iluwatar/acyclicvisitor/ConfigureForUnixVisitorTest.java
+++ b/acyclic-visitor/src/test/java/com/iluwatar/acyclicvisitor/ConfigureForUnixVisitorTest.java
@@ -44,7 +44,7 @@ class ConfigureForUnixVisitorTest {
@BeforeEach
@AfterEach
- public void clearLoggers() {
+ void clearLoggers() {
TestLoggerFactory.clear();
}
diff --git a/adapter/src/test/java/com/iluwatar/adapter/AdapterPatternTest.java b/adapter/src/test/java/com/iluwatar/adapter/AdapterPatternTest.java
index 1aa5f90c8..5d5c2a081 100644
--- a/adapter/src/test/java/com/iluwatar/adapter/AdapterPatternTest.java
+++ b/adapter/src/test/java/com/iluwatar/adapter/AdapterPatternTest.java
@@ -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());
diff --git a/aggregator-microservices/aggregator-service/src/test/java/com/iluwatar/aggregator/microservices/AggregatorTest.java b/aggregator-microservices/aggregator-service/src/test/java/com/iluwatar/aggregator/microservices/AggregatorTest.java
index 5630a18d1..2ac246d9f 100644
--- a/aggregator-microservices/aggregator-service/src/test/java/com/iluwatar/aggregator/microservices/AggregatorTest.java
+++ b/aggregator-microservices/aggregator-service/src/test/java/com/iluwatar/aggregator/microservices/AggregatorTest.java
@@ -48,7 +48,7 @@ class AggregatorTest {
private ProductInventoryClient inventoryClient;
@BeforeEach
- public void setup() {
+ void setup() {
MockitoAnnotations.openMocks(this);
}
diff --git a/api-gateway/api-gateway-service/src/test/java/com/iluwatar/api/gateway/ApiGatewayTest.java b/api-gateway/api-gateway-service/src/test/java/com/iluwatar/api/gateway/ApiGatewayTest.java
index 0ae43e8dd..0f1fa938e 100644
--- a/api-gateway/api-gateway-service/src/test/java/com/iluwatar/api/gateway/ApiGatewayTest.java
+++ b/api-gateway/api-gateway-service/src/test/java/com/iluwatar/api/gateway/ApiGatewayTest.java
@@ -48,7 +48,7 @@ class ApiGatewayTest {
private PriceClient priceClient;
@BeforeEach
- public void setup() {
+ void setup() {
MockitoAnnotations.openMocks(this);
}
diff --git a/business-delegate/src/test/java/com/iluwatar/business/delegate/BusinessDelegateTest.java b/business-delegate/src/test/java/com/iluwatar/business/delegate/BusinessDelegateTest.java
index 351001ceb..8e8c8eddc 100644
--- a/business-delegate/src/test/java/com/iluwatar/business/delegate/BusinessDelegateTest.java
+++ b/business-delegate/src/test/java/com/iluwatar/business/delegate/BusinessDelegateTest.java
@@ -49,7 +49,7 @@ class BusinessDelegateTest {
* execution of every test.
*/
@BeforeEach
- public void setup() {
+ void setup() {
netflixService = spy(new NetflixService());
youTubeService = spy(new YouTubeService());
diff --git a/caching/src/test/java/com/iluwatar/caching/CachingTest.java b/caching/src/test/java/com/iluwatar/caching/CachingTest.java
index 41c220420..0bcb83897 100644
--- a/caching/src/test/java/com/iluwatar/caching/CachingTest.java
+++ b/caching/src/test/java/com/iluwatar/caching/CachingTest.java
@@ -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
diff --git a/callback/src/test/java/com/iluwatar/callback/CallbackTest.java b/callback/src/test/java/com/iluwatar/callback/CallbackTest.java
index 83a5aad5a..d8dab98e6 100644
--- a/callback/src/test/java/com/iluwatar/callback/CallbackTest.java
+++ b/callback/src/test/java/com/iluwatar/callback/CallbackTest.java
@@ -34,7 +34,7 @@ import org.junit.jupiter.api.Test;
*
* Could be done with mock objects as well where the call method call is verified.
*/
-public class CallbackTest {
+class CallbackTest {
private Integer callingCount = 0;
diff --git a/circuit-breaker/src/test/java/com/iluwatar/circuitbreaker/AppTest.java b/circuit-breaker/src/test/java/com/iluwatar/circuitbreaker/AppTest.java
index b5aeb2ac9..8502ce0af 100644
--- a/circuit-breaker/src/test/java/com/iluwatar/circuitbreaker/AppTest.java
+++ b/circuit-breaker/src/test/java/com/iluwatar/circuitbreaker/AppTest.java
@@ -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
diff --git a/circuit-breaker/src/test/java/com/iluwatar/circuitbreaker/DefaultCircuitBreakerTest.java b/circuit-breaker/src/test/java/com/iluwatar/circuitbreaker/DefaultCircuitBreakerTest.java
index 2e19456a5..817a1e7d0 100644
--- a/circuit-breaker/src/test/java/com/iluwatar/circuitbreaker/DefaultCircuitBreakerTest.java
+++ b/circuit-breaker/src/test/java/com/iluwatar/circuitbreaker/DefaultCircuitBreakerTest.java
@@ -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
diff --git a/circuit-breaker/src/test/java/com/iluwatar/circuitbreaker/DelayedRemoteServiceTest.java b/circuit-breaker/src/test/java/com/iluwatar/circuitbreaker/DelayedRemoteServiceTest.java
index 23215da88..5fe3cdc48 100644
--- a/circuit-breaker/src/test/java/com/iluwatar/circuitbreaker/DelayedRemoteServiceTest.java
+++ b/circuit-breaker/src/test/java/com/iluwatar/circuitbreaker/DelayedRemoteServiceTest.java
@@ -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());
}
diff --git a/cloud-claim-check-pattern/call-usage-app/src/test/java/com/iluwatar/claimcheckpattern/consumer/callcostprocessor/functions/UsageCostProcessorFunctionTest.java b/cloud-claim-check-pattern/call-usage-app/src/test/java/com/iluwatar/claimcheckpattern/consumer/callcostprocessor/functions/UsageCostProcessorFunctionTest.java
index 3beb01ea4..fc1683768 100644
--- a/cloud-claim-check-pattern/call-usage-app/src/test/java/com/iluwatar/claimcheckpattern/consumer/callcostprocessor/functions/UsageCostProcessorFunctionTest.java
+++ b/cloud-claim-check-pattern/call-usage-app/src/test/java/com/iluwatar/claimcheckpattern/consumer/callcostprocessor/functions/UsageCostProcessorFunctionTest.java
@@ -58,7 +58,7 @@ import static org.mockito.Mockito.*;
* Unit test for Function class.
*/
@ExtendWith(MockitoExtension.class)
-public class UsageCostProcessorFunctionTest {
+class UsageCostProcessorFunctionTest {
@Mock
MessageHandlerUtility mockMessageHandlerUtilityForUsageADetail;
@@ -74,7 +74,7 @@ public class UsageCostProcessorFunctionTest {
UsageCostProcessorFunction usageCostProcessorFunction;
@BeforeEach
- public void setUp() {
+ void setUp() {
var messageBodyUsageDetail = new MessageBody();
var usageDetailsList = new ArrayList();
@@ -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> req = mock(HttpRequestMessage.class);
diff --git a/cloud-claim-check-pattern/call-usage-app/src/test/java/com/iluwatar/claimcheckpattern/producer/calldetails/functions/UsageDetailPublisherFunctionTest.java b/cloud-claim-check-pattern/call-usage-app/src/test/java/com/iluwatar/claimcheckpattern/producer/calldetails/functions/UsageDetailPublisherFunctionTest.java
index 6533ea357..c44e23b35 100644
--- a/cloud-claim-check-pattern/call-usage-app/src/test/java/com/iluwatar/claimcheckpattern/producer/calldetails/functions/UsageDetailPublisherFunctionTest.java
+++ b/cloud-claim-check-pattern/call-usage-app/src/test/java/com/iluwatar/claimcheckpattern/producer/calldetails/functions/UsageDetailPublisherFunctionTest.java
@@ -52,7 +52,7 @@ import static org.mockito.Mockito.*;
* Unit test for Function class.
*/
@ExtendWith(MockitoExtension.class)
-public class UsageDetailPublisherFunctionTest {
+class UsageDetailPublisherFunctionTest {
@Mock
MessageHandlerUtility 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")
diff --git a/cloud-claim-check-pattern/call-usage-app/src/test/java/com/iluwatar/claimcheckpattern/utility/EventHandlerUtilityTest.java b/cloud-claim-check-pattern/call-usage-app/src/test/java/com/iluwatar/claimcheckpattern/utility/EventHandlerUtilityTest.java
index 9e34ec533..69e63241f 100644
--- a/cloud-claim-check-pattern/call-usage-app/src/test/java/com/iluwatar/claimcheckpattern/utility/EventHandlerUtilityTest.java
+++ b/cloud-claim-check-pattern/call-usage-app/src/test/java/com/iluwatar/claimcheckpattern/utility/EventHandlerUtilityTest.java
@@ -40,7 +40,7 @@ import org.mockito.Mock;
import org.mockito.junit.jupiter.MockitoExtension;
@ExtendWith(MockitoExtension.class)
-public class EventHandlerUtilityTest {
+class EventHandlerUtilityTest {
@Mock
EventGridPublisherClient mockCustomEventClient;
@@ -49,7 +49,7 @@ public class EventHandlerUtilityTest {
EventHandlerUtility> eventHandlerUtility;
@BeforeEach
- public void setUp() {
+ void setUp() {
System.setProperty("EventGridURL", "https://www.dummyEndpoint.com/api/events");
System.setProperty("EventGridKey", "EventGridURL");
diff --git a/cloud-claim-check-pattern/call-usage-app/src/test/java/com/iluwatar/claimcheckpattern/utility/MessageHandlerUtilityTest.java b/cloud-claim-check-pattern/call-usage-app/src/test/java/com/iluwatar/claimcheckpattern/utility/MessageHandlerUtilityTest.java
index 0230406bc..7bfc08b89 100644
--- a/cloud-claim-check-pattern/call-usage-app/src/test/java/com/iluwatar/claimcheckpattern/utility/MessageHandlerUtilityTest.java
+++ b/cloud-claim-check-pattern/call-usage-app/src/test/java/com/iluwatar/claimcheckpattern/utility/MessageHandlerUtilityTest.java
@@ -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();
diff --git a/composite-view/src/test/java/com/iluwatar/compositeview/AppServletTest.java b/composite-view/src/test/java/com/iluwatar/compositeview/AppServletTest.java
index 37dc71394..27c829a75 100644
--- a/composite-view/src/test/java/com/iluwatar/compositeview/AppServletTest.java
+++ b/composite-view/src/test/java/com/iluwatar/compositeview/AppServletTest.java
@@ -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 = "This Server Doesn't Support";
private String msgPartTwo = "Requests
\n"
+ "Use a GET request with boolean values for the following parameters\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();
diff --git a/composite-view/src/test/java/com/iluwatar/compositeview/JavaBeansTest.java b/composite-view/src/test/java/com/iluwatar/compositeview/JavaBeansTest.java
index 85f7e4a8a..826a00881 100644
--- a/composite-view/src/test/java/com/iluwatar/compositeview/JavaBeansTest.java
+++ b/composite-view/src/test/java/com/iluwatar/compositeview/JavaBeansTest.java
@@ -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());
diff --git a/dao/src/test/java/com/iluwatar/dao/DbCustomerDaoTest.java b/dao/src/test/java/com/iluwatar/dao/DbCustomerDaoTest.java
index b5f6a1d2e..666c7634c 100644
--- a/dao/src/test/java/com/iluwatar/dao/DbCustomerDaoTest.java
+++ b/dao/src/test/java/com/iluwatar/dao/DbCustomerDaoTest.java
@@ -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());
}
diff --git a/flux/src/test/java/com/iluwatar/flux/action/ContentTest.java b/flux/src/test/java/com/iluwatar/flux/action/ContentTest.java
index 3807ad5c8..6fec8ce38 100644
--- a/flux/src/test/java/com/iluwatar/flux/action/ContentTest.java
+++ b/flux/src/test/java/com/iluwatar/flux/action/ContentTest.java
@@ -34,7 +34,7 @@ import org.junit.jupiter.api.Test;
*
* @author Jeroen Meulemeester
*/
-public class ContentTest {
+class ContentTest {
@Test
void testToString() {
diff --git a/flux/src/test/java/com/iluwatar/flux/action/MenuItemTest.java b/flux/src/test/java/com/iluwatar/flux/action/MenuItemTest.java
index 033729997..3b995a804 100644
--- a/flux/src/test/java/com/iluwatar/flux/action/MenuItemTest.java
+++ b/flux/src/test/java/com/iluwatar/flux/action/MenuItemTest.java
@@ -34,7 +34,7 @@ import org.junit.jupiter.api.Test;
*
* @author Jeroen Meulemeester
*/
-public class MenuItemTest {
+class MenuItemTest {
@Test
void testToString() {
diff --git a/flux/src/test/java/com/iluwatar/flux/dispatcher/DispatcherTest.java b/flux/src/test/java/com/iluwatar/flux/dispatcher/DispatcherTest.java
index 192afc5d5..0657e6cf7 100644
--- a/flux/src/test/java/com/iluwatar/flux/dispatcher/DispatcherTest.java
+++ b/flux/src/test/java/com/iluwatar/flux/dispatcher/DispatcherTest.java
@@ -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);
diff --git a/flux/src/test/java/com/iluwatar/flux/store/ContentStoreTest.java b/flux/src/test/java/com/iluwatar/flux/store/ContentStoreTest.java
index 046b5a829..248894a59 100644
--- a/flux/src/test/java/com/iluwatar/flux/store/ContentStoreTest.java
+++ b/flux/src/test/java/com/iluwatar/flux/store/ContentStoreTest.java
@@ -44,7 +44,7 @@ import org.junit.jupiter.api.Test;
*
* @author Jeroen Meulemeester
*/
-public class ContentStoreTest {
+class ContentStoreTest {
@Test
void testOnAction() {
diff --git a/flux/src/test/java/com/iluwatar/flux/store/MenuStoreTest.java b/flux/src/test/java/com/iluwatar/flux/store/MenuStoreTest.java
index 58726e4c0..0e556fea5 100644
--- a/flux/src/test/java/com/iluwatar/flux/store/MenuStoreTest.java
+++ b/flux/src/test/java/com/iluwatar/flux/store/MenuStoreTest.java
@@ -44,7 +44,7 @@ import org.junit.jupiter.api.Test;
*
* @author Jeroen Meulemeester
*/
-public class MenuStoreTest {
+class MenuStoreTest {
@Test
void testOnAction() {
diff --git a/flux/src/test/java/com/iluwatar/flux/view/ContentViewTest.java b/flux/src/test/java/com/iluwatar/flux/view/ContentViewTest.java
index e1612b5c4..54f909a9b 100644
--- a/flux/src/test/java/com/iluwatar/flux/view/ContentViewTest.java
+++ b/flux/src/test/java/com/iluwatar/flux/view/ContentViewTest.java
@@ -39,7 +39,7 @@ import org.junit.jupiter.api.Test;
*
* @author Jeroen Meulemeester
*/
-public class ContentViewTest {
+class ContentViewTest {
@Test
void testStoreChanged() {
diff --git a/flux/src/test/java/com/iluwatar/flux/view/MenuViewTest.java b/flux/src/test/java/com/iluwatar/flux/view/MenuViewTest.java
index f22f27512..314bcf147 100644
--- a/flux/src/test/java/com/iluwatar/flux/view/MenuViewTest.java
+++ b/flux/src/test/java/com/iluwatar/flux/view/MenuViewTest.java
@@ -43,7 +43,7 @@ import org.junit.jupiter.api.Test;
*
* @author Jeroen Meulemeester
*/
-public class MenuViewTest {
+class MenuViewTest {
@Test
void testStoreChanged() {
diff --git a/flyweight/src/test/java/com/iluwatar/flyweight/AlchemistShopTest.java b/flyweight/src/test/java/com/iluwatar/flyweight/AlchemistShopTest.java
index 925282adb..044855438 100644
--- a/flyweight/src/test/java/com/iluwatar/flyweight/AlchemistShopTest.java
+++ b/flyweight/src/test/java/com/iluwatar/flyweight/AlchemistShopTest.java
@@ -35,7 +35,7 @@ import org.junit.jupiter.api.Test;
*
* @author Jeroen Meulemeester
*/
-public class AlchemistShopTest {
+class AlchemistShopTest {
@Test
void testShop() {
diff --git a/front-controller/src/test/java/com/iluwatar/front/controller/ApplicationExceptionTest.java b/front-controller/src/test/java/com/iluwatar/front/controller/ApplicationExceptionTest.java
index 7f19fcc3d..9214b2ce1 100644
--- a/front-controller/src/test/java/com/iluwatar/front/controller/ApplicationExceptionTest.java
+++ b/front-controller/src/test/java/com/iluwatar/front/controller/ApplicationExceptionTest.java
@@ -33,7 +33,7 @@ import org.junit.jupiter.api.Test;
*
* @author Jeroen Meulemeester
*/
-public class ApplicationExceptionTest {
+class ApplicationExceptionTest {
@Test
void testCause() {
diff --git a/front-controller/src/test/java/com/iluwatar/front/controller/CommandTest.java b/front-controller/src/test/java/com/iluwatar/front/controller/CommandTest.java
index e3712582c..1906fd16e 100644
--- a/front-controller/src/test/java/com/iluwatar/front/controller/CommandTest.java
+++ b/front-controller/src/test/java/com/iluwatar/front/controller/CommandTest.java
@@ -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);
diff --git a/front-controller/src/test/java/com/iluwatar/front/controller/FrontControllerTest.java b/front-controller/src/test/java/com/iluwatar/front/controller/FrontControllerTest.java
index 0dd1705bc..8f510cf50 100644
--- a/front-controller/src/test/java/com/iluwatar/front/controller/FrontControllerTest.java
+++ b/front-controller/src/test/java/com/iluwatar/front/controller/FrontControllerTest.java
@@ -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());
diff --git a/front-controller/src/test/java/com/iluwatar/front/controller/ViewTest.java b/front-controller/src/test/java/com/iluwatar/front/controller/ViewTest.java
index 490174c64..e5bb7f1d3 100644
--- a/front-controller/src/test/java/com/iluwatar/front/controller/ViewTest.java
+++ b/front-controller/src/test/java/com/iluwatar/front/controller/ViewTest.java
@@ -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());
diff --git a/game-loop/src/test/java/com/iluwatar/gameloop/AppTest.java b/game-loop/src/test/java/com/iluwatar/gameloop/AppTest.java
index 9a4b58113..72997b744 100644
--- a/game-loop/src/test/java/com/iluwatar/gameloop/AppTest.java
+++ b/game-loop/src/test/java/com/iluwatar/gameloop/AppTest.java
@@ -31,7 +31,7 @@ import org.junit.jupiter.api.Test;
/**
* App unit test class.
*/
-public class AppTest {
+class AppTest {
@Test
void shouldExecuteApplicationWithoutException() {
diff --git a/game-loop/src/test/java/com/iluwatar/gameloop/FixedStepGameLoopTest.java b/game-loop/src/test/java/com/iluwatar/gameloop/FixedStepGameLoopTest.java
index 02d8503a7..8cd00f286 100644
--- a/game-loop/src/test/java/com/iluwatar/gameloop/FixedStepGameLoopTest.java
+++ b/game-loop/src/test/java/com/iluwatar/gameloop/FixedStepGameLoopTest.java
@@ -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;
}
diff --git a/game-loop/src/test/java/com/iluwatar/gameloop/GameControllerTest.java b/game-loop/src/test/java/com/iluwatar/gameloop/GameControllerTest.java
index 6e3fff643..a8eef3431 100644
--- a/game-loop/src/test/java/com/iluwatar/gameloop/GameControllerTest.java
+++ b/game-loop/src/test/java/com/iluwatar/gameloop/GameControllerTest.java
@@ -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;
}
diff --git a/guarded-suspension/src/test/java/com/iluwatar/guarded/suspension/GuardedQueueTest.java b/guarded-suspension/src/test/java/com/iluwatar/guarded/suspension/GuardedQueueTest.java
index ba8623f9d..33e9fc6b7 100644
--- a/guarded-suspension/src/test/java/com/iluwatar/guarded/suspension/GuardedQueueTest.java
+++ b/guarded-suspension/src/test/java/com/iluwatar/guarded/suspension/GuardedQueueTest.java
@@ -33,7 +33,7 @@ import org.junit.jupiter.api.Test;
/**
* Test for Guarded Queue
*/
-public class GuardedQueueTest {
+class GuardedQueueTest {
private volatile Integer value;
@Test
diff --git a/half-sync-half-async/src/test/java/com/iluwatar/halfsynchalfasync/AsynchronousServiceTest.java b/half-sync-half-async/src/test/java/com/iluwatar/halfsynchalfasync/AsynchronousServiceTest.java
index 90a2f840c..a4c87135c 100644
--- a/half-sync-half-async/src/test/java/com/iluwatar/halfsynchalfasync/AsynchronousServiceTest.java
+++ b/half-sync-half-async/src/test/java/com/iluwatar/halfsynchalfasync/AsynchronousServiceTest.java
@@ -44,12 +44,12 @@ import org.junit.jupiter.api.Test;
*
* @author Jeroen Meulemeester
*/
-public class AsynchronousServiceTest {
+class AsynchronousServiceTest {
private AsynchronousService service;
private AsyncTask