@Test
void testCreateWithDuplicateName() {

    // Given
    final Long now = System.currentTimeMillis();
    final String groupName = TestData.createVolumeGroupName();
    // When
    final IndexVolumeGroup createdOnce = createGroup(groupName);
    final Long createdTimeMs = createdOnce.getCreateTimeMs();
    assertThat(createdTimeMs).isCloseTo(now, Offset.offset(100L));
    final IndexVolumeGroup retrievedOnce = indexVolumeGroupDao.get(createdOnce.getId());
    // Put some delay in it, so that the audit time fields will definitely be different
    try {
        Thread.sleep(100);
    } catch (InterruptedException e) {
        e.printStackTrace();
    }
    final IndexVolumeGroup createdTwice = createGroup(groupName);
    final IndexVolumeGroup retrievedTwice = indexVolumeGroupDao.get(createdTwice.getId());
    // Make sure they are all the same
    assertThat(Stream.of(createdOnce, retrievedOnce, createdTwice, retrievedTwice))
            .allSatisfy(i -> {
                assertThat(i.getCreateTimeMs()).isEqualTo(createdTimeMs);
                assertThat(i.getUpdateTimeMs()).isEqualTo(createdTimeMs);
                assertThat(i.getCreateUser()).isEqualTo(TestModule.TEST_USER);
                assertThat(i.getUpdateUser()).isEqualTo(TestModule.TEST_USER);
            });
}