@Test(expected = IOException.class)
public void should_throw_IOException_when_error_occurs_while_saving_a_object() throws Exception {

    doThrow(new RuntimeException()).when(objectMapper).toJson(anyObject(), any(Class.class));
    repository.save(repoDirectory, new SimpleDesignerArtifact());
}