@Test public void testGetImageBehaviourWhenNoImage() { final UUID userId = UUID.randomUUID(); runWithRetry(store -> { InputStream image = store.getImageForUser(userId); assertThat(image, nullValue()); return null; }); }
public InputStream getImageForUser(UUID userId) { Long photoId = getPhotoStreamId(userId); if (photoId == null) { return null; } UserPhotosStreamStore streamStore = UserPhotosStreamStore.of(txnMgr, tables); return streamStore.loadStream(tx, photoId); }
ProfileStore { public InputStream getImageForUser(UUID userId) { Long photoId = getPhotoStreamId(userId); if (photoId == null) { return null; } UserPhotosStreamStore streamStore = UserPhotosStreamStore.of(txnMgr, tables); return streamStore.loadStream(tx, photoId); } }
ProfileStore { public InputStream getImageForUser(UUID userId) { Long photoId = getPhotoStreamId(userId); if (photoId == null) { return null; } UserPhotosStreamStore streamStore = UserPhotosStreamStore.of(txnMgr, tables); return streamStore.loadStream(tx, photoId); } ProfileStore(TransactionManager txnMgr, Transaction tx); }
ProfileStore { public InputStream getImageForUser(UUID userId) { Long photoId = getPhotoStreamId(userId); if (photoId == null) { return null; } UserPhotosStreamStore streamStore = UserPhotosStreamStore.of(txnMgr, tables); return streamStore.loadStream(tx, photoId); } ProfileStore(TransactionManager txnMgr, Transaction tx); UUID storeNewUser(UserProfile data); UserProfile getUserData(UUID userId); InputStream getImageForUser(UUID userId); void updateImage(UUID userId, Sha256Hash hash, InputStream imageData); void deleteImage(UUID userId); Set<UUID> getUsersWithBirthday(long birthEpochDays); }
ProfileStore { public InputStream getImageForUser(UUID userId) { Long photoId = getPhotoStreamId(userId); if (photoId == null) { return null; } UserPhotosStreamStore streamStore = UserPhotosStreamStore.of(txnMgr, tables); return streamStore.loadStream(tx, photoId); } ProfileStore(TransactionManager txnMgr, Transaction tx); UUID storeNewUser(UserProfile data); UserProfile getUserData(UUID userId); InputStream getImageForUser(UUID userId); void updateImage(UUID userId, Sha256Hash hash, InputStream imageData); void deleteImage(UUID userId); Set<UUID> getUsersWithBirthday(long birthEpochDays);  }