use of com.symphony.api.model.Stream in project spring-bot by finos.
the class AbstractStreamResolving method getStreamIdForUser.
protected String getStreamIdForUser(SymphonyUser a) {
if (((SymphonyUser) a).getStreamId() != null) {
return ((SymphonyUser) a).getStreamId();
} else {
long userId = getUserIdForUser(a);
Stream s = streamsApi.v1ImCreatePost(Collections.singletonList(userId), null);
a.getId().add(new StreamID(s.getId()));
return s.getId();
}
}
use of com.symphony.api.model.Stream in project spring-bot by finos.
the class TestRoomAndUsersBuilder method testGetUserStream.
@Test
public void testGetUserStream() {
when(streamsApi.v1ImCreatePost(Mockito.any(), Mockito.isNull())).thenAnswer(c -> new Stream().id("123"));
SymphonyUser rd = new SymphonyUser("Robski mo", "rob@example.com");
String someStream = ruBuilder.getStreamFor(rd);
Assertions.assertEquals("123", someStream);
}
Aggregations