@Test
public void shouldSubmitSetCommandWhenSetIsCalled() throws Exception {

    String key = "KEY";
    String value = "VALUE";
    SetValue setValue = new SetValue();
    setValue.setNewValue(value);
    when(raftAgent.submitCommand(any(KayVeeCommand.class))).thenReturn(SettableFuture.<Void>create());
    initializeAndStartDistributedStore();
    ListenableFuture<KeyValue> setFuture = distributedStore.set(key, setValue);
    assertThat(setFuture.isDone(), equalTo(false));
    ArgumentCaptor<Command> captor = ArgumentCaptor.forClass(Command.class);
    verify(raftAgent).submitCommand(captor.capture());
    KayVeeCommand.SETCommand setCommand = (KayVeeCommand.SETCommand) captor.getValue();
    assertThat(setCommand.getKey(), equalTo(key));
    assertThat(setCommand.getNewValue(), equalTo(value));
    stopDistributedStore();
}