Search in sources :

Example 6 with V4Initiator

use of com.symphony.api.model.V4Initiator in project spring-bot by finos.

the class BotIT method testSendMessageIMPrivateBot.

@Test
public void testSendMessageIMPrivateBot() {
    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>").data("{}").stream(new V4Stream().streamId("ABC123").streamType("IM")))));
    getPrivateBot().sendToConsumer(in);
    littleSleep();
    wireMockRule.verify(1, WireMock.postRequestedFor(urlPathMatching("/kore2")));
    wireMockRule.verify(1, WireMock.postRequestedFor(urlPathMatching("/agent/v4/stream/ABC123/message/create")));
}
Also used : V4Message(com.symphony.api.model.V4Message) 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)

Example 7 with V4Initiator

use of com.symphony.api.model.V4Initiator in project spring-bot by finos.

the class BotIT method testSendMessageRoomWithSlash.

@Test
public void testSendMessageRoomWithSlash() {
    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>").data("{}").stream(new V4Stream().streamId("ABC123").streamType("ROOM")))));
    getPublicBot().sendToConsumer(in);
    littleSleep();
    wireMockRule.verify(1, WireMock.postRequestedFor(urlPathMatching("/kore")).withRequestBody(matching(".*\"message\":\\{\"text\":\"hello\"\\}.*")));
}
Also used : V4Message(com.symphony.api.model.V4Message) 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)7 V4Initiator (com.symphony.api.model.V4Initiator)7 V4Payload (com.symphony.api.model.V4Payload)7 V4Stream (com.symphony.api.model.V4Stream)7 V4User (com.symphony.api.model.V4User)7 Test (org.junit.jupiter.api.Test)7 V4Message (com.symphony.api.model.V4Message)6 V4MessageSent (com.symphony.api.model.V4MessageSent)6 V4SymphonyElementsAction (com.symphony.api.model.V4SymphonyElementsAction)1 Mention (com.symphony.user.Mention)1 UserId (com.symphony.user.UserId)1 EntityJson (org.finos.symphony.toolkit.json.EntityJson)1