MigrationUtils { public static boolean markUserAsRejected(ShadowUser shadowUser) { Map<String, Object> propertiesMap = new HashMap<>(); propertiesMap.put(JsonKey.CLAIM_STATUS, ClaimStatus.REJECTED.getValue()); propertiesMap.put(JsonKey.UPDATED_ON, new Timestamp(System.currentTimeMillis())); boolean isRecordUpdated=updateRecord(propertiesMap, shadowUser.getChannel(), shadowUser.getUserExtId()); ProjectLogger.log("MigrationUtils:markUserAsRejected:update in cassandra with userExtId" + shadowUser.getUserExtId(),LoggerEnum.INFO.name()); return isRecordUpdated; }  static ShadowUser getRecordByUserId(String userId); static boolean updateRecord(Map<String, Object> propertiesMap, String channel, String userExtId); static boolean markUserAsRejected(ShadowUser shadowUser); static boolean updateClaimStatus(ShadowUser shadowUser,int claimStatus); static List<ShadowUser> getEligibleUsersById(String userId,Map<String, Object> propsMap); static List<ShadowUser> getEligibleUsersById(String userId);  }
@Test public void testmarkUserAsRejected() { ShadowUser shadowUser = new ShadowUser.ShadowUserBuilder() .setChannel("anyChannel") .setUserExtId("anyUserExtId") .build(); Map<String, Object> compositeKeysMap = new HashMap<>(); compositeKeysMap.put(JsonKey.USER_EXT_ID, "anyUserExtId"); compositeKeysMap.put(JsonKey.CHANNEL, "anyChannel"); when(cassandraOperationImpl.updateRecord( JsonKey.SUNBIRD, JsonKey.SHADOW_USER, new HashMap<>(), compositeKeysMap)) .thenReturn(response); boolean isRecordUpdated = MigrationUtils.markUserAsRejected(shadowUser); Assert.assertEquals(true, isRecordUpdated); }