Glg203 : TP07

Modérateurs : graffiop, jmdouin, agoncal, mlebihan

chaba_el
Messages : 8
Inscription : 13 oct. 2019 13:51

Glg203 : TP07

Message par chaba_el » 26 nov. 2019 10:26

Bonjour,

Le test unitaire CustomerServiceTest passe sans pb (et en particulier en débug), Parrfois il ne passe pas (sans débug). Alltests et gradle mark me génère cette erreur. j'ai vérifié la table T_CUSTOMER. elle contient une ligne avec l'id, le nom et le prénom, les autres champs sont à NULL et c'est ça qui générè cette erreur. Je ne sais pas s'il s'agoit d'un problème de temps de réponse de la base qui est rop lente ou d'un problème dans suppression de la ligne avec deletecustmer

Merci de votre aide


testServiceFindAllCustomers(com.yaps.petstore.domain.service.CustomerServiceTest)java.lang.NullPointerException
at com.yaps.petstore.domain.model.Customer.getStreet1(Customer.java:99)
at com.yaps.petstore.domain.service.CustomerServiceImpl.transformCustomer2DTO(CustomerServiceImpl.java:199)
at com.yaps.petstore.domain.service.CustomerServiceImpl.transformCustomers2DTOs(CustomerServiceImpl.java:219)
at com.yaps.petstore.domain.service.CustomerServiceImpl.findCustomers(CustomerServiceImpl.java:178)
at com.yaps.petstore.domain.service.CustomerServiceImpl$$FastClassBySpringCGLIB$$a356616a.invoke(<generated>)
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:749)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
at org.springframework.transaction.interceptor.TransactionInterceptor$$Lambda$748/2025395550.proceedWithInvocation(Unknown Source)
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:295)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:98)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:688)
at com.yaps.petstore.domain.service.CustomerServiceImpl$$EnhancerBySpringCGLIB$$be3a9a4b.findCustomers(<generated>)
at com.yaps.petstore.domain.service.CustomerServiceTest.findAllCustomers(CustomerServiceTest.java:290)
at com.yaps.petstore.domain.service.CustomerServiceTest.testServiceFindAllCustomers(CustomerServiceTest.java:75)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.springframework.test.context.junit4.statements.RunBeforeTestExecutionCallbacks.evaluate(RunBeforeTestExecutionCallbacks.java:74)
at org.springframework.test.context.junit4.statements.RunAfterTestExecutionCallbacks.evaluate(RunAfterTestExecutionCallbacks.java:84)
at org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:75)
at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:86)
at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:84)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:251)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:97)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:190)
at org.junit.runners.Suite.runChild(Suite.java:128)
at org.junit.runners.Suite.runChild(Suite.java:27)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at junit.framework.JUnit4TestAdapter.run(JUnit4TestAdapter.java:38)
at AllTests.main(AllTests.java:45)

bruye_st
Messages : 11
Inscription : 27 nov. 2019 15:14

Re: Glg203 : TP07

Message par bruye_st » 27 nov. 2019 15:17

Bonjour,
les champs ayant des valeurs non renseignées doivent rester vides, et non être mis à NULL

Répondre