@Test public void shouldRemoveAttachmentInfoFromMapsSetNullAsFileName() { tested.removeAttachmentInfoFromMaps(mapRepository, MONGO_ID); maps.forEach(map -> Assert.assertNull(map.getAttachmentFileName())); }
protected void removeAttachmentInfoFromMaps(MapRepository mapRepository, String mongoId) { final List<Map> maps = mapRepository.findAllByAttachmentMongoId(mongoId); maps.stream().forEach(map -> { map.setAttachmentFileName(null); map.setAttachmentMongoId(null); }); mapRepository.save(maps); }
MapAttachmentService extends SingleAttachmentService implements ISingleAttachmentService { protected void removeAttachmentInfoFromMaps(MapRepository mapRepository, String mongoId) { final List<Map> maps = mapRepository.findAllByAttachmentMongoId(mongoId); maps.stream().forEach(map -> { map.setAttachmentFileName(null); map.setAttachmentMongoId(null); }); mapRepository.save(maps); } }
MapAttachmentService extends SingleAttachmentService implements ISingleAttachmentService { protected void removeAttachmentInfoFromMaps(MapRepository mapRepository, String mongoId) { final List<Map> maps = mapRepository.findAllByAttachmentMongoId(mongoId); maps.stream().forEach(map -> { map.setAttachmentFileName(null); map.setAttachmentMongoId(null); }); mapRepository.save(maps); } MapAttachmentService(@NonNull final FileRepository fileRepository,
                                @NonNull final MapRepository mapRepository); }
MapAttachmentService extends SingleAttachmentService implements ISingleAttachmentService { protected void removeAttachmentInfoFromMaps(MapRepository mapRepository, String mongoId) { final List<Map> maps = mapRepository.findAllByAttachmentMongoId(mongoId); maps.stream().forEach(map -> { map.setAttachmentFileName(null); map.setAttachmentMongoId(null); }); mapRepository.save(maps); } MapAttachmentService(@NonNull final FileRepository fileRepository,
                                @NonNull final MapRepository mapRepository); void deleteFile(@NonNull final String fileId); }
MapAttachmentService extends SingleAttachmentService implements ISingleAttachmentService { protected void removeAttachmentInfoFromMaps(MapRepository mapRepository, String mongoId) { final List<Map> maps = mapRepository.findAllByAttachmentMongoId(mongoId); maps.stream().forEach(map -> { map.setAttachmentFileName(null); map.setAttachmentMongoId(null); }); mapRepository.save(maps); } MapAttachmentService(@NonNull final FileRepository fileRepository,
                                @NonNull final MapRepository mapRepository); void deleteFile(@NonNull final String fileId);  }