Search in sources :

Example 21 with ContentType

use of com.linkedin.restli.common.ContentType in project rest.li by linkedin.

the class TestMultiplexedRequestHandlerImpl method testGetContentTypeDefault.

@Test(dataProvider = "multiplexerConfigurations")
public void testGetContentTypeDefault(MultiplexerRunMode multiplexerRunMode) throws Exception {
    createMultiplexer(null, multiplexerRunMode);
    RestRequest request = muxRequestBuilder().build();
    ContentType contentType = ContentType.getContentType(request.getHeader(RestConstants.HEADER_CONTENT_TYPE)).get();
    assertEquals(contentType, ContentType.JSON);
}
Also used : RestRequest(com.linkedin.r2.message.rest.RestRequest) ContentType(com.linkedin.restli.common.ContentType) Test(org.testng.annotations.Test)

Aggregations

ContentType (com.linkedin.restli.common.ContentType)21 Test (org.testng.annotations.Test)14 ByteString (com.linkedin.data.ByteString)4 RestRequestBuilder (com.linkedin.r2.message.rest.RestRequestBuilder)4 MimeTypeParseException (javax.activation.MimeTypeParseException)3 RestRequest (com.linkedin.r2.message.rest.RestRequest)2 RestResponse (com.linkedin.r2.message.rest.RestResponse)2 MultiplexerUriBuilder (com.linkedin.restli.client.uribuilders.MultiplexerUriBuilder)2 IOException (java.io.IOException)2 DataMap (com.linkedin.data.DataMap)1 StreamDataCodec (com.linkedin.data.codec.entitystream.StreamDataCodec)1 DefaultSymbolTableProvider (com.linkedin.data.codec.symbol.DefaultSymbolTableProvider)1 SymbolTable (com.linkedin.data.codec.symbol.SymbolTable)1 SymbolTableProvider (com.linkedin.data.codec.symbol.SymbolTableProvider)1 MultiPartMIMEWriter (com.linkedin.multipart.MultiPartMIMEWriter)1 MessageHeadersBuilder (com.linkedin.r2.message.MessageHeadersBuilder)1 RequestContext (com.linkedin.r2.message.RequestContext)1 RestResponseBuilder (com.linkedin.r2.message.rest.RestResponseBuilder)1 StreamRequestBuilder (com.linkedin.r2.message.stream.StreamRequestBuilder)1 ByteStringWriter (com.linkedin.r2.message.stream.entitystream.ByteStringWriter)1