### Question:
RoleDatastore extends CommonDatastore<RoleItem, Role> implements
        DatastoreHasGet<RoleItem>,
        DatastoreHasSearch<RoleItem>,
        DatastoreHasAdd<RoleItem>,
        DatastoreHasUpdate<RoleItem>,
        DatastoreHasDelete { @Override public RoleItem update(final APIID id, final Map<String, String> attributes) { try { final RoleUpdater updater = new RoleUpdater(); if (attributes.containsKey(RoleItem.ATTRIBUTE_NAME)) { updater.setName(attributes.get(RoleItem.ATTRIBUTE_NAME)); } if (attributes.containsKey(RoleItem.ATTRIBUTE_DISPLAY_NAME)) { updater.setDisplayName(attributes.get(RoleItem.ATTRIBUTE_DISPLAY_NAME)); } if (attributes.containsKey(RoleItem.ATTRIBUTE_DESCRIPTION)) { updater.setDescription(attributes.get(RoleItem.ATTRIBUTE_DESCRIPTION)); } if (!MapUtil.isBlank(attributes, RoleItem.ATTRIBUTE_ICON)) { IconDescriptor iconDescriptor = getBonitaHomeFolderAccessor().getIconFromFileSystem(attributes.get(RoleItem.ATTRIBUTE_ICON), getEngineSession().getTenantId()); updater.setIcon(iconDescriptor.getFilename(), iconDescriptor.getContent()); } return convertEngineToConsoleItem(getIdentityAPI().updateRole(id.toLong(), updater)); } catch (APIException e) { throw 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 should_update_role_in_the_engine() throws Exception { RoleUpdater roleUpdater = new RoleUpdater().setName("newName"); doReturn(new RoleImpl(123, "newName")).when(identityAPI).updateRole(eq(123L), eq(roleUpdater)); roleDatastore.update(APIID.makeAPIID(123L), Collections.singletonMap("name", "newName")); verify(identityAPI).updateRole(eq(123L), eq(roleUpdater)); }