Skip to content

Commit 911e219

Browse files
committed
Remove redundant public modifiers
These tests do not need to be public for JUnit 5. JIRA: LIGHTY-409 Signed-off-by: tobias.pobocik <tobias.pobocik@pantheon.tech>
1 parent 4fc7fff commit 911e219

File tree

14 files changed

+49
-49
lines changed

14 files changed

+49
-49
lines changed

lighty-core/lighty-common/src/test/java/io/lighty/core/common/SocketAnalyzerTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@
1313
import org.junit.jupiter.api.Assertions;
1414
import org.junit.jupiter.api.Test;
1515

16-
public class SocketAnalyzerTest {
16+
class SocketAnalyzerTest {
1717

1818
private static final long TIMEOUT = 3;
1919

2020
@Test
21-
public void socketAnalyzerAwaitPortSuccess() throws IOException, InterruptedException {
21+
void socketAnalyzerAwaitPortSuccess() throws IOException, InterruptedException {
2222
final int availablePort = findAvailablePort();
2323
try (ServerSocket ignored = new ServerSocket(availablePort)) {
2424
Assertions.assertFalse(SocketAnalyzer.awaitPortAvailable(availablePort, TIMEOUT, TimeUnit.SECONDS));

lighty-core/lighty-controller/src/test/java/io/lighty/core/controller/api/LightyModuleTest.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import org.junit.jupiter.api.Test;
2020
import org.mockito.Mockito;
2121

22-
public class LightyModuleTest {
22+
class LightyModuleTest {
2323
private static final long MAX_INIT_TIMEOUT = 15000L;
2424
private static final long MAX_SHUTDOWN_TIMEOUT = 15000L;
2525

@@ -39,17 +39,17 @@ private ExecutorService getExecutorService() {
3939
}
4040

4141
@BeforeEach
42-
public void initExecutor() {
42+
void initExecutor() {
4343
this.executorService = Mockito.spy(new ScheduledThreadPoolExecutor(1));
4444
}
4545

4646
@AfterEach
47-
public void shutdownExecutor() {
47+
void shutdownExecutor() {
4848
this.executorService.shutdownNow();
4949
}
5050

5151
@Test
52-
public void testStartShutdown() throws Exception {
52+
void testStartShutdown() throws Exception {
5353
this.moduleUnderTest = getModuleUnderTest(getExecutorService());
5454
this.moduleUnderTest.start().get(MAX_INIT_TIMEOUT, TimeUnit.MILLISECONDS);
5555
Mockito.verify(executorService, Mockito.times(1)).execute(Mockito.any());
@@ -58,7 +58,7 @@ public void testStartShutdown() throws Exception {
5858
}
5959

6060
@Test
61-
public void testStartStop_whenAlreadyStartedStopped() throws Exception {
61+
void testStartStop_whenAlreadyStartedStopped() throws Exception {
6262
this.moduleUnderTest = getModuleUnderTest(getExecutorService());
6363
try {
6464
this.moduleUnderTest.start().get(MAX_INIT_TIMEOUT, TimeUnit.MILLISECONDS);
@@ -74,7 +74,7 @@ public void testStartStop_whenAlreadyStartedStopped() throws Exception {
7474
}
7575

7676
@Test
77-
public void testShutdown_before_start() throws Exception {
77+
void testShutdown_before_start() throws Exception {
7878
this.moduleUnderTest = getModuleUnderTest(getExecutorService());
7979
this.moduleUnderTest.shutdown(MAX_SHUTDOWN_TIMEOUT, TimeUnit.MILLISECONDS);
8080
Mockito.verify(executorService, Mockito.times(0)).execute(Mockito.any());

lighty-core/lighty-controller/src/test/java/io/lighty/core/controller/api/SystemReadyMonitorTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@
1717
import org.opendaylight.infrautils.ready.SystemReadyListener;
1818
import org.opendaylight.infrautils.ready.SystemState;
1919

20-
public class SystemReadyMonitorTest {
20+
class SystemReadyMonitorTest {
2121

2222
@Test
23-
public void testSystemBootFailed() throws Exception {
23+
void testSystemBootFailed() throws Exception {
2424
SystemReadyListener listener1 = Mockito.mock(SystemReadyListener.class);
2525
SystemReadyListener listener2 = Mockito.mock(SystemReadyListener.class);
2626
LightySystemReadyMonitorImpl systemReadyMonitor = new LightySystemReadyMonitorImpl();
@@ -41,7 +41,7 @@ public void testSystemBootFailed() throws Exception {
4141
}
4242

4343
@Test
44-
public void testSystemBootOK() throws Exception {
44+
void testSystemBootOK() throws Exception {
4545
SystemReadyListener listener1 = Mockito.mock(SystemReadyListener.class);
4646
SystemReadyListener listener2 = Mockito.mock(SystemReadyListener.class);
4747
LightySystemReadyMonitorImpl systemReadyMonitor = new LightySystemReadyMonitorImpl();

lighty-core/lighty-controller/src/test/java/io/lighty/core/controller/impl/tests/LightyControllerTestBase.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
import org.slf4j.Logger;
2525
import org.slf4j.LoggerFactory;
2626

27-
public abstract class LightyControllerTestBase {
27+
abstract class LightyControllerTestBase {
2828

2929
private static final Logger LOG = LoggerFactory.getLogger(LightyControllerTestBase.class);
3030
public static final long SHUTDOWN_TIMEOUT_MILLIS = 60_000;
@@ -60,7 +60,7 @@ public void testDisabled(ExtensionContext context, Optional<String> reason) {
6060
};
6161

6262
@BeforeAll
63-
public static void startLighty() throws Exception {
63+
static void startLighty() throws Exception {
6464
LOG.info("startLighty from TestBase called");
6565
LightyControllerBuilder lightyControllerBuilder = new LightyControllerBuilder();
6666
lightyController = lightyControllerBuilder.from(ControllerConfigUtils.getDefaultSingleNodeConfiguration())
@@ -71,13 +71,13 @@ public static void startLighty() throws Exception {
7171
}
7272

7373
@BeforeEach
74-
public void handleTestMethodName(TestInfo testInfo) {
74+
void handleTestMethodName(TestInfo testInfo) {
7575
String testName = testInfo.getTestMethod().map(Method::getName).orElse(testInfo.getDisplayName());
7676
LOG.info("Running test {}", testName);
7777
}
7878

7979
@AfterAll
80-
public static void shutdownLighty() {
80+
static void shutdownLighty() {
8181
if (lightyController != null) {
8282
LOG.info("Shutting down Lighty controller");
8383
lightyController.shutdown(SHUTDOWN_TIMEOUT_MILLIS, TimeUnit.MILLISECONDS);

lighty-examples/lighty-community-netty-restconf-app/src/test/java/io/lighty/controllers/nettyrestconfapp/tests/RestconfAppTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class RestconfAppTest {
4141
private static RestClient restClient;
4242

4343
@BeforeAll
44-
public static void init() {
44+
static void init() {
4545
restconfApp = new Main();
4646
restconfApp.start(new String[]{CONFIG.getPath()}, false);
4747
restClient = new RestClient("http://localhost:8888/");
@@ -87,7 +87,7 @@ void simpleAuthorizationTest() throws IOException, InterruptedException {
8787

8888
@SuppressWarnings("checkstyle:illegalCatch")
8989
@AfterAll
90-
public static void shutdown() {
90+
static void shutdown() {
9191
restconfApp.shutdown();
9292
try {
9393
restClient.close();

lighty-examples/lighty-community-restconf-actions-app/src/test/java/io/lighty/examples/controller/actions/RestconfActionsAppTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class RestconfActionsAppTest {
4242
private static RestClient restClient;
4343

4444
@BeforeAll
45-
public static void init() {
45+
static void init() {
4646
restconfApp = new Main();
4747
restconfApp.start();
4848
restClient = new RestClient("http://localhost:8888/");
@@ -105,7 +105,7 @@ void bindingActionInvocationTest() throws Exception {
105105

106106
@SuppressWarnings("checkstyle:illegalCatch")
107107
@AfterAll
108-
public static void shutdown() {
108+
static void shutdown() {
109109
restconfApp.shutdown();
110110
try {
111111
restClient.close();

lighty-examples/lighty-community-restconf-netconf-app/src/test/java/io/lighty/examples/controllers/restconfapp/tests/RestconfAppTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class RestconfAppTest {
3434
private static RestClient restClient;
3535

3636
@BeforeAll
37-
public static void init() {
37+
static void init() {
3838
restconfApp = new Main();
3939
restconfApp.start();
4040
restClient = new RestClient("http://localhost:8888/");
@@ -78,7 +78,7 @@ void openApiURLsTest() throws IOException, InterruptedException {
7878

7979
@SuppressWarnings("checkstyle:illegalCatch")
8080
@AfterAll
81-
public static void shutdown() {
81+
static void shutdown() {
8282
restconfApp.shutdown();
8383
try {
8484
restClient.close();

lighty-modules/integration-tests-aaa/src/test/java/io/lighty/kit/examples/community/tests/AAATestIT.java

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
import org.slf4j.LoggerFactory;
4040

4141
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
42-
public class AAATestIT {
42+
class AAATestIT {
4343

4444
private static final Logger LOG = LoggerFactory.getLogger(AAATestIT.class);
4545
public static final long SHUTDOWN_TIMEOUT_MILLIS = 60_000;
@@ -78,7 +78,7 @@ public class AAATestIT {
7878
private Main main;
7979

8080
@BeforeAll
81-
public void initClass() throws Exception {
81+
void initClass() throws Exception {
8282
LOG.info("init restconf and controller");
8383
this.main = new Main();
8484
this.main.start(new String[]{}, false);
@@ -96,7 +96,7 @@ public void initClass() throws Exception {
9696
}
9797

9898
@BeforeEach
99-
public void init() throws Exception {
99+
void init() throws Exception {
100100
LOG.info("start all http clients");
101101
httpClient = new HttpClient();
102102
httpClient.setIdleTimeout(60000 * 60);
@@ -113,7 +113,7 @@ public void init() throws Exception {
113113
}
114114

115115
@Test
116-
public void getAndCheckDefaultAdminUsersTest() throws Exception {
116+
void getAndCheckDefaultAdminUsersTest() throws Exception {
117117
LOG.info("Get all user tests");
118118

119119
assertUsersExist(adminConnectionCorrect, UserDetails.of(ADMIN, ADMIN_DESCRIPTION, ADMIN_SDN));
@@ -127,7 +127,7 @@ public void getAndCheckDefaultAdminUsersTest() throws Exception {
127127
}
128128

129129
@Test
130-
public void addUserTest() throws Exception {
130+
void addUserTest() throws Exception {
131131
LOG.info("Add new user test");
132132

133133
final ContentResponse getAllUsersExpectOne = getAllUsers(adminConnectionCorrect);
@@ -160,7 +160,7 @@ public void addUserTest() throws Exception {
160160
}
161161

162162
@Test
163-
public void getSpecificUsersTest() throws Exception {
163+
void getSpecificUsersTest() throws Exception {
164164
LOG.info("get specific user test");
165165
assertEquals(addUser(adminConnectionCorrect, NEW_USER_DATA).getStatus(), HttpStatus.CREATED_201);
166166

@@ -178,7 +178,7 @@ public void getSpecificUsersTest() throws Exception {
178178
}
179179

180180
@Test
181-
public void updateUserInfoTest() throws Exception {
181+
void updateUserInfoTest() throws Exception {
182182
LOG.info("Update user data and try to use them");
183183
assertEquals(addUser(adminConnectionCorrect, NEW_USER_DATA).getStatus(), HttpStatus.CREATED_201);
184184
assertEquals(updateUser(adminConnectionCorrect, NEW_USER_SDN, UPDATE_USER_DATA).getStatus(), HttpStatus.OK_200);
@@ -201,7 +201,7 @@ public void updateUserInfoTest() throws Exception {
201201
}
202202

203203
@Test
204-
public void deleteUserTest() throws Exception {
204+
void deleteUserTest() throws Exception {
205205
LOG.info("delete user");
206206
assertEquals(addUser(adminConnectionCorrect, NEW_USER_DATA).getStatus(), HttpStatus.CREATED_201);
207207

@@ -210,25 +210,25 @@ public void deleteUserTest() throws Exception {
210210
}
211211

212212
@Test
213-
public void readNotExistingUserExpectError() throws Exception {
213+
void readNotExistingUserExpectError() throws Exception {
214214
LOG.info("get specific not existing user");
215215
assertEquals(getSpecificUser(adminConnectionCorrect, NEW_USER).getStatus(), HttpStatus.NOT_FOUND_404);
216216
}
217217

218218
@Test
219-
public void deleteNotExistingUserExpectError() throws Exception {
219+
void deleteNotExistingUserExpectError() throws Exception {
220220
LOG.info("delete specific not existing user");
221221
assertEquals(deleteUser(adminConnectionCorrect, NEW_USER_SDN).getStatus(), HttpStatus.NOT_FOUND_404);
222222
}
223223

224224
@Test
225-
public void readDataCorrectCredentials() throws Exception {
225+
void readDataCorrectCredentials() throws Exception {
226226
LOG.info("try to get modules state with correct credentials");
227227
assertEquals(getSomeData(adminConnectionCorrect).getStatus(), HttpStatus.OK_200);
228228
}
229229

230230
@Test
231-
public void readDataWrongCredentials() throws Exception {
231+
void readDataWrongCredentials() throws Exception {
232232
LOG.info("try to get modules state with incorrect credentials");
233233
final Connection adminConnectionWrong = new Connection(httpClient, this.wrongAuth);
234234
assertEquals(getSomeData(adminConnectionWrong).getStatus(), HttpStatus.UNAUTHORIZED_401);
@@ -368,7 +368,7 @@ public void cleanUp() throws Exception {
368368
}
369369

370370
@AfterAll
371-
public void shutdown() {
371+
void shutdown() {
372372
LOG.info("removing db files");
373373
File currentDirFile = new File(".");
374374
String lightyTestsPath = currentDirFile.getAbsolutePath();

lighty-modules/lighty-gnmi/lighty-gnmi-sb/src/test/java/io/lighty/gnmi/southbound/mountpoint/codecs/YangInstanceNormToGnmiUpdateCodecTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class YangInstanceNormToGnmiUpdateCodecTest {
3030
private static YangInstanceNormToGnmiUpdateCodec codec;
3131

3232
@BeforeAll
33-
public static void init() throws IOException, YangLoadException, SchemaException, ConfigurationException {
33+
static void init() throws IOException, YangLoadException, SchemaException, ConfigurationException {
3434
testCases = new YangInstanceNormToGnmiUpdateTestCases();
3535
codec = new YangInstanceNormToGnmiUpdateCodec(
3636
testCases.getSchemaContextProvider(),

lighty-modules/lighty-netconf-sb/src/test/java/io/lighty/modules/southbound/netconf/tests/NetconfBaseServiceBaseTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
import org.opendaylight.yangtools.yang.xpath.impl.AntlrXPathParserFactory;
2828
import org.w3c.dom.Element;
2929

30-
public abstract class NetconfBaseServiceBaseTest {
30+
abstract class NetconfBaseServiceBaseTest {
3131

3232
protected static EffectiveModelContext effectiveModelContext;
3333
protected static MountPointContext mountContext;

0 commit comments

Comments
 (0)