BadgeClassExtensionServiceImpl implements BadgeClassExtensionService { @Override public void save(BadgeClassExtension badgeClassExtension) { Map<String, Object> request = new HashMap<>(); request.put(JsonKey.ID, badgeClassExtension.getBadgeId()); request.put(BadgingJsonKey.ISSUER_ID, badgeClassExtension.getIssuerId()); request.put(JsonKey.ROOT_ORG_ID, badgeClassExtension.getRootOrgId()); request.put(JsonKey.TYPE, badgeClassExtension.getType()); request.put(JsonKey.SUBTYPE, badgeClassExtension.getSubtype()); request.put(JsonKey.ROLES, badgeClassExtension.getRoles()); cassandraOperation.upsertRecord(Util.KEY_SPACE_NAME, BADGE_CLASS_EXT_TABLE_NAME, request); } BadgeClassExtensionServiceImpl();  BadgeClassExtensionServiceImpl(CassandraOperation cassandraOperation); @Override void save(BadgeClassExtension badgeClassExtension); @Override List<BadgeClassExtension> search(
      List<String> issuerList,
      List<String> badgeList,
      String rootOrgId,
      String type,
      String subtype,
      List<String> roles); @Override BadgeClassExtension get(String badgeId); @Override void delete(String badgeId); static final String BADGE_CLASS_EXT_TABLE_NAME; }
@Test public void testSaveSuccess() { PowerMockito.when(mockDBService.upsertRecord(Mockito.any(), Mockito.any(), Mockito.any())) .thenReturn(new Response()); boolean thrown = false; try { BadgeClassExtension badgeClassExtension = new BadgeClassExtension( VALUE_BADGE_ID, VALUE_ISSUER_ID, VALUE_ROOT_ORG_ID, VALUE_TYPE, VALUE_SUBTYPE, VALUE_ROLES_LIST); badgeClassExtensionServiceImpl.save(badgeClassExtension); } catch (Exception e) { thrown = true; } Assert.assertEquals(false, thrown); }