use of org.ext.uberfire.social.activities.model.SocialUser in project kie-wb-common by kiegroup.
the class DiscussionAddedEventAdapter method toSocial.
@Override
public SocialActivitiesEvent toSocial(Object object) {
CommentAddedEvent event = (CommentAddedEvent) object;
SocialUser socialUser = socialUserRepositoryAPI.findSocialUser(event.getUserName());
String additionalInfo = "commented";
return new SocialActivitiesEvent(socialUser, DiscussionEventTypes.COMMENT_ADDED.name(), new Date(event.getTimestamp())).withLink(event.getPath().getFileName(), event.getPath().toURI()).withAdicionalInfo(additionalInfo);
}
use of org.ext.uberfire.social.activities.model.SocialUser in project kie-wb-common by kiegroup.
the class ResourceAddedEventAdapter method toSocial.
@Override
public SocialActivitiesEvent toSocial(Object object) {
ResourceAddedEvent event = (ResourceAddedEvent) object;
SocialUser socialUser = socialUserRepositoryAPI.findSocialUser(event.getSessionInfo().getIdentity().getIdentifier());
String additionalInfo = "Added";
String description = getCommitDescription(event);
return new SocialActivitiesEvent(socialUser, HomePageTypes.RESOURCE_ADDED_EVENT.name(), new Date()).withLink(event.getPath().getFileName(), event.getPath().toURI()).withAdicionalInfo(additionalInfo).withDescription(description);
}
use of org.ext.uberfire.social.activities.model.SocialUser in project kie-wb-common by kiegroup.
the class UserHomePageSidePresenterTest method setup.
@Before
public void setup() {
socialUserServiceAPICaller = new CallerMock<SocialUserServiceAPI>(socialUserServiceAPI);
socialUserRepositoryAPICaller = new CallerMock<SocialUserRepositoryAPI>(socialUserRepositoryAPI);
presenter.socialUserService = socialUserServiceAPICaller;
presenter.socialUserRepositoryAPI = socialUserRepositoryAPICaller;
presenter.selectedEvent = selectEvent;
presenter.users = new HashMap<String, SocialUser>();
presenter.loggedUser = new UserImpl("dora");
dora = new SocialUser("dora");
bento = new SocialUser("bento");
presenter.users.put("dora", dora);
presenter.users.put("bento", bento);
}
use of org.ext.uberfire.social.activities.model.SocialUser in project kie-wb-common by kiegroup.
the class ContributorsManagementListItemPresenterTest method setupUserWithNameTest.
@Test
public void setupUserWithNameTest() {
presenter.setup(new SocialUser("user", "John Admin", null, null, null));
verify(view).init(presenter);
verify(view).setUserName("John Admin");
verify(view, never()).setSelected(anyBoolean());
}
use of org.ext.uberfire.social.activities.model.SocialUser in project kie-wb-common by kiegroup.
the class ContributorsManagementPresenterTest method setupTest.
@Test
public void setupTest() {
final List<SocialUser> users = new ArrayList<>();
users.add(userA);
users.add(userB);
final OrganizationalUnit organizationalUnit = mock(OrganizationalUnit.class);
doReturn(users.stream().map(SocialUser::getUserName).collect(Collectors.toList())).when(organizationalUnit).getContributors();
doReturn(userB.getUserName()).when(organizationalUnit).getOwner();
presenter.setup(organizationalUnit);
verify(view).init(presenter);
verify(view).clearFilter();
verify(contributorsManagementListItemPresenter).setup(userA);
verify(contributorsManagementListItemPresenter).setup(userB);
verify(contributorsManagementListItemPresenter).setup(userC);
verify(contributorsManagementListItemPresenter, times(3)).setSelected(true);
verify(contributorsManagementListItemPresenter, times(2)).setEnabled(true);
verify(contributorsManagementListItemPresenter).setEnabled(false);
verify(view).clearUsers();
verify(view, times(3)).addUser(contributorsManagementListItemPresenter);
}
Aggregations