Index: webapps/pom.xml IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- webapps/pom.xml (revision 1c32b2e228dd892165b0814da3c8eb31ecbf2b51) +++ webapps/pom.xml (date 1603787200707) @@ -147,35 +147,42 @@ org.mockito mockito-core - 2.8.9 + 3.5.15 + test + + + + org.mockito + mockito-inline + 3.5.15 test org.powermock powermock-module-junit4 - 1.7.4 + 2.0.2 test org.powermock powermock-module-junit4-rule - 1.7.4 + 2.0.2 test org.powermock powermock-api-mockito2 - 1.7.4 + 2.0.2 test org.powermock powermock-classloading-xstream - 1.7.4 + 2.0.2 test Index: webapps/src/test/java/org/camunda/bpm/webapp/impl/security/auth/ContainerAuthenticationFilterTest.java IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- webapps/src/test/java/org/camunda/bpm/webapp/impl/security/auth/ContainerAuthenticationFilterTest.java (revision 1c32b2e228dd892165b0814da3c8eb31ecbf2b51) +++ webapps/src/test/java/org/camunda/bpm/webapp/impl/security/auth/ContainerAuthenticationFilterTest.java (date 1603787200709) @@ -30,6 +30,7 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; +import java.util.Collections; import java.util.Iterator; import java.util.ServiceLoader; @@ -205,14 +206,12 @@ when(mockTenantQuery.list()).thenReturn(new ArrayList()); mockStatic(ServiceLoader.class); - when(ServiceLoader.load(ArgumentMatchers.eq(ProcessEngineProvider.class))).thenReturn(serviceLoader); + when(ServiceLoader.load(ArgumentMatchers.eq(ProcessEngineProvider.class))) + .thenAnswer((Answer) invocation -> serviceLoader); - when(serviceLoader.iterator()).thenAnswer(new Answer>() { - @Override - public Iterator answer(InvocationOnMock invocation) throws Throwable { - return Arrays.asList(provider).iterator(); - } - }); + when(serviceLoader.iterator()) + .thenAnswer((Answer>) invocation -> + Collections.singletonList(provider).iterator()); } protected void setupAuthentications() { @@ -220,7 +219,8 @@ mockStatic(Authentications.class); authentications = mock(Authentications.class); - when(Authentications.getFromSession(any(HttpSession.class))).thenReturn(authentications); + when(Authentications.getFromSession(any(HttpSession.class))) + .thenAnswer((Answer) invocation -> authentications); } protected void setupFilter() throws ServletException {