use of sonia.scm.security.SessionId in project scm-review-plugin by scm-manager.
the class EventListenerTest method shouldSendSessionIdWithMessage.
@Test
void shouldSendSessionIdWithMessage() {
SessionId sessionId = bindSessionId("1-2-3");
PullRequestEvent event = createPullRequestEvent();
listener.handle(event);
verify(channel).broadcast(captor.capture());
assertMessageHasCorrectTypeAndName(PullRequestEvent.class);
assertThat(captor.getValue().getSender()).contains(sessionId);
}
use of sonia.scm.security.SessionId in project scm-review-plugin by scm-manager.
the class EventListenerTest method bindSessionId.
private SessionId bindSessionId(String sessionIdString) {
SessionId sessionId = SessionId.valueOf(sessionIdString);
when(principalCollection.oneByType(SessionId.class)).thenReturn(sessionId);
return sessionId;
}
use of sonia.scm.security.SessionId in project scm-review-plugin by scm-manager.
the class EventListenerTest method shouldBroadcastMessageForReplyEvent.
@Test
void shouldBroadcastMessageForReplyEvent() {
SessionId sessionId = bindSessionId("4-2");
ReplyEvent event = createReplyEvent();
listener.handle(event);
verify(channel).broadcast(captor.capture());
assertMessageHasCorrectTypeAndName(ReplyEvent.class);
}
Aggregations