Skip to content

Commit 9c1be72

Browse files
committed
Fix tests
1 parent 747f70d commit 9c1be72

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

proxy/src/test/java/com/velocitypowered/proxy/util/VelocityChannelRegistrarTest.java

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,10 @@
2020
import static org.junit.jupiter.api.Assertions.assertEquals;
2121

2222
import com.google.common.collect.ImmutableSet;
23+
import com.velocitypowered.api.proxy.messages.ChannelIdentifier;
2324
import com.velocitypowered.api.proxy.messages.LegacyChannelIdentifier;
2425
import com.velocitypowered.api.proxy.messages.MinecraftChannelIdentifier;
26+
import java.util.stream.Collectors;
2527
import org.junit.jupiter.api.Test;
2628

2729
class VelocityChannelRegistrarTest {
@@ -46,9 +48,9 @@ void register() {
4648
// Two channels cover the modern channel (velocity:test) and the legacy-mapped channel
4749
// (legacy:velocitytest). Make sure they're what we expect.
4850
assertEquals(ImmutableSet.of(MODERN.getId(), SIMPLE_LEGACY_REMAPPED), registrar
49-
.getModernChannelIds());
51+
.getModernChannelIds().stream().map(ChannelIdentifier::getId).collect(Collectors.toSet()));
5052
assertEquals(ImmutableSet.of(SIMPLE_LEGACY.getId(), MODERN.getId()), registrar
51-
.getLegacyChannelIds());
53+
.getLegacyChannelIds().stream().map(ChannelIdentifier::getId).collect(Collectors.toSet()));
5254
}
5355

5456
@Test
@@ -57,9 +59,10 @@ void registerSpecialRewrite() {
5759
registrar.register(SPECIAL_REMAP_LEGACY, MODERN_SPECIAL_REMAP);
5860

5961
// This one, just one channel for the modern case.
60-
assertEquals(ImmutableSet.of(MODERN_SPECIAL_REMAP.getId()), registrar.getModernChannelIds());
62+
assertEquals(ImmutableSet.of(MODERN_SPECIAL_REMAP.getId()),
63+
registrar.getModernChannelIds().stream().map(ChannelIdentifier::getId).collect(Collectors.toSet()));
6164
assertEquals(ImmutableSet.of(MODERN_SPECIAL_REMAP.getId(), SPECIAL_REMAP_LEGACY.getId()),
62-
registrar.getLegacyChannelIds());
65+
registrar.getLegacyChannelIds().stream().map(ChannelIdentifier::getId).collect(Collectors.toSet()));
6366
}
6467

6568
@Test
@@ -68,7 +71,9 @@ void unregister() {
6871
registrar.register(MODERN, SIMPLE_LEGACY);
6972
registrar.unregister(SIMPLE_LEGACY);
7073

71-
assertEquals(ImmutableSet.of(MODERN.getId()), registrar.getModernChannelIds());
72-
assertEquals(ImmutableSet.of(MODERN.getId()), registrar.getLegacyChannelIds());
74+
assertEquals(ImmutableSet.of(MODERN.getId()),
75+
registrar.getModernChannelIds().stream().map(ChannelIdentifier::getId).collect(Collectors.toSet()));;
76+
assertEquals(ImmutableSet.of(MODERN.getId()),
77+
registrar.getLegacyChannelIds().stream().map(ChannelIdentifier::getId).collect(Collectors.toSet()));
7378
}
7479
}

0 commit comments

Comments
 (0)