### Question:
UserDatastore extends CommonDatastore<UserItem, User> implements DatastoreHasGet<UserItem> { public UserItem update(final APIID id, final Map<String, String> attributes) { UserUpdater userUpdater = new UserUpdaterConverter().convert(attributes, getEngineSession().getTenantId(), getBonitaHomeFolderAccessor()); User user = getUserEngineClient().update(id.toLong(), userUpdater); return userItemConverter.convert(user); } UserDatastore(final APISession engineSession); UserItem add(final UserItem user); UserItem update(final APIID id, final Map<String, String> attributes); @Override UserItem get(final APIID id); ItemSearchResult<UserItem> search(final int page, final int resultsByPage, final String search,
            final Map<String, String> filters, final String orders); void delete(final List<APIID> ids);  }### Answer:
@Test public void should_updateUser_call_engine_api() throws Exception { doReturn(new UserImpl(12L, "john", "bpm")).when(identityAPI).updateUser(eq(12L), any(UserUpdater.class)); Map<String, String> attributes = new HashMap<>(); attributes.put("userName", "jack"); attributes.put("icon", ""); datastore.update(APIID.makeAPIID(12L), attributes); verify(identityAPI).updateUser(eq(12L), userUpdaterArgumentCaptor.capture()); UserUpdater userUpdater = userUpdaterArgumentCaptor.getValue(); assertThat(userUpdater.getFields()).containsOnly(entry(UserUpdater.UserField.USER_NAME, "jack")); }