Search in sources :

Example 1 with HttpServletRequestContext

use of org.apache.nifi.web.HttpServletRequestContext in project nifi by apache.

the class TestProcessorWebUtils method testGetRequestContextForProcessor.

@Test
@SuppressWarnings("unchecked")
public void testGetRequestContextForProcessor() throws NoSuchMethodException, IOException, InvocationTargetException, IllegalAccessException {
    Method method = ProcessorWebUtils.class.getDeclaredMethod("getRequestContext", String.class, HttpServletRequest.class);
    method.setAccessible(true);
    NiFiWebRequestContext requestContext = (NiFiWebRequestContext) method.invoke(null, "1", mock(HttpServletRequest.class));
    assertTrue(requestContext instanceof HttpServletRequestContext);
    assertTrue(requestContext.getId().equals("1"));
}
Also used : Method(java.lang.reflect.Method) NiFiWebRequestContext(org.apache.nifi.web.NiFiWebRequestContext) HttpServletRequestContext(org.apache.nifi.web.HttpServletRequestContext) Test(org.junit.Test)

Aggregations

Method (java.lang.reflect.Method)1 HttpServletRequestContext (org.apache.nifi.web.HttpServletRequestContext)1 NiFiWebRequestContext (org.apache.nifi.web.NiFiWebRequestContext)1 Test (org.junit.Test)1