@Test
public void shouldFailIfVersionNotVerified() {

    given(verifier.isValidVersion(anyString())).willReturn(false);
    mockServer.expect().withPath("/api/info")
            .andReturn(200, "{\"version\":\"0.59.0\"}").once();
    RocketChatVerifier.checkServerVersion(client, baseUrl.toString(), verifier, callback);
    verify(callback, timeout(1000).times(1))
            .onError(exceptionCaptor.capture());
    assertThat(exceptionCaptor.getValue(), is(instanceOf(RocketChatException.class)));
    assertThat(exceptionCaptor.getValue().getMessage(),
            is(equalTo("Unsupported version: 0.59.0")));
}