@Test
public void testStoreDataFile_alreadyInDb() {

    final String path = "/path/to/wherever";
    final DataFile dataFile = new DataFile(path, new SensorBuilder().name("Firlefanz").build());
    when(mockStorage.getDatafile(path)).thenReturn(dataFile);
    try {
        MmdIngestionTool.storeDataFile(dataFile, mockStorage);
        fail("IllegalStateException expected");
    } catch (IllegalStateException expected) {
    }
    verify(mockStorage, times(1)).getDatafile(path);
    verifyNoMoreInteractions(mockStorage);
}