13
0
geforkt von Mirrors/Velocity
Dieser Commit ist enthalten in:
Andrew Steinborn 2019-05-15 17:10:07 -04:00
Ursprung 6d42a3c37c
Commit 552f02ed60
3 geänderte Dateien mit 11 neuen und 4 gelöschten Zeilen

Datei anzeigen

@ -57,6 +57,11 @@ public class VelocityChannelRegistrar implements ChannelRegistrar {
} }
} }
/**
* Returns all legacy channel IDs.
*
* @return all legacy channel IDs
*/
public Collection<String> getLegacyChannelIds() { public Collection<String> getLegacyChannelIds() {
Collection<String> ids = new HashSet<>(); Collection<String> ids = new HashSet<>();
for (ChannelIdentifier value : identifierMap.values()) { for (ChannelIdentifier value : identifierMap.values()) {

Datei anzeigen

@ -1,6 +1,6 @@
package com.velocitypowered.proxy.protocol.util; package com.velocitypowered.proxy.protocol.util;
import static org.junit.jupiter.api.Assertions.*; import static org.junit.jupiter.api.Assertions.assertEquals;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;

Datei anzeigen

@ -1,6 +1,6 @@
package com.velocitypowered.proxy.util; package com.velocitypowered.proxy.util;
import static org.junit.jupiter.api.Assertions.*; import static org.junit.jupiter.api.Assertions.assertEquals;
import com.google.common.collect.ImmutableSet; import com.google.common.collect.ImmutableSet;
import com.velocitypowered.api.proxy.messages.LegacyChannelIdentifier; import com.velocitypowered.api.proxy.messages.LegacyChannelIdentifier;
@ -28,8 +28,10 @@ class VelocityChannelRegistrarTest {
// Two channels cover the modern channel (velocity:test) and the legacy-mapped channel // Two channels cover the modern channel (velocity:test) and the legacy-mapped channel
// (legacy:velocitytest). Make sure they're what we expect. // (legacy:velocitytest). Make sure they're what we expect.
assertEquals(ImmutableSet.of(MODERN.getId(), SIMPLE_LEGACY_REMAPPED), registrar.getModernChannelIds()); assertEquals(ImmutableSet.of(MODERN.getId(), SIMPLE_LEGACY_REMAPPED), registrar
assertEquals(ImmutableSet.of(SIMPLE_LEGACY.getId(), MODERN.getId()), registrar.getLegacyChannelIds()); .getModernChannelIds());
assertEquals(ImmutableSet.of(SIMPLE_LEGACY.getId(), MODERN.getId()), registrar
.getLegacyChannelIds());
} }
@Test @Test