### Question:
RoleDatastore extends CommonDatastore<RoleItem, Role> implements
        DatastoreHasGet<RoleItem>,
        DatastoreHasSearch<RoleItem>,
        DatastoreHasAdd<RoleItem>,
        DatastoreHasUpdate<RoleItem>,
        DatastoreHasDelete { @Override public RoleItem add(final RoleItem role) { try { final RoleCreator creator = new RoleCreator(role.getName()); if (!StringUtil.isBlank(role.getDisplayName())) { creator.setDisplayName(role.getDisplayName()); } if (!StringUtil.isBlank(role.getDescription())) { creator.setDescription(role.getDescription()); } if (!StringUtil.isBlank(role.getIcon())) { IconDescriptor iconDescriptor = getBonitaHomeFolderAccessor().getIconFromFileSystem(role.getIcon(), getEngineSession().getTenantId()); creator.setIcon(iconDescriptor.getFilename(), iconDescriptor.getContent()); } return convertEngineToConsoleItem(getIdentityAPI().createRole(creator)); } catch (APIException e) { throw e; } catch (AlreadyExistsException e) { throw new APIForbiddenException(new _("Can't create role. Role '%roleName%' already exists", new Arg("roleName", role.getName())), e); } catch (final Exception e) { throw new APIException(e); } } RoleDatastore(final APISession engineSession); @Override void delete(final List<APIID> ids); @Override RoleItem update(final APIID id, final Map<String, String> attributes); @Override RoleItem add(final RoleItem role); @Override ItemSearchResult<RoleItem> search(final int page, final int resultsByPage, final String search, final String orders,
            final Map<String, String> filters); @Override RoleItem get(final APIID id); Long getNumberOfUsers(final APIID roleId);  }### Answer:
@Test public void add_role_without_icon_should_create_role_without_retrieving_icon_from_filesystem() throws Exception { doReturn(new RoleImpl(123, "name")).when(identityAPI).createRole(any(RoleCreator.class)); RoleItem roleItem = new RoleItem(); roleItem.setIcon(""); roleItem.setName("name"); roleDatastore.add(roleItem); verify(bonitaHomeFolderAccessor, never()).getIconFromFileSystem(anyString(), anyLong()); verify(identityAPI).createRole(any(RoleCreator.class)); }