Search in sources :

Example 1 with Stream

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();
    }
}
Also used : StreamID(com.symphony.user.StreamID) Stream(com.symphony.api.model.Stream) SymphonyUser(org.finos.symphony.toolkit.workflow.sources.symphony.content.SymphonyUser)

Example 2 with Stream

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);
}
Also used : Stream(com.symphony.api.model.Stream) SymphonyUser(org.finos.symphony.toolkit.workflow.sources.symphony.content.SymphonyUser) Test(org.junit.jupiter.api.Test)

Aggregations

Stream (com.symphony.api.model.Stream)2 SymphonyUser (org.finos.symphony.toolkit.workflow.sources.symphony.content.SymphonyUser)2 StreamID (com.symphony.user.StreamID)1 Test (org.junit.jupiter.api.Test)1