public void updateStatus(final String id, final String status) {
        Optional<InstanceState> instanceState = InstanceState.get(status);
        if (!instanceState.isPresent()) {
            return;
        }
        if (instance.getMetaData().getId().equals(id)) {
            instance.switchState(instanceState.get());
        }
        updateRelatedComputeNodeInstancesStatus(id, instanceState.get());
    }
@Test
    void assertUpdateComputeNodeState() {
        InstanceMetaData instanceMetaData = mock(InstanceMetaData.class);
        when(instanceMetaData.getId()).thenReturn("foo_instance_id");
        ComputeNodeInstanceContext context = new ComputeNodeInstanceContext(
                new ComputeNodeInstance(instanceMetaData), mock(WorkerIdGenerator.class), modeConfig, lockContext, eventBusContext);
        InstanceState actual = context.getInstance().getState().getCurrentState();
        assertThat(actual, is(InstanceState.OK));
        context.updateStatus(instanceMetaData.getId(), InstanceState.CIRCUIT_BREAK.name());
        actual = context.getInstance().getState().getCurrentState();
        assertThat(actual, is(InstanceState.CIRCUIT_BREAK));
        context.updateStatus(instanceMetaData.getId(), InstanceState.OK.name());
        actual = context.getInstance().getState().getCurrentState();
        assertThat(actual, is(InstanceState.OK));
    }