Skip to content

Commit c64d171

Browse files
committed
remove visibility modifiers from tests
1 parent 874e4ce commit c64d171

File tree

232 files changed

+1465
-1579
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

232 files changed

+1465
-1579
lines changed

components/inspectit-ocelot-configdocsgenerator/src/test/java/inspectit/ocelot/configdocsgenerator/ConfigDocsGeneratorTest.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,24 +19,24 @@
1919

2020
class ConfigDocsGeneratorTest {
2121

22-
private static ActionDocs actionWithDocInYaml;
22+
static ActionDocs actionWithDocInYaml;
2323

24-
private static ActionDocs actionWithoutDocInYaml;
24+
static ActionDocs actionWithoutDocInYaml;
2525

26-
private static BaseDocs scopeDoc;
26+
static BaseDocs scopeDoc;
2727

28-
private static RuleDocs ruleDocChild;
28+
static RuleDocs ruleDocChild;
2929

30-
private static RuleDocs ruleDocParent;
30+
static RuleDocs ruleDocParent;
3131

32-
private static MetricDocs metricDoc;
32+
static MetricDocs metricDoc;
3333

34-
private final static ConfigDocsGenerator configDocsGenerator = new ConfigDocsGenerator();
34+
final static ConfigDocsGenerator configDocsGenerator = new ConfigDocsGenerator();
3535

3636
/**
3737
* Needed to create InspectitConfig Objects to use as input for DocObjectGenerator in tests.
3838
*/
39-
private final ConfigParser configParser = new ConfigParser();
39+
final ConfigParser configParser = new ConfigParser();
4040

4141
/**
4242
* Helper method to read Yaml from resources.

components/inspectit-ocelot-configdocsgenerator/src/test/java/inspectit/ocelot/configdocsgenerator/model/RuleDocsTest.java

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,35 +11,35 @@
1111

1212
public class RuleDocsTest {
1313

14-
private static final String RULE_1_NAME = "testRule1";
14+
static final String RULE_1_NAME = "testRule1";
1515

16-
private static final String RULE_2_NAME = "testRule2";
16+
static final String RULE_2_NAME = "testRule2";
1717

18-
private static final String RULE_3_NAME = "testRule3";
18+
static final String RULE_3_NAME = "testRule3";
1919

20-
private static final String RULE_4_NAME = "testRule4";
20+
static final String RULE_4_NAME = "testRule4";
2121

22-
private static final String ACTION_FROM_RULE_1 = "a_1";
22+
static final String ACTION_FROM_RULE_1 = "a_1";
2323

24-
private static final String ACTION_FROM_RULE_2 = "a_2";
24+
static final String ACTION_FROM_RULE_2 = "a_2";
2525

26-
private static final String ACTION_FROM_RULE_3 = "a_3";
26+
static final String ACTION_FROM_RULE_3 = "a_3";
2727

28-
private static final String ACTION_FROM_RULE_4 = "a_4";
28+
static final String ACTION_FROM_RULE_4 = "a_4";
2929

30-
private static final String OVERWRITTEN_BY_1 = "overwritten_by_1";
30+
static final String OVERWRITTEN_BY_1 = "overwritten_by_1";
3131

32-
private static final String OVERWRITTEN_BY_2 = "overwritten_by_2";
32+
static final String OVERWRITTEN_BY_2 = "overwritten_by_2";
3333

34-
private static final String OVERWRITTEN_BY_1_AND_2 = "overwritten_by_1_and_2";
34+
static final String OVERWRITTEN_BY_1_AND_2 = "overwritten_by_1_and_2";
3535

36-
private static final String CREATED_BY_3 = "created_by_3";
36+
static final String CREATED_BY_3 = "created_by_3";
3737

38-
private static final String CREATED_BY_4 = "created_by_4";
38+
static final String CREATED_BY_4 = "created_by_4";
3939

40-
private static final String ENTRY_KEY = "entry";
40+
static final String ENTRY_KEY = "entry";
4141

42-
private static final String EXIT_KEY = "exit";
42+
static final String EXIT_KEY = "exit";
4343

4444
/**
4545
* Generate an actionCallsMap for a {@link RuleDocs} object with empty TreeMaps as values.
@@ -195,6 +195,5 @@ void addActionCallsFromIncludedRules() {
195195

196196
assertThat(result).usingRecursiveComparison().isEqualTo(expected);
197197
}
198-
199198
}
200199
}

components/inspectit-ocelot-configdocsgenerator/src/test/java/inspectit/ocelot/configdocsgenerator/parsing/ConfigParserTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
@ExtendWith(MockitoExtension.class)
3030
class ConfigParserTest {
3131

32-
private final ConfigParser configParser = new ConfigParser();
32+
final ConfigParser configParser = new ConfigParser();
3333

3434
/**
3535
* Helper method to read Yaml from resources.

components/inspectit-ocelot-configurationserver/src/test/java/rocks/inspectit/ocelot/agentcommunication/AgentCallbackManagerTest.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
import static org.mockito.Mockito.*;
2727

2828
@ExtendWith(MockitoExtension.class)
29-
public class AgentCallbackManagerTest {
29+
class AgentCallbackManagerTest {
3030

3131
@InjectMocks
3232
AgentCallbackManager agentCallbackManager;
@@ -35,7 +35,7 @@ public class AgentCallbackManagerTest {
3535
InspectitServerSettings configuration;
3636

3737
@BeforeEach
38-
public void beforeEach() {
38+
void beforeEach() {
3939
when(configuration.getAgentCommand().getResponseTimeout()).thenReturn(Duration.ofSeconds(5));
4040

4141
agentCallbackManager.postConstruct();
@@ -45,7 +45,7 @@ public void beforeEach() {
4545
class AddCallbackCommand {
4646

4747
@Test
48-
public void addCallbackCommand() {
48+
void addCallbackCommand() {
4949
UUID id = UUID.randomUUID();
5050
DeferredResult<ResponseEntity<?>> testResult = new DeferredResult<>();
5151

@@ -57,7 +57,7 @@ public void addCallbackCommand() {
5757
}
5858

5959
@Test
60-
public void ignoresNullParams() {
60+
void ignoresNullParams() {
6161
UUID id = UUID.randomUUID();
6262

6363
agentCallbackManager.addCommandCallback(id, null);
@@ -67,7 +67,7 @@ public void ignoresNullParams() {
6767
}
6868

6969
@Test
70-
public void throwsExceptionOnNullId() {
70+
void throwsExceptionOnNullId() {
7171
DeferredResult<ResponseEntity<?>> testResult = new DeferredResult<>();
7272

7373
assertThatExceptionOfType(IllegalArgumentException.class).isThrownBy(() -> agentCallbackManager.addCommandCallback(null, testResult))
@@ -79,7 +79,7 @@ public void throwsExceptionOnNullId() {
7979
class RunNextCommandWithId {
8080

8181
@Test
82-
public void hasCommand() {
82+
void hasCommand() {
8383
DeferredResult<ResponseEntity<?>> testResult = new DeferredResult<>();
8484
UUID id = UUID.randomUUID();
8585
agentCallbackManager.resultCache.put(id, testResult);
@@ -99,7 +99,7 @@ public void hasCommand() {
9999
}
100100

101101
@Test
102-
public void commandIdNull() {
102+
void commandIdNull() {
103103
agentCallbackManager.resultCache = mock(LoadingCache.class);
104104

105105
assertThatExceptionOfType(IllegalArgumentException.class).isThrownBy(() -> agentCallbackManager.handleCommandResponse(null, null))

components/inspectit-ocelot-configurationserver/src/test/java/rocks/inspectit/ocelot/agentcommunication/AgentCommandManagerTest.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
import static org.mockito.Mockito.when;
2323

2424
@ExtendWith(MockitoExtension.class)
25-
public class AgentCommandManagerTest {
25+
class AgentCommandManagerTest {
2626

2727
@InjectMocks
2828
AgentCommandManager agentCommandManager;
@@ -31,7 +31,7 @@ public class AgentCommandManagerTest {
3131
InspectitServerSettings configuration;
3232

3333
@BeforeEach
34-
public void beforeEach() {
34+
void beforeEach() {
3535
when(configuration.getAgentCommand().getCommandTimeout()).thenReturn(Duration.ofSeconds(5));
3636
when(configuration.getAgentCommand().getCommandQueueSize()).thenReturn(10);
3737

@@ -42,7 +42,7 @@ public void beforeEach() {
4242
class AddCommand {
4343

4444
@Test
45-
public void addCommandNewAgent() throws ExecutionException {
45+
void addCommandNewAgent() throws ExecutionException {
4646
Command mockAgentCommand = mock(Command.class);
4747
String agentId = "test-agent";
4848

@@ -55,7 +55,7 @@ public void addCommandNewAgent() throws ExecutionException {
5555
}
5656

5757
@Test
58-
public void throwsExeptionOnNullId() throws ExecutionException {
58+
void throwsExeptionOnNullId() throws ExecutionException {
5959
Command mockAgentCommand = mock(Command.class);
6060

6161
try {
@@ -67,7 +67,7 @@ public void throwsExeptionOnNullId() throws ExecutionException {
6767
}
6868

6969
@Test
70-
public void ignoresNullCommand() throws ExecutionException {
70+
void ignoresNullCommand() throws ExecutionException {
7171
String agentId = "test-agent";
7272

7373
agentCommandManager.addCommand(agentId, null);
@@ -81,7 +81,7 @@ public void ignoresNullCommand() throws ExecutionException {
8181
class GetCommand {
8282

8383
@Test
84-
public void noCommandPresent() {
84+
void noCommandPresent() {
8585
String agentId = "test-agent";
8686

8787
Command result = agentCommandManager.getCommand(agentId, false);
@@ -90,7 +90,7 @@ public void noCommandPresent() {
9090
}
9191

9292
@Test
93-
public void commandPresent() {
93+
void commandPresent() {
9494
Command mockAgentCommand = mock(Command.class);
9595
String agentId = "test-agent";
9696
BlockingQueue<Command> list = new LinkedBlockingQueue<>();
@@ -106,7 +106,7 @@ public void commandPresent() {
106106
}
107107

108108
@Test
109-
public void commandOfDifferentAgentPresent() {
109+
void commandOfDifferentAgentPresent() {
110110
Command mockAgentCommand = mock(Command.class);
111111
String agentId = "not-the-test-agent";
112112
BlockingQueue<Command> list = new LinkedBlockingQueue<>();

components/inspectit-ocelot-configurationserver/src/test/java/rocks/inspectit/ocelot/agentcommunication/handlers/impl/EnvironmentCommandHandlerTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
import static org.mockito.Mockito.when;
2121

2222
@ExtendWith(MockitoExtension.class)
23-
public class EnvironmentCommandHandlerTest {
23+
class EnvironmentCommandHandlerTest {
2424

2525
@InjectMocks
2626
EnvironmentCommandHandler environmentCommandHandler;
@@ -32,7 +32,7 @@ public class EnvironmentCommandHandlerTest {
3232
class PrepareResponse {
3333

3434
@Test
35-
public void cantHandleCommand() {
35+
void cantHandleCommand() {
3636
Command command = null;
3737
String agentId = "test-id";
3838

@@ -45,7 +45,7 @@ public void cantHandleCommand() {
4545
}
4646

4747
@Test
48-
public void preparesResponse() {
48+
void preparesResponse() {
4949
when(configuration.getAgentCommand().getResponseTimeout()).thenReturn(Duration.ofMinutes(1));
5050
EnvironmentCommand command = new EnvironmentCommand();
5151
String agentId = "test-id";
@@ -62,7 +62,7 @@ public void preparesResponse() {
6262
class HandleResponse {
6363

6464
@Test
65-
public void handlesResponse() {
65+
void handlesResponse() {
6666
EnvironmentCommand.Response mockResponse = mock(EnvironmentCommand.Response.class);
6767
DeferredResult<ResponseEntity<?>> result = new DeferredResult<>();
6868

components/inspectit-ocelot-configurationserver/src/test/java/rocks/inspectit/ocelot/agentcommunication/handlers/impl/InstrumentationFeedbackCommandHandlerTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
import static org.mockito.Mockito.when;
2222

2323
@ExtendWith(MockitoExtension.class)
24-
public class InstrumentationFeedbackCommandHandlerTest {
24+
class InstrumentationFeedbackCommandHandlerTest {
2525

2626
@InjectMocks
2727
InstrumentationFeedbackCommandHandler handler;
@@ -33,7 +33,7 @@ public class InstrumentationFeedbackCommandHandlerTest {
3333
class PrepareResponse {
3434

3535
@Test
36-
public void cantHandleCommand() {
36+
void cantHandleCommand() {
3737
Command command = null;
3838
String agentId = "test-id";
3939

@@ -45,7 +45,7 @@ public void cantHandleCommand() {
4545
}
4646

4747
@Test
48-
public void preparesResponse() {
48+
void preparesResponse() {
4949
when(configuration.getAgentCommand().getResponseTimeout()).thenReturn(Duration.ofMinutes(1));
5050
InstrumentationFeedbackCommand command = new InstrumentationFeedbackCommand();
5151
String agentId = "test-id";
@@ -60,7 +60,7 @@ public void preparesResponse() {
6060
class HandleResponse {
6161

6262
@Test
63-
public void handlesResponse() {
63+
void handlesResponse() {
6464
InstrumentationFeedbackCommand.Response mockResponse = mock(InstrumentationFeedbackCommand.Response.class);
6565
DeferredResult<ResponseEntity<?>> result = new DeferredResult<>();
6666

components/inspectit-ocelot-configurationserver/src/test/java/rocks/inspectit/ocelot/agentcommunication/handlers/impl/PingCommandHandlerTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
import static org.mockito.Mockito.*;
2121

2222
@ExtendWith(MockitoExtension.class)
23-
public class PingCommandHandlerTest {
23+
class PingCommandHandlerTest {
2424

2525
@InjectMocks
2626
PingCommandHandler pingCommandHandler;
@@ -32,7 +32,7 @@ public class PingCommandHandlerTest {
3232
class PrepareResponse {
3333

3434
@Test
35-
public void cantHandleCommand() {
35+
void cantHandleCommand() {
3636
Command command = null;
3737
String agentId = "test-id";
3838

@@ -45,7 +45,7 @@ public void cantHandleCommand() {
4545
}
4646

4747
@Test
48-
public void preparesResponse() {
48+
void preparesResponse() {
4949
when(configuration.getAgentCommand().getResponseTimeout()).thenReturn(Duration.ofMinutes(1));
5050
PingCommand command = new PingCommand();
5151
String agentId = "test-id";
@@ -62,7 +62,7 @@ public void preparesResponse() {
6262
class HandleResponse {
6363

6464
@Test
65-
public void handlesResponse() {
65+
void handlesResponse() {
6666
CommandResponse mockResponse = mock(CommandResponse.class);
6767
DeferredResult<ResponseEntity<?>> result = new DeferredResult<>();
6868

components/inspectit-ocelot-configurationserver/src/test/java/rocks/inspectit/ocelot/agentconfiguration/AgentConfigurationManagerTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
import static org.mockito.Mockito.*;
2424

2525
@ExtendWith(MockitoExtension.class)
26-
public class AgentConfigurationManagerTest {
26+
class AgentConfigurationManagerTest {
2727

2828
@InjectMocks
2929
AgentConfigurationManager configManager;
@@ -41,7 +41,7 @@ public class AgentConfigurationManagerTest {
4141
RevisionAccess fileAccessor;
4242

4343
@BeforeEach
44-
public void beforeEach() {
44+
void beforeEach() {
4545
lenient().when(fileManager.getWorkspaceRevision()).thenReturn(fileAccessor);
4646
lenient().when(serializer.getRevisionAccess()).thenReturn(fileAccessor);
4747
}

components/inspectit-ocelot-configurationserver/src/test/java/rocks/inspectit/ocelot/agentconfiguration/AgentConfigurationReloadTaskTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
import static rocks.inspectit.ocelot.file.versioning.Branch.WORKSPACE;
2626

2727
@ExtendWith(MockitoExtension.class)
28-
public class AgentConfigurationReloadTaskTest {
28+
class AgentConfigurationReloadTaskTest {
2929

3030
@Mock
3131
AgentMappingSerializer serializer;
@@ -59,7 +59,7 @@ void beforeEach() {
5959
class Run {
6060

6161
@Test
62-
void runTaskWithValidOutput() throws Exception {
62+
void runTaskWithValidOutput() {
6363
when(workspaceAccessor.readConfigurationFile(anyString())).thenReturn(Optional.of("key: valid"));
6464

6565
AgentMapping mapping = AgentMapping.builder()

0 commit comments

Comments
 (0)