@Test
    void testModeSwitch() {
        ProxyServer proxy = createTestServer(source, client);
        assertTrue(proxy.getMode().isDefault());

        for (String mode : Mode.modes()) {
            proxy.setMode(mode);
            assertEquals(mode, proxy.getMode().name());
        }

        // Try setting an invalid mode
        try {
            proxy.setMode("invalid");
            assert (false);
        } catch (IllegalArgumentException e) {
            assertEquals("Unrecognized mode 'invalid' supplied. Legal modes are '" + Mode.modes() + "'", e.getMessage());
        }

        // Also switch to DEFAULT mode, as that is not covered above
        proxy.setMode("default");
        assertTrue(proxy.getMode().isDefault());

        // Set mode to the same as the current mode
        proxy.setMode(proxy.getMode().name());
        assertTrue(proxy.getMode().isDefault());

        proxy.stop();
    }
Tests that the proxy server RPC commands for setting and getting mode works..
config-proxy/src/test/java/com/yahoo/vespa/config/proxy/ProxyServerTest.java