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

    SimpleDesignerArtifact object1 = aSimpleObjectBuilder().id("objet1").build();
    //My second object contains the first
    SimpleDesignerArtifact object2 = aSimpleObjectBuilder().id("objet2").another(object1).build();
    addToRepository(object1, object2);
    doThrow(new IOException()).when(objectMapper).fromJson(any(byte[].class), eq(SimpleDesignerArtifact.class));
    loader.findByObjectId(repoDirectory, "objet1");
}