@Test
void setEnabled() {

    initSingleNode();
    final String subPath = ResourcePaths.buildPath("1", JobNodeResource.ENABLED_PATH_PART);
    final boolean newIsEnabled = true;
    doPutTest(
        subPath,
        newIsEnabled);
    final ArgumentCaptor<JobNode> jobNodeCaptor = ArgumentCaptor.forClass(JobNode.class);
    verify(jobNodeServiceMap.get("node1"), times(1))
        .update(jobNodeCaptor.capture());
    assertThat(jobNodeCaptor.getValue().isEnabled())
        .isEqualTo(newIsEnabled);
    final ArgumentCaptor<JobNode> beforeCaptor = ArgumentCaptor.forClass(JobNode.class);
    final ArgumentCaptor<JobNode> afterCaptor = ArgumentCaptor.forClass(JobNode.class);
    verify(documentEventLogMap.get("node1"), times(1))
        .update(beforeCaptor.capture(), afterCaptor.capture(), any());
    // equal apart from version
    assertThat(beforeCaptor.getValue())
        .isEqualTo(afterCaptor.getValue());
    assertThat(beforeCaptor.getValue().getVersion())
        .isNotEqualTo(afterCaptor.getValue().getVersion());
    assertThat(afterCaptor.getValue().isEnabled())
        .isEqualTo(newIsEnabled);
    assertThat(afterCaptor.getValue().isEnabled())
        .isNotEqualTo(JOB_NODE_1.isEnabled());
}