MigrationUtils { public static ShadowUser getRecordByUserId(String userId) { ShadowUser shadowUser=null; Response response = cassandraOperation.searchValueInList(JsonKey.SUNBIRD, JsonKey.SHADOW_USER, JsonKey.USERIDS, userId); if(!((List) response.getResult().get(JsonKey.RESPONSE)).isEmpty()) { shadowUser = mapper.convertValue(((List) response.getResult().get(JsonKey.RESPONSE)).get(0), ShadowUser.class); } return shadowUser; }  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 testGetRecordByUserIdSuccess() { ShadowUser shadowUser = MigrationUtils.getRecordByUserId("EFG"); Assert.assertEquals("TN", shadowUser.getChannel()); }
@Test public void testGetRecordByUserIdFailure() { ShadowUser shadowUser = MigrationUtils.getRecordByUserId("DEF"); Assert.assertEquals(null, shadowUser); }