@Test public void testUpdateCachedEntityNameChanging() { final String existingDisplayName = "abcdefg"; final String newDisplayName = "ABCDEFG"; ActivityDTO activity = new ActivityDTO(); StreamEntityDTO destinationStream = new StreamEntityDTO(); destinationStream.setDisplayName(existingDisplayName); activity.setDestinationStream(destinationStream); assertTrue(sut.updateCachedEntity(activity, newDisplayName)); assertEquals(newDisplayName, destinationStream.getDisplayName()); }
@Override protected Boolean updateCachedEntity(final ActivityDTO inCachedItem, final String inUpdatedDestinationStreamName) { StreamEntityDTO destinationStream = inCachedItem.getDestinationStream(); if (destinationStream.getDisplayName().equals(inUpdatedDestinationStreamName)) { return false; } destinationStream.setDisplayName(inUpdatedDestinationStreamName); return true; }
UpdateDestinationStreamNameInCachedActivity extends UpdateCachedItemsByIds<ActivityDTO, String> { @Override protected Boolean updateCachedEntity(final ActivityDTO inCachedItem, final String inUpdatedDestinationStreamName) { StreamEntityDTO destinationStream = inCachedItem.getDestinationStream(); if (destinationStream.getDisplayName().equals(inUpdatedDestinationStreamName)) { return false; } destinationStream.setDisplayName(inUpdatedDestinationStreamName); return true; } }
UpdateDestinationStreamNameInCachedActivity extends UpdateCachedItemsByIds<ActivityDTO, String> { @Override protected Boolean updateCachedEntity(final ActivityDTO inCachedItem, final String inUpdatedDestinationStreamName) { StreamEntityDTO destinationStream = inCachedItem.getDestinationStream(); if (destinationStream.getDisplayName().equals(inUpdatedDestinationStreamName)) { return false; } destinationStream.setDisplayName(inUpdatedDestinationStreamName); return true; } UpdateDestinationStreamNameInCachedActivity(final Integer inBatchSize); }
UpdateDestinationStreamNameInCachedActivity extends UpdateCachedItemsByIds<ActivityDTO, String> { @Override protected Boolean updateCachedEntity(final ActivityDTO inCachedItem, final String inUpdatedDestinationStreamName) { StreamEntityDTO destinationStream = inCachedItem.getDestinationStream(); if (destinationStream.getDisplayName().equals(inUpdatedDestinationStreamName)) { return false; } destinationStream.setDisplayName(inUpdatedDestinationStreamName); return true; } UpdateDestinationStreamNameInCachedActivity(final Integer inBatchSize);  }
UpdateDestinationStreamNameInCachedActivity extends UpdateCachedItemsByIds<ActivityDTO, String> { @Override protected Boolean updateCachedEntity(final ActivityDTO inCachedItem, final String inUpdatedDestinationStreamName) { StreamEntityDTO destinationStream = inCachedItem.getDestinationStream(); if (destinationStream.getDisplayName().equals(inUpdatedDestinationStreamName)) { return false; } destinationStream.setDisplayName(inUpdatedDestinationStreamName); return true; } UpdateDestinationStreamNameInCachedActivity(final Integer inBatchSize);   }