@Inject
    public ConfigSentinelClient() {
        supervisor = new Supervisor(new Transport("sentinel-client")).setDropEmptyBuffers(true);
    }
@Test
    public void testConfigSentinelClient() {
        ConfigSentinelDummy configsentinel = new ConfigSentinelDummy();
        List<VespaService> services = new ArrayList<>();
        VespaService docproc = new VespaService("docprocservice", "docproc/cluster.x.indexing/0");
        VespaService searchnode4 = new VespaService("searchnode4", "search/cluster.x/g0/c1/r1");
        VespaService container = new VespaService("container", "container/default.0");

        services.add(searchnode4);
        services.add(container);
        services.add(docproc);

        try (MockConfigSentinelClient client = new MockConfigSentinelClient(configsentinel)) {
            client.updateServiceStatuses(services);

            assertEquals(6520, container.getPid());
            assertEquals("RUNNING", container.getState());
            assertTrue(container.isAlive());
            assertEquals(6534, searchnode4.getPid());
            assertEquals("RUNNING", searchnode4.getState());
            assertTrue(searchnode4.isAlive());

            assertEquals(-1, docproc.getPid());
            assertEquals("FINISHED", docproc.getState());
            assertFalse(docproc.isAlive());


            configsentinel.reConfigure();

            client.ping(docproc);
            assertEquals(100, docproc.getPid());
            assertEquals("RUNNING", docproc.getState());
            assertTrue(docproc.isAlive());

            // container has yet not been checked
            assertTrue(container.isAlive());

            client.updateServiceStatuses(services);

            assertEquals(100, docproc.getPid());
            assertEquals("RUNNING", docproc.getState());
            assertTrue(docproc.isAlive());
            // container is no longer running on this node - so should be false
            assertFalse(container.isAlive());
        }
    }