@Test
public void shouldUpdateDataSetName() {

    // given
    final DataSetMetadata metadata = new DataSetMetadata();
    metadata.setId("ds-1234");
    metadata.setName("My updated name");
    final PersistentPreparation preparation = mock(PersistentPreparation.class);
    when(preparationRepository.list(eq(PersistentPreparation.class), eq(TqlBuilder.eq("dataSetId", "ds-1234"))))
            .thenReturn(Stream.of(preparation), Stream.of(preparation));
    when(datasetClient.getDataSetMetadata(eq("ds-1234"))).thenReturn(metadata);
    // when
    preparationEventUtil.performUpdateEvent(metadata.getId());
    // then
    verify(preparation, times(1)).setDataSetName(eq("My updated name"));
}