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"));
}
Aggregations