IndexVolumeDaoImpl implements IndexVolumeDao { @Override public IndexVolume create(final IndexVolume indexVolume) { return genericDao.create(indexVolume); } @Inject  IndexVolumeDaoImpl(final IndexDbConnProvider indexDbConnProvider,
                       final ExpressionMapperFactory expressionMapperFactory); @Override IndexVolume create(final IndexVolume indexVolume); @Override IndexVolume update(IndexVolume indexVolume); @Override Optional<IndexVolume> fetch(final int id); @Override boolean delete(final int id); @Override List<IndexVolume> getAll(); @Override List<IndexVolume> getVolumesInGroupOnNode(final String groupName, final String nodeName); @Override List<IndexVolume> getVolumesInGroup(final String groupName); @Override void updateVolumeState(final int id,
                                  final Long updateTimeMs,
                                  final Long bytesUsed,
                                  final Long bytesFree,
                                  final Long bytesTotal); @Override ResultPage<IndexVolume> find(final ExpressionCriteria criteria);  }
@Test void testCreate() { final String nodeName = TestData.createNodeName(); final String path = TestData.createPath(); final var indexVolumeGroup = createGroup(TestData.createVolumeGroupName()); final IndexVolume created = createVolume(nodeName, path, indexVolumeGroup.getId()); assertThat(created).isNotNull(); final IndexVolume retrieved = indexVolumeDao.fetch(created.getId()).orElse(null); assertThat(Stream.of(created, retrieved)).allSatisfy(i -> { assertThat(i.getNodeName()).isEqualTo(nodeName); assertThat(i.getPath()).isEqualTo(path); }); indexVolumeDao.delete(retrieved.getId()); final IndexVolume retrievedAfterDelete = indexVolumeDao.fetch(created.getId()).orElse(null); assertThat(retrievedAfterDelete).isNull(); }