### Question:
AttributesServiceImpl implements AttributesService { public void deleteAttributes(RecipientIdentity holder, Set<String> names) throws ErrorDescriptorException { Object attributeHolder = recipientIdentityResolver.resolveRecipientObject(holder); @SuppressWarnings("unchecked") AttributesSearchCriteria searchCriteria = new AttributesSearchCriteria.Builder(). setNames(names). setSkipServerSettings(true).build(); AttributesSearchResult<ProfileAttribute> searchResult = profileAttributeService. getProfileAttributesForPrincipal(null, attributeHolder, searchCriteria); for (ProfileAttribute attr : searchResult.getList()) { try { profileAttributeService.deleteProfileAttribute(null, attr); } catch (AccessDeniedException ex) { throw new com.jaspersoft.jasperserver.remote.exception.AccessDeniedException("Access denied for attribute ", attr.getAttrName()); } } }  void deleteAttributes(RecipientIdentity holder, Set<String> names); @SuppressWarnings("unchecked") AttributesSearchResult<ClientAttribute> getAttributes(AttributesSearchCriteria searchCriteria, boolean includeEffectivePermissionsInResult); @Override List<ClientAttribute> putAttributes(RecipientIdentity holder,
                                                   List<? extends ClientAttribute> attributes,
                                                   Set<String> names, boolean includeEffectivePermissionsInResult); @Override List<ClientAttribute> getAttributes(RecipientIdentity holder,
                                                   Set<String> names,
                                                   boolean includeEffectivePermissions); static String ROOT_HOLDER; }### Answer:
@Test public void deleteAttribute_deleteExistingAttribute_success() throws Exception { AttributesSearchResult<ProfileAttribute> searchResult = new AttributesSearchResultImpl<ProfileAttribute>(); ProfileAttribute profileAttribute = new UnmodifiableProfileAttribute( attributeB.getAttrName(), attributeB.getAttrValue(), HOLDER_URI); searchResult.setList(Collections.singletonList(profileAttribute)); searchResult.setTotalCount(1); AttributesSearchCriteria searchCriteria = new AttributesSearchCriteria.Builder() .setNames(Collections.singleton(attributeB.getAttrName())).setSkipServerSettings(true).build(); when(profileAttributeService.getProfileAttributesForPrincipal( (ExecutionContext) isNull(), eq(recipient), eq(searchCriteria))).thenReturn(searchResult); service.deleteAttributes(recipientIdentity, Collections.singleton(attributeB.getAttrName())); verify(profileAttributeService, times(1)).deleteProfileAttribute(null, profileAttribute); }