Search in sources :

Example 16 with Envelope

use of com.kixeye.chassis.transport.dto.Envelope in project chassis by Kixeye.

the class WebSocketEnvelopeTest method testWithNoPayload.

@Test
public void testWithNoPayload() {
    final Envelope baseEnvelope = new Envelope(RandomStringUtils.randomAlphaNumericString(20, RAND), RandomStringUtils.randomAlphaNumericString(20, RAND), RandomStringUtils.randomAlphaNumericString(20, RAND), null, null);
    final WebSocketEnvelope envelope = new WebSocketEnvelope(baseEnvelope);
    Assert.assertEquals(baseEnvelope.action, envelope.getAction());
    Assert.assertEquals(baseEnvelope.typeId, envelope.getTypeId());
    Assert.assertEquals(baseEnvelope.transactionId, envelope.getTransactionId());
    Assert.assertFalse(envelope.hasPayload());
    Assert.assertEquals(baseEnvelope.payload, envelope.getPayload());
}
Also used : Envelope(com.kixeye.chassis.transport.dto.Envelope) Test(org.junit.Test)

Aggregations

Envelope (com.kixeye.chassis.transport.dto.Envelope)16 Test (org.junit.Test)13 Header (com.kixeye.chassis.transport.dto.Header)10 ServiceError (com.kixeye.chassis.transport.dto.ServiceError)7 MessageSerDe (com.kixeye.chassis.transport.serde.MessageSerDe)7 ProtobufMessageSerDe (com.kixeye.chassis.transport.serde.converter.ProtobufMessageSerDe)7 QueuingWebSocketListener (com.kixeye.chassis.transport.websocket.QueuingWebSocketListener)7 WebSocketMessageRegistry (com.kixeye.chassis.transport.websocket.WebSocketMessageRegistry)7 URI (java.net.URI)7 HashMap (java.util.HashMap)7 Session (org.eclipse.jetty.websocket.api.Session)7 WebSocketClient (org.eclipse.jetty.websocket.client.WebSocketClient)7 MapPropertySource (org.springframework.core.env.MapPropertySource)7 StandardEnvironment (org.springframework.core.env.StandardEnvironment)7 AnnotationConfigWebApplicationContext (org.springframework.web.context.support.AnnotationConfigWebApplicationContext)7 JsonJacksonMessageSerDe (com.kixeye.chassis.transport.serde.converter.JsonJacksonMessageSerDe)6 XmlMessageSerDe (com.kixeye.chassis.transport.serde.converter.XmlMessageSerDe)6 YamlJacksonMessageSerDe (com.kixeye.chassis.transport.serde.converter.YamlJacksonMessageSerDe)6 WebSocketSession (org.eclipse.jetty.websocket.common.WebSocketSession)6 ListenableFuture (com.google.common.util.concurrent.ListenableFuture)1