Search in sources :

Example 11 with HttpHeaders

use of javax.ws.rs.core.HttpHeaders in project ddf by codice.

the class TestRestEndpoint method testAddDocumentNullMessage.

@Test(expected = ServerErrorException.class)
public void testAddDocumentNullMessage() {
    CatalogFramework framework = mock(CatalogFramework.class);
    RESTEndpoint rest = new RESTEndpoint(framework);
    HttpHeaders headers = mock(HttpHeaders.class);
    rest.addDocument(headers, mock(UriInfo.class), mock(HttpServletRequest.class), mock(MultipartBody.class), null, null);
}
Also used : HttpServletRequest(javax.servlet.http.HttpServletRequest) HttpHeaders(javax.ws.rs.core.HttpHeaders) MultipartBody(org.apache.cxf.jaxrs.ext.multipart.MultipartBody) CatalogFramework(ddf.catalog.CatalogFramework) UriInfo(javax.ws.rs.core.UriInfo) Test(org.junit.Test)

Example 12 with HttpHeaders

use of javax.ws.rs.core.HttpHeaders in project ddf by codice.

the class TestRestEndpoint method createHeaders.

private HttpHeaders createHeaders(List<String> mimeTypeList) {
    HttpHeaders headers = mock(HttpHeaders.class);
    when(headers.getRequestHeader(HttpHeaders.CONTENT_TYPE)).thenReturn(mimeTypeList);
    return headers;
}
Also used : HttpHeaders(javax.ws.rs.core.HttpHeaders)

Aggregations

HttpHeaders (javax.ws.rs.core.HttpHeaders)12 HttpServletRequest (javax.servlet.http.HttpServletRequest)7 Test (org.junit.Test)7 UriInfo (javax.ws.rs.core.UriInfo)5 CatalogFramework (ddf.catalog.CatalogFramework)4 URI (java.net.URI)4 MultipartBody (org.apache.cxf.jaxrs.ext.multipart.MultipartBody)4 ByteArrayInputStream (java.io.ByteArrayInputStream)3 HttpServletResponse (javax.servlet.http.HttpServletResponse)3 QueryResponse (ddf.catalog.operation.QueryResponse)2 SourceInfoResponse (ddf.catalog.operation.SourceInfoResponse)2 Callback (javax.security.auth.callback.Callback)2 Response (javax.ws.rs.core.Response)2 JsonValue (org.forgerock.json.JsonValue)2 RestAuthCallbackHandler (org.forgerock.openam.core.rest.authn.callbackhandlers.RestAuthCallbackHandler)2 BeforeClass (org.testng.annotations.BeforeClass)2 Test (org.testng.annotations.Test)2 CreateStorageRequest (ddf.catalog.content.operation.CreateStorageRequest)1 MetacardImpl (ddf.catalog.data.impl.MetacardImpl)1 CreateRequest (ddf.catalog.operation.CreateRequest)1