Expected behavior
- Controller tests should pass but instead started receiving Nullpointer exception.
Actual behavior
java.lang.NullPointerException at com.microsoft.applicationinsights.web.internal.WebRequestTrackingFilter.doFilter
To Reproduce
- Write a simple controller test
- Try to execute the same
@WebMvcTest(value = SimpleController.class, secure = false)
@ContextConfiguration(classes = {ControllerTestInitializer.class})
@Slf4j
public class SimpleControllerTests {
@Autowired
private MockMvc mockMvc;
@Test
public void testGetVersionSuccess() throws Exception {
<...test logic >
}
Sample Application
If applicable, provide a sample application which reproduces the issue.
System information
Please provide the following information:
- SDK Version: Java 1.8u202
- OS type and version: Ubuntu Linux 1604
- Application Server type and version (if applicable): Tomcat 9.0.16
- Using spring-boot? Yes , Spring boot 2.1.3
- Additional relevant libraries (with version, if applicable): Guice
Logs
java.lang.NullPointerException at com.microsoft.applicationinsights.web.internal.WebRequestTrackingFilter.doFilter
Expected behavior
Actual behavior
java.lang.NullPointerException at com.microsoft.applicationinsights.web.internal.WebRequestTrackingFilter.doFilter
To Reproduce
Sample Application
If applicable, provide a sample application which reproduces the issue.
System information
Please provide the following information:
Logs
java.lang.NullPointerException at com.microsoft.applicationinsights.web.internal.WebRequestTrackingFilter.doFilter