Relax registration checks for same servers somewhat.
If a server with the same ServerInfo is attempting to be re-registered, we will return the existing registered server, which is less surprising behavior than before.
This commit is contained in:
@@ -35,4 +35,12 @@ class ServerMapTest {
|
||||
ServerInfo willReject = new ServerInfo("TESTSERVER", TEST_ADDRESS);
|
||||
assertThrows(IllegalArgumentException.class, () -> map.register(willReject));
|
||||
}
|
||||
|
||||
@Test
|
||||
void allowsSameServerLaxRegistrationCheck() {
|
||||
ServerMap map = new ServerMap(null);
|
||||
ServerInfo info = new ServerInfo("TestServer", TEST_ADDRESS);
|
||||
RegisteredServer connection = map.register(info);
|
||||
assertEquals(connection, map.register(info));
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user