Skip to content

Commit f8922be

Browse files
Tobianasihrasko
authored andcommitted
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 bf6ea92 commit f8922be

21 files changed

Lines changed: 67 additions & 67 deletions

File tree

lighty-core/lighty-codecs-util/src/test/java/io/lighty/codecs/util/AbstractCodecTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
import org.opendaylight.yangtools.yang.xpath.impl.AntlrXPathParserFactory;
4949
import org.xml.sax.SAXException;
5050

51-
public abstract class AbstractCodecTest {
51+
abstract class AbstractCodecTest {
5252
protected static final QName MAKE_TOAST_RPC_QNAME = qOfToasterModel("make-toast");
5353
protected static final QName CONTAINER_RPC_QNAME = qOfTestModel("container-io-rpc");
5454
protected static final QName LEAF_RPC_QNAME = qOfTestModel("simple-input-output-rpc");
@@ -68,7 +68,7 @@ public abstract class AbstractCodecTest {
6868
protected final BindingCodecContext bindingCodecContext;
6969
protected final EffectiveModelContext effectiveModelContext;
7070

71-
public AbstractCodecTest() throws YangParserException {
71+
AbstractCodecTest() throws YangParserException {
7272
this.bindingCodecContext = createCodecContext(loadModuleInfos());
7373
this.effectiveModelContext = bindingCodecContext.getRuntimeContext().modelContext();
7474

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: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,15 @@
2121
import org.slf4j.Logger;
2222
import org.slf4j.LoggerFactory;
2323

24-
public abstract class LightyControllerTestBase {
24+
abstract class LightyControllerTestBase {
2525

2626
private static final Logger LOG = LoggerFactory.getLogger(LightyControllerTestBase.class);
2727
public static final long SHUTDOWN_TIMEOUT_MILLIS = 60_000;
2828

2929
private static LightyController lightyController;
3030

3131
@BeforeAll
32-
public static void startLighty() throws Exception {
32+
static void startLighty() throws Exception {
3333
LOG.info("startLighty from TestBase called");
3434
LightyControllerBuilder lightyControllerBuilder = new LightyControllerBuilder();
3535
lightyController = lightyControllerBuilder.from(ControllerConfigUtils.getDefaultSingleNodeConfiguration())
@@ -41,7 +41,7 @@ public static void startLighty() throws Exception {
4141
}
4242

4343
@BeforeEach
44-
public void handleTestMethodName(final TestInfo testInfo) {
44+
void handleTestMethodName(final TestInfo testInfo) {
4545
String testName = testInfo.getTestMethod()
4646
.map(Method::getName)
4747
.orElse("unknown");
@@ -50,7 +50,7 @@ public void handleTestMethodName(final TestInfo testInfo) {
5050
}
5151

5252
@AfterEach
53-
public void afterTest(final TestInfo testInfo) {
53+
void afterTest(final TestInfo testInfo) {
5454
String testName = testInfo.getTestMethod()
5555
.map(Method::getName)
5656
.orElse("unknown");
@@ -59,7 +59,7 @@ public void afterTest(final TestInfo testInfo) {
5959
}
6060

6161
@AfterAll
62-
public static void shutdownLighty() {
62+
static void shutdownLighty() {
6363
if (lightyController != null) {
6464
LOG.info("Shutting down Lighty controller");
6565
lightyController.shutdown(SHUTDOWN_TIMEOUT_MILLIS, TimeUnit.MILLISECONDS);

lighty-examples/lighty-community-aaa-restconf-app/src/test/java/io/lighty/kit/examples/community/CommunityAAARestconfAppTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,15 @@ class CommunityAAARestconfAppTest {
3737
private static Main main;
3838

3939
@BeforeAll
40-
public static void startUp() {
40+
static void startUp() {
4141
final URL config = CommunityAAARestconfAppTest.class.getResource(TEST_CONFIG_JSON);
4242
main = new Main();
4343
main.start(new String[]{config.getPath()}, false);
4444
httpClient = HttpClient.newHttpClient();
4545
}
4646

4747
@AfterAll
48-
public static void tearDown() {
48+
static void tearDown() {
4949
httpClient = null;
5050
main.shutdown();
5151
}

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-examples/lighty-controller-springboot-netconf/src/test/java/io/lighty/core/controller/springboot/test/SpringBootAppTest.java

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

4242
@BeforeAll
43-
public static void init() {
43+
static void init() {
4444
appContext = SpringApplication.run(MainApp.class, new String[]{});
4545
restClient = new RestClient("http://localhost:8888/");
4646
}
@@ -97,7 +97,7 @@ void simpleApplicationTest() throws Exception {
9797

9898
@SuppressWarnings("checkstyle:illegalCatch")
9999
@AfterAll
100-
public static void shutdown() {
100+
static void shutdown() {
101101
if (appContext != null) {
102102
appContext.stop();
103103
}

0 commit comments

Comments
 (0)