Skip to content

Commit

Permalink
OutboundSseEventImpl.Builder should use MediaType.TEXT_PLAIN as defau…
Browse files Browse the repository at this point in the history
…lt media type

Signed-off-by: NicoNes <nicolas.nesmon@gmail.com>
  • Loading branch information
NicoNes authored and asoldano committed Jan 16, 2018
1 parent 850c8c5 commit b3428de
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
Expand Up @@ -39,7 +39,7 @@ public static class BuilderImpl implements Builder

private Object data;

private MediaType mediaType = MediaType.SERVER_SENT_EVENTS_TYPE;
private MediaType mediaType = MediaType.TEXT_PLAIN_TYPE;

public Builder name(String name)
{
Expand Down
@@ -0,0 +1,22 @@
package org.jboss.resteasy.plugins.providers.sse;

import javax.ws.rs.core.MediaType;
import javax.ws.rs.sse.OutboundSseEvent;

import org.junit.Assert;
import org.junit.Test;

/***
*
* @author Nicolas NESMON
*
*/
public class OutboundSseEventImplTest {

@Test
public void Should_ReturnTextPlainMediaType_When_MediaTypeIsNotSet() throws Exception {
OutboundSseEvent outboundSseEvent = new OutboundSseEventImpl.BuilderImpl().comment("comment").build();
Assert.assertEquals(MediaType.TEXT_PLAIN_TYPE, outboundSseEvent.getMediaType());
}

}

0 comments on commit b3428de

Please sign in to comment.