这是错误信息
at com.imooc.o2o.service.impl.ShopServiceImpl.modifyShop(ShopServiceImpl.java:72)
at com.imooc.o2o.service.ShopServiceTest.testModifyShop(ShopServiceTest.java:32)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
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)
这是shopserviceimpl72行附近的代码
public ShopExecution modifyShop(Shop shop, InputStream shopImgInputSream, String filename) throws ShopOperationException {
if(shop==null || shop.getShopId()==null && filename !=null && !"".equals(filename)){
return new ShopExecution((ShopStateEnum.NULL_SHOP));
}else {
//判断是否需要创建目录
if(shopImgInputSream!=null){
Shop tempShop=shopDao.queryByShopId(shop.getShopId( ));
第72行的代码:if(tempShop.getShopImg()!=null){
ImageUtil.deleteFileOrPath(tempShop.getShopImg());
}
addShopImg(shop,shopImgInputSream,filename);
}
SSM商铺V1.0,解决毕设痛点;SpringBoot商铺V2.0,满足工作刚需
了解课程