Search in sources :

Example 1 with Mention

use of com.symphony.user.Mention in project spring-bot by finos.

the class BotIT method testSendMessageRoomWithMention.

@Test
public void testSendMessageRoomWithMention() throws JsonProcessingException {
    Mention m = new Mention();
    m.setId(new ArrayList<>());
    m.getId().add(new UserId("1234"));
    EntityJson ej = new EntityJson();
    ej.put("m1", m);
    String data = symphonyObjectMapper.writeValueAsString(ej);
    V4Event in = new V4Event().initiator(new V4Initiator().user(new V4User().email("rob@example.com").displayName("Rob Example").userId(2438923l))).payload(new V4Payload().messageSent(new V4MessageSent().message(new V4Message().message("<div>hello</div>").stream(new V4Stream().streamId("ABC123").streamType("ROOM")).data(data))));
    getPublicBot().sendToConsumer(in);
    littleSleep();
    wireMockRule.verify(1, WireMock.postRequestedFor(urlPathMatching("/agent/v4/stream/ABC123/message/create")));
}
Also used : EntityJson(org.finos.symphony.toolkit.json.EntityJson) V4Message(com.symphony.api.model.V4Message) UserId(com.symphony.user.UserId) Mention(com.symphony.user.Mention) V4Initiator(com.symphony.api.model.V4Initiator) V4MessageSent(com.symphony.api.model.V4MessageSent) V4Event(com.symphony.api.model.V4Event) V4User(com.symphony.api.model.V4User) V4Stream(com.symphony.api.model.V4Stream) V4Payload(com.symphony.api.model.V4Payload) Test(org.junit.jupiter.api.Test)

Aggregations

V4Event (com.symphony.api.model.V4Event)1 V4Initiator (com.symphony.api.model.V4Initiator)1 V4Message (com.symphony.api.model.V4Message)1 V4MessageSent (com.symphony.api.model.V4MessageSent)1 V4Payload (com.symphony.api.model.V4Payload)1 V4Stream (com.symphony.api.model.V4Stream)1 V4User (com.symphony.api.model.V4User)1 Mention (com.symphony.user.Mention)1 UserId (com.symphony.user.UserId)1 EntityJson (org.finos.symphony.toolkit.json.EntityJson)1 Test (org.junit.jupiter.api.Test)1