Skip to content

Commit

Permalink
Test pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
HttpMarco committed Nov 29, 2024
1 parent 3fdc69a commit e8d3014
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import dev.httpmarco.netline.packet.common.BroadcastPacket;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.jetbrains.annotations.NotNull;

public final class NetClientHandler extends NetCompHandler {

Expand Down Expand Up @@ -36,7 +37,7 @@ public void handshakeChannel(NetChannel netChannel) {
}

@Override
public void broadcastDefinition(NetChannel incoming, BroadcastPacket packet) {
public void broadcastDefinition(NetChannel incoming, @NotNull BroadcastPacket packet) {
netClient.callTracking(incoming, packet.packet());
}
}
10 changes: 7 additions & 3 deletions src/test/java/dev/httpmarco/netline/tests/SecurityListTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

@TestMethodOrder(MethodOrderer.OrderAnnotation.class)
@DisplayName("3 - White-/Blacklist test")
public class SecurityListTest {
public final class SecurityListTest {

private static NetServer server;

Expand All @@ -28,7 +28,7 @@ public static void createTestSetup() {
@Test
@Order(1)
@DisplayName("3.1 Test hostname whitelist")
public void testHostNameWhitelist() {
public void testHostNameWhitelist() throws InterruptedException {
var result = new AtomicBoolean(false);
var whitelistedIp = "127.0.0.2";

Expand All @@ -38,6 +38,8 @@ public void testHostNameWhitelist() {
var testClient = Net.line().client();
testClient.bootSync();

Thread.sleep(1000);

if(testClient.state() == NetClientState.CONNECTED) {
testClient.closeSync();
assert false;
Expand All @@ -53,7 +55,7 @@ public void testHostNameWhitelist() {
@Test
@Order(2)
@DisplayName("3.2 Test hostname blacklist")
public void testBlacklist() {
public void testBlacklist() throws InterruptedException {
var result = new AtomicBoolean(false);
var blockedIp = "127.0.0.1";

Expand All @@ -64,6 +66,8 @@ public void testBlacklist() {
var testClient = Net.line().client();
testClient.bootSync();

Thread.sleep(1000);

if(testClient.state() == NetClientState.CONNECTED) {
testClient.closeSync();
assert false;
Expand Down

0 comments on commit e8d3014

Please sign in to comment.