模拟MockMultipartHttpServletRequest时获取java.lang.reflect.InvocationTargetException

时间:2016-07-04 12:52:21

标签: spring spring-mvc junit4 spring-test

我正在模仿MockMultipartHttpServletRequest,如下所示。当我调试这个单一的测试用例时,能不能告诉我java.lang.reflect.InvocationTargetException的原因。

@ActiveProfiles("development")
@ContextConfiguration(locations = {
        "classpath:asia/embla/fre/test/config/service-context.xml",
        "classpath:asia/embla/fre/test/config/data-context.xml" })
@RunWith(SpringJUnit4ClassRunner.class)

public class BIMDrawingServiceTest {
    //private String ifcFilePath        = "resources/Famacweb-Architect-2016-07-04.ifc";

    @Autowired
    private BIMDrawingService bimService;

    @Test
    public void manageUpload(){
        try {                   
            //MultipartFile file = new MockMultipartFile("file", "Famacweb-Architect-2016-07-04.ifc", "text/plain", new FileInputStream(ifcFile));
        MockMultipartHttpServletRequest  request = new MockMultipartHttpServletRequest();

         // assertEquals("File name should be equal", "", "");
        } catch (Exception e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }

0 个答案:

没有答案