### Question:
UserProfileManager extends ApsEntityManager implements IUserProfileManager { @Override @CacheEvict(value = ICacheInfoManager.DEFAULT_CACHE_NAME, key = "'UserProfile_'.concat(#username)") public void addProfile(String username, IUserProfile profile) throws ApsSystemException { try { profile.setId(username); this.getProfileDAO().addEntity(profile); this.notifyProfileChanging(profile, ProfileChangedEvent.INSERT_OPERATION_CODE); } catch (Throwable t) { logger.error("Error saving profile - user: {}", username, t); throw new ApsSystemException("Error saving profile", t); } }  @Override IApsEntity getEntity(String entityId); @Override IUserProfile getDefaultProfileType(); @Override IUserProfile getProfileType(String typeCode); @Override @CacheEvict(value = ICacheInfoManager.DEFAULT_CACHE_NAME, key = "'UserProfile_'.concat(#username)") void addProfile(String username, IUserProfile profile); @Override @CacheEvict(value = ICacheInfoManager.DEFAULT_CACHE_NAME, key = "'UserProfile_'.concat(#username)") void deleteProfile(String username); @Override @Cacheable(value = ICacheInfoManager.DEFAULT_CACHE_NAME, key = "'UserProfile_'.concat(#username)") @CacheableInfo(groups = "'UserProfileTypes_cacheGroup'") IUserProfile getProfile(String username); @Override @CacheEvict(value = ICacheInfoManager.DEFAULT_CACHE_NAME, key = "'UserProfile_'.concat(#username)") void updateProfile(String username, IUserProfile profile); @Override @CacheInfoEvict(value = ICacheInfoManager.DEFAULT_CACHE_NAME, groups = "'UserProfileTypes_cacheGroup'") void removeEntityPrototype(String entityTypeCode); @Override @CacheInfoEvict(value = ICacheInfoManager.DEFAULT_CACHE_NAME, groups = "'UserProfileTypes_cacheGroup'") void updateEntityPrototype(IApsEntity entityType); void setProfileDAO(IUserProfileDAO profileDAO); void setEntitySearcherDAO(IEntitySearcherDAO entitySearcherDAO);  }### Answer:
@Test public void testAddProfile() throws ApsSystemException { when(entityTypeFactory.extractEntityType( SystemConstants.DEFAULT_PROFILE_TYPE_CODE, UserProfile.class, configItemName, this.entityTypeDom, userProfileManager.getName(), this.entityDom)) .thenReturn(this.createFakeProfile(SystemConstants.DEFAULT_PROFILE_TYPE_CODE)); IUserProfile userProfile = userProfileManager.getDefaultProfileType(); String name = "Jack_Bower"; MonoTextAttribute attribute = (MonoTextAttribute) userProfile.getAttribute("Name"); attribute.setText(name); this.userProfileManager.addProfile(name, userProfile); assertThat(userProfile.getId(), is(name)); Mockito.verify(userProfileDAO, Mockito.times(1)).addEntity(userProfile); Mockito.verify(notifyManager, Mockito.times(1)).publishEvent(Mockito.any(ProfileChangedEvent.class)); }