@Test
public void testSetupServer() throws UnknownHostException {

    Map config = new LinkedHashMap<>();
    
    config.put("authToken", new Object());
    
    try {
        ConfigurableUDPSource.setupServer(config);
        assert false; // Should throw RTE for an invalid or missing authToken
    } catch (RuntimeException e) {}
    
    config.put("authToken", "token");
    config.put("targetServer", "ws://localhost:8080");
    
    ConfigurableUDPSource.setupServer(config); // Should not throw RTE
    
    // check defaults
    assert ConfigurableUDPSource.targetVantiqServer.equals("ws://localhost:8080");
    assert ConfigurableUDPSource.MAX_UDP_DATA == 1024;
    assert ConfigurableUDPSource.LISTENING_PORT == 3141;
    assert ConfigurableUDPSource.LISTENING_ADDRESS.equals(InetAddress.getLocalHost());
    assert ConfigurableUDPSource.authToken.equals("token");
    
    
    config.put("maxPacketSize", 2048);
    config.put("defaultBindPort", 10213);
    config.put("defaultBindAddress", "localhost");
    config.put("authToken", "new token");
    
    ConfigurableUDPSource.setupServer(config);
    
    assert ConfigurableUDPSource.targetVantiqServer.equals("ws://localhost:8080");
    assert ConfigurableUDPSource.MAX_UDP_DATA == 2048;
    assert ConfigurableUDPSource.LISTENING_PORT == 10213;
    assert ConfigurableUDPSource.LISTENING_ADDRESS.equals(InetAddress.getByName("localhost"));
    assert ConfigurableUDPSource.authToken.equals("new token");
    
    // reset it back to defaults
    config = new LinkedHashMap<>();
    config.put("authToken", "token");
    config.put("targetServer", "ws://localhost:8080");
    
    ConfigurableUDPSource.setupServer(config);
}