Java.lang.exceptionininitializerError beim Versuch, sich zu verspottenJava

Java-Forum
Anonymous
 Java.lang.exceptionininitializerError beim Versuch, sich zu verspotten

Post by Anonymous »

Ich bin in dieses Problem stoße, wenn ich versuche, ein Objekt der Schnittstelle org.springframework.ui.model zu verspotten. Ich verwende Mockito 3.5.15 w/Java 8 und Junit Jupiter. Ich habe versucht, sowohl @mock als auch mockito.mock () global und innerhalb einer Methode zu verwenden, erhalten Sie jedoch den Fehler, trotzdem. Da initMocks () veraltet ist, verwende ich mockito.openmocks () . Ich weiß, dass der Inhalt von testgetMenu () den Fehler nicht verursacht, da ich ihn auch dann erhalte, wenn der Methodenkörper leer ist. D i e g e t e s t e t e K l a s s e i s t e i n F e d e r - M V C - C o n t r o l l e r . < c o d e > j a v a . l a n g . E x c e p t i o n I n I n i t i a l i z e r E r r o r < b r / > a t o r g . m o c k i t o . i n t e r n a l . e x c e p t i o n s . s t a c k t r a c e . C o n d i t i o n a l S t a c k T r a c e F i l t e r . & l t ; i n i t & g t ; ( C o n d i t i o n a l S t a c k T r a c e F i l t e r . j a v a : 1 7 ) < b r / > a t o r g . m o c k i t o . e x c e p t i o n s . b a s e . M o c k i t o E x c e p t i o n . f i l t e r S t a c k T r a c e ( M o c k i t o E x c e p t i o n . j a v a : 4 1 ) < b r / > a t o r g . m o c k i t o . e x c e p t i o n s . b a s e . M o c k i t o E x c e p t i o n . & l t ; i n i t & g t ; ( M o c k i t o E x c e p t i o n . j a v a : 3 0 ) < b r / > a t o r g . m o c k i t o . e x c e p t i o n s . m i s u s i n g . M o c k i t o C o n f i g u r a t i o n E x c e p t i o n . & l t ; i n i t & g t ; ( M o c k i t o C o n f i g u r a t i o n E x c e p t i o n . j a v a : 1 8 ) < b r / > a t o r g . m o c k i t o . i n t e r n a l . c o n f i g u r a t i o n . p l u g i n s . P l u g i n L o a d e r . l o a d I m p l ( P l u g i n L o a d e r . j a v a : 6 6 ) < b r / > a t o r g . m o c k i t o . i n t e r n a l . c o n f i g u r a t i o n . p l u g i n s . P l u g i n L o a d e r . l o a d P l u g i n ( P l u g i n L o a d e r . j a v a : 2 4 ) < b r / > a t o r g . m o c k i t o . i n t e r n a l . c o n f i g u r a t i o n . p l u g i n s . P l u g i n R e g i s t r y . & l t ; i n i t & g t ; ( P l u g i n R e g i s t r y . j a v a : 1 2 ) < b r / > a t o r g . m o c k i t o . i n t e r n a l . c o n f i g u r a t i o n . p l u g i n s . P l u g i n s . & l t ; c l i n i t & g t ; ( P l u g i n s . j a v a : 1 1 ) < b r / > a t o r g . m o c k i t o . i n t e r n a l . u t i l . M o c k U t i l . & l t ; c l i n i t & g t ; ( M o c k U t i l . j a v a : 2 4 ) < b r / > a t o r g . m o c k i t o . i n t e r n a l . s t u b b i n g . d e f a u l t a n s w e r s . R e t u r n s E m p t y V a l u e s . & l t ; i n i t & g t ; ( R e t u r n s E m p t y V a l u e s . j a v a : 5 8 ) < b r / > a t o r g . m o c k i t o . i n t e r n a l . s t u b b i n g . d e f a u l t a n s w e r s . R e t u r n s M o r e E m p t y V a l u e s . & l t ; i n i t & g t ; ( R e t u r n s M o r e E m p t y V a l u e s . j a v a : 5 1 ) < b r / > a t o r g . m o c k i t o . i n t e r n a l . s t u b b i n g . d e f a u l t a n s w e r s . R e t u r n s S m a r t N u l l s . & l t ; i n i t & g t ; ( R e t u r n s S m a r t N u l l s . j a v a : 4 0 ) < b r / > a t o r g . m o c k i t o . A n s w e r s . & l t ; c l i n i t & g t ; ( A n s w e r s . j a v a : 4 3 ) < b r / > a t s u n . r e f l e c t . N a t i v e M e t h o d A c c e s s o r I m p l . i n v o k e 0 ( N a t i v e M e t h o d ) < b r / > a t s u n . r e f l e c t . N a t i v e M e t h o d A c c e s s o r I m p l . i n v o k e ( N a t i v e M e t h o d A c c e s s o r I m p l . j a v a : 6 2 ) < b r / > a t s u n . r e f l e c t . D e l e g a t i n g M e t h o d A c c e s s o r I m p l . i n v o k e ( D e l e g a t i n g M e t h o d A c c e s s o r I m p l . j a v a : 4 3 ) < b r / > a t j a v a . l a n g . r e f l e c t . M e t h o d . i n v o k e ( M e t h o d . j a v a : 4 9 8 ) < b r / > a t j a v a . l a n g . C l a s s . g e t E n u m C o n s t a n t s S h a r e d ( C l a s s . j a v a : 3 3 2 0 ) < b r / > a t j a v a . l a n g . C l a s s . e n u m C o n s t a n t D i r e c t o r y ( C l a s s . j a v a : 3 3 4 1 ) < b r / > a t j a v a . l a n g . E n u m . v a l u e O f ( E n u m . j a v a : 2 3 2 ) < b r / > a t s u n . r e f l e c t . a n n o t a t i o n . A n n o t a t i o n P a r s e r . p a r s e E n u m V a l u e ( A n n o t a t i o n P a r s e r . j a v a : 4 8 3 ) < b r / > a t s u n . r e f l e c t . a n n o t a t i o n . A n n o t a t i o n P a r s e r . p a r s e M e m b e r V a l u e ( A n n o t a t i o n P a r s e r . j a v a : 3 4 7 ) < b r / > a t j a v a . l a n g . r e f l e c t . M e t h o d . g e t D e f a u l t V a l u e ( M e t h o d . j a v a : 6 0 6 ) < b r / > a t s u n . r e f l e c t . a n n o t a t i o n . A n n o t a t i o n T y p e . & l t ; i n i t & g t ; ( A n n o t a t i o n T y p e . j a v a : 1 3 2 ) < b r / > a t s u n . r e f l e c t . a n n o t a t i o n . A n n o t a t i o n T y p e . g e t I n s t a n c e ( A n n o t a t i o n T y p e . j a v a : 8 5 ) < b r / > a t s u n . r e f l e c t . a n n o t a t i o n . A n n o t a t i o n P a r s e r . p a r s e A n n o t a t i o n 2 ( A n n o t a t i o n P a r s e r . j a v a : 2 6 6 ) < b r / > a t s u n . r e f l e c t . a n n o t a t i o n . A n n o t a t i o n P a r s e r . p a r s e A n n o t a t i o n s 2 ( A n n o t a t i o n P a r s e r . j a v a : 1 2 0 ) < b r / > a t s u n . r e f l e c t . a n n o t a t i o n . A n n o t a t i o n P a r s e r . p a r s e A n n o t a t i o n s ( A n n o t a t i o n P a r s e r . j a v a : 7 2 ) < b r / > a t j a v a . l a n g . r e f l e c t . F i e l d . d e c l a r e d A n n o t a t i o n s ( F i e l d . j a v a : 1 1 5 0 ) < b r / > a t j a v a . l a n g . r e f l e c t . F i e l d . d e c l a r e d A n n o t a t i o ns(Field.java:1148)
at java.lang.reflect.Field.getAnnotation(Field.java:1120)
at java.lang.reflect.AccessibleObject.getDeclaredAnnotation(AccessibleObject.java:219)
at org.junit.platform.commons.util.AnnotationUtils.findAnnotation(AnnotationUtils.java:128)
at org.junit.platform.commons.util.AnnotationUtils.findAnnotation(AnnotationUtils.java:115)
at org.junit.platform.commons.util.AnnotationUtils.isAnnotated(AnnotationUtils.java:93)
at org.junit.platform.commons.util.AnnotationUtils.lambda$findAnnotatedFields$6(AnnotationUtils.java:369)
at java.util.function.Predicate.lambda$and$0(Predicate.java:69)
at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:174)
at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1382)
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472)
at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499)
at org.junit.platform.commons.util.ReflectionUtils.findFields(ReflectionUtils.java:1137)
at org.junit.platform.commons.util.AnnotationUtils.findAnnotatedFields(AnnotationUtils.java:371)
at org.junit.platform.commons.util.AnnotationUtils.findAnnotatedFields(AnnotationUtils.java:348)
at org.junit.jupiter.engine.descriptor.ExtensionUtils.registerExtensionsFromFields(ExtensionUtils.java:99)
at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.prepare(ClassBasedTestDescriptor.java:148)
at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.prepare(ClassBasedTestDescriptor.java:78)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$prepare$1(NodeTestTask.java:107)
at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.prepare(NodeTestTask.java:107)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:75)
at java.util.ArrayList.forEach(ArrayList.java:1257)
at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:38)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:139)
at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$7(NodeTestTask.java:125)
at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:135)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:123)
at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:122)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:80)
at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(SameThreadHierarchicalTestExecutorService.java:32)
at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:57)
at org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(HierarchicalTestEngine.java:51)
at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:248)
at org.junit.platform.launcher.core.DefaultLauncher.lambda$execute$5(DefaultLauncher.java:211)
at org.junit.platform.launcher.core.DefaultLauncher.withInterceptedStreams(DefaultLauncher.java:226)
at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:199)
at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:141)
at org.eclipse.jdt.internal.junit5.runner.JUnit5TestReference.run(JUnit5TestReference.java:98)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:41)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:542)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:770)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:464)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:210)
Caused by: java.lang.NullPointerException
at org.mockito.internal.configuration.plugins.Plugins.getStackTraceCleanerProvider(Plugins.java:17)
at org.mockito.internal.exceptions.stacktrace.StackTraceFilter.(StackTraceFilter.java:21)
... 78 more

AppControllertest.java

Code: Select all

import static org.junit.Assert.assertEquals;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;

import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.junit.runner.RunWith;
import org.mockito.InjectMocks;
import org.mockito.MockedStatic;
import org.mockito.Mockito;
import org.mockito.MockitoAnnotations;
import org.mockito.junit.MockitoJUnitRunner;
import org.mockito.junit.jupiter.MockitoExtension;
import org.springframework.ui.Model;

import com.javaduckspizza.OnlineOrderingApplication.common.TypesCache;
import com.javaduckspizza.OnlineOrderingApplication.main.AppController;

@ExtendWith(MockitoExtension.class)
@RunWith(MockitoJUnitRunner.class)
class AppControllerTest {
@InjectMocks
AppController appController = new AppController();
@Mock
Model model;

@BeforeEach
void setUp() throws Exception {
//      model = Mockito.mock(Model.class);
MockitoAnnotations.openMocks(this); //using because initMocks() is deprecated
}

@AfterEach
void tearDown() throws Exception {
}

@Test
void testGetMenu() {
String result = appController.getMenu(model);
assertEquals(result, "/menu.");
verify(model, times(5)).addAttribute(Mockito.anyString(), Mockito.any());
verify(model, times(1)).addAttribute(Mockito.anyString(), Mockito.anyInt());
MockedStatic mockedTypesCache = Mockito.mockStatic(TypesCache.class);
mockedTypesCache.verify(Mockito.times(5), () -> TypesCache.getActiveTypesByCategory(Mockito.anyString()));
}
}
AppController.java

Code: Select all

import java.math.BigDecimal;
import java.util.Date;
import java.sql.Timestamp;
import java.util.Calendar;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;

import javax.ws.rs.GET;
import javax.ws.rs.POST;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.javaduckspizza.OnlineOrderingApplication.common.TypesCache;
import com.javaduckspizza.service.dao.ModifierServiceDao;
import com.javaduckspizza.service.dao.OrderServiceDao;
import com.javaduckspizza.vo.ModifierVo;
import com.javaduckspizza.vo.OrdersVo;
import com.javaduckspizza.vo.PizzaToppingAssociationVo;
import com.javaduckspizza.vo.PizzaVo;

@Controller
@RequestMapping("/")
public class AppController {
protected Map
> mapShoppingCart =
new HashMap();

@GET
@RequestMapping("/menu")
public String getMenu(Model model) {
System.err.println("In AppController.getMenu()");
addAttributesForMenu(model);
model.addAttribute("itemCount", mapShoppingCart.size());

return "/menu.";  //I probably messed up something in the configuration.   If written without / and ., it tries to get WEB-INF/jspmenujsp
}

public void addAttributesForMenu(Model model) {
model.addAttribute("sizes", TypesCache.getActiveTypesByCategory("SIZE"));
model.addAttribute("crusts", TypesCache.getActiveTypesByCategory("CRST"));
model.addAttribute("cheeses", TypesCache.getActiveTypesByCategory("CHES"));
model.addAttribute("sauces", TypesCache.getActiveTypesByCategory("SAUC"));
model.addAttribute("toppings", TypesCache.getActiveTypesByCategory("TOPP"));
}
}
pom.xml

Code: Select all

xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
4.0.0

org.springframework.boot
spring-boot-starter-parent
2.3.3.RELEASE
  

com.javaduckspizza
OnlineOrderingApplication
0.0.1-SNAPSHOT
war
OnlineOrderingApplication
Online ordering application for Java Ducks Pizza


1.8




org.springframework.boot
spring-boot-starter-web



org.springframework.boot
spring-boot-starter-tomcat
provided


org.springframework.boot
spring-boot-starter-test
test


org.junit.vintage
junit-vintage-engine




org.apache.tomcat.embed
tomcat-embed-jasper
provided


javax.servlet
jstl


org.mockito
mockito-core
3.5.15
test


org.mockito
mockito-inline
3.5.15
test


org.mockito
mockito-junit-jupiter
3.5.15
test


junit
junit
4.13
test


jakarta.ws.rs
jakarta.ws.rs-api
2.1.6


org.junit.jupiter
junit-jupiter-api
5.7.0
test


org.junit.jupiter
junit-jupiter-engine
5.7.0
test





org.springframework.boot
spring-boot-maven-plugin


org.apache.maven.plugins
maven-surefire-plugin
2.22.2




Stacktrace Wenn ich nicht übersprüche

Code: Select all

java.lang.NoSuchMethodError:  o r g . m o c k i t o . M o c k i t o . m o c k i t o S e s s i o n ( ) L o r g / m o c k i t o / s e s s i o n / M o c k i t o S e s s i o n B u i l d e r ; < b r   / >         a t   o r g . m o c k i t o . j u n i t . j u p i t e r . M o c k i t o E x t e n s i o n . b e f o r e E a c h ( M o c k i t o E x t e n s i o n . j a v a : 1 4 9 ) < b r   / >         a t   o r g . j u n i t . j u p i t e r . e n g i n e . d e s c r i p t o r . T e s t M e t h o d T e s t D e s c r i p t o r . l a m b d a $ i n v o k e B e f o r e E a c h C a l l b a c k s $ 1 ( T e s t M e t h o d T e s t D e s c r i p t o r . j a v a : 1 5 4 ) < b r   / >         a t   o r g . j u n i t . j u p i t e r . e n g i n e . d e s c r i p t o r . T e s t M e t h o d T e s t D e s c r i p t o r . l a m b d a $ i n v o k e B e f o r e M e t h o d s O r C a l l b a c k s U n t i l E x c e p t i o n O c c u r s $ 5 ( T e s t M e t h o d T e s t D e s c r i p t o r . j a v a : 1 9 0 ) < b r   / >         a t   o r g . j u n i t . p l a t f o r m . e n g i n e . s u p p o r t . h i e r a r c h i c a l . T h r o w a b l e C o l l e c t o r . e x e c u t e ( T h r o w a b l e C o l l e c t o r . j a v a : 7 3 ) < b r   / >         a t   o r g . j u n i t . j u p i t e r . e n g i n e . d e s c r i p t o r . T e s t M e t h o d T e s t D e s c r i p t o r . i n v o k e B e f o r e M e t h o d s O r C a l l b a c k s U n t i l E x c e p t i o n O c c u r s ( T e s t M e t h o d T e s t D e s c r i p t o r . j a v a : 1 9 0 ) < b r   / >         a t   o r g . j u n i t . j u p i t e r . e n g ine.descriptor.TestMethodTestDescriptor.invokeBeforeEachCallbacks(TestMethodTestDescriptor.java:153)
at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:131)
at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:71)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:135)
at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$7(NodeTestTask.java:125)
at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:135)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:123)
at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:122)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:80)
at java.util.ArrayList.forEach(ArrayList.java:1257)
at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:38)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:139)
at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$7(NodeTestTask.java:125)
at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:135)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:123)
at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:122)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:80)
at java.util.ArrayList.forEach(ArrayList.java:1257)
at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:38)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:139)
at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$7(NodeTestTask.java:125)
at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:135)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:123)
at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:122)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:80)
at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(SameThreadHierarchicalTestExecutorService.java:32)
at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:57)
at org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(HierarchicalTestEngine.java:51)
at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:248)
at org.junit.platform.launcher.core.DefaultLauncher.lambda$execute$5(DefaultLauncher.java:211)
at org.junit.platform.launcher.core.DefaultLauncher.withInterceptedStreams(DefaultLauncher.java:226)
at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:199)
at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:141)
at org.eclipse.jdt.internal.junit5.runner.JUnit5TestReference.run(JUnit5TestReference.java:98)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:41)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:542)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:770)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:464)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:210)
Suppressed:  java.lang.NullPointerException
at org.mockito.junit.jupiter.MockitoExtension.afterEach(MockitoExtension.java:184)
at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeAfterEachCallbacks$11(TestMethodTestDescriptor.java:248)
at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeAllAfterMethodsOrCallbacks$13(TestMethodTestDescriptor.java:268)
at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeAllAfterMethodsOrCallbacks$14(TestMethodTestDescriptor.java:268)
at java.util.ArrayList.forEach(ArrayList.java:1257)
at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeAllAfterMethodsOrCallbacks(TestMethodTestDescriptor.java:267)
at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeAfterEachCallbacks(TestMethodTestDescriptor.java:247)
at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:143)
... 43 more

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post