@Test
public void tryLock_nullPrepThenException() {

    // given
    String preparationId = "preparation id";
    when(preparationRepository.get(preparationId, Preparation.class)).thenReturn(null);
    // when
    try {
        noOpLockedResourceRepository.tryLock(preparationId, "toto", "Toto de Charleville-Mézières");
        fail();
    } catch (TDPException e) {
        // then
        assertEquals(e.getCode(), PREPARATION_DOES_NOT_EXIST);
    }
    verify(preparationRepository).get(preparationId, PersistentPreparation.class);
}