MigrationUtils { public static boolean updateRecord(Map<String, Object> propertiesMap, String channel, String userExtId) { Map<String, Object> compositeKeysMap = new HashMap<>(); compositeKeysMap.put(JsonKey.USER_EXT_ID, userExtId); compositeKeysMap.put(JsonKey.CHANNEL, channel); Response response = cassandraOperation.updateRecord(JsonKey.SUNBIRD, JsonKey.SHADOW_USER, propertiesMap, compositeKeysMap); ProjectLogger.log("MigrationUtils:updateRecord:update in cassandra with userExtId" + userExtId + ":and response is:" + response, LoggerEnum.INFO.name()); return true; }  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 testUpdateRecord() { 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.updateRecord(new HashMap<>(), "anyChannel", "anyUserExtId"); Assert.assertEquals(true, isRecordUpdated); }