Skip to content

Commit

Permalink
Fix AssertionError
Browse files Browse the repository at this point in the history
  • Loading branch information
acrylic-style committed May 25, 2022
1 parent 1d4dbd6 commit 3656418
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 2 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Test
on:
push:
branches:
- '*'
jobs:
test:
runs-on: ubuntu-latest
name: "Test"
steps:
- uses: actions/checkout@v2
- name: Setup git
run: 'git config --global user.email "[email protected]" && git config --global user.name "GitHub Actions"'
- name: Setup Java JDK
uses: actions/[email protected]
with:
java-version: 17
distribution: temurin
cache: 'gradle'
- name: Run tests
run: ./gradlew clean test
1 change: 1 addition & 0 deletions api/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ dependencies {
api("org.yaml:snakeyaml:1.30")
compileOnlyApi("org.jetbrains:annotations:23.0.0")
compileOnlyApi("net.luckperms:api:5.4")
testRuntimeOnly("net.luckperms:api:5.4")
}
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ public final class Protocol<T extends MessageHandler<M>, M extends Message> {
public static final Protocol<ProxyboundToggleGamingSaraPacket, PlayerMessage> P_TOGGLE_GAMING_SARA = new Protocol<>(PacketFlow.TO_PROXY, 0x04, new ProxyboundToggleGamingSaraPacket());
public static final Protocol<ProxyboundToggleSaraHidePacket, PlayerMessage> P_TOGGLE_SARA_HIDE = new Protocol<>(PacketFlow.TO_PROXY, 0x05, new ProxyboundToggleSaraHidePacket()); // non-contextual
public static final Protocol<ProxyboundToggleSaraShowPacket, PlayerWithServerMessage> P_TOGGLE_SARA_SHOW = new Protocol<>(PacketFlow.TO_PROXY, 0x06, new ProxyboundToggleSaraShowPacket()); // contextual
public static final Protocol<ProxyboundSetPrefixPacket, ProxyboundSetPrefixMessage> P_SET_PREFIX = new Protocol<>(PacketFlow.TO_PROXY, 0x06, new ProxyboundSetPrefixPacket());
public static final Protocol<ProxyboundClearPrefixPacket, ProxyboundClearPrefixMessage> P_CLEAR_PREFIX = new Protocol<>(PacketFlow.TO_PROXY, 0x06, new ProxyboundClearPrefixPacket());
public static final Protocol<ProxyboundSetPrefixPacket, ProxyboundSetPrefixMessage> P_SET_PREFIX = new Protocol<>(PacketFlow.TO_PROXY, 0x07, new ProxyboundSetPrefixPacket());
public static final Protocol<ProxyboundClearPrefixPacket, ProxyboundClearPrefixMessage> P_CLEAR_PREFIX = new Protocol<>(PacketFlow.TO_PROXY, 0x08, new ProxyboundClearPrefixPacket());

public static final Protocol<ServerboundEncryptionPacket, EncryptionMessage> S_ENCRYPTION = new Protocol<>(PacketFlow.TO_SERVER, 0x00, new ServerboundEncryptionPacket());
public static final Protocol<ServerboundActionResponsePacket, ServerboundActionResponseMessage> S_ACTION_RESPONSE = new Protocol<>(PacketFlow.TO_SERVER, 0x01, new ServerboundActionResponsePacket());
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package net.azisaba.azipluginmessaging.test;

import net.azisaba.azipluginmessaging.api.protocol.PacketFlow;
import net.azisaba.azipluginmessaging.api.protocol.Protocol;
import org.junit.jupiter.api.Test;

public class ProtocolTest {
@Test
public void load() {
Protocol.getById(PacketFlow.TO_SERVER, (byte) 0);
}
}
11 changes: 11 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,17 @@ subprojects {
repositories {
mavenCentral()
}

dependencies {
testImplementation("org.junit.jupiter:junit-jupiter-api:5.8.2")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.8.2")
}

tasks {
test {
useJUnitPlatform()
}
}
}

allprojects {
Expand Down
Empty file modified gradlew
100644 → 100755
Empty file.

0 comments on commit 3656418

Please sign in to comment.