How to deal with the test data in Junit?

后端 未结 5 1263
情书的邮戳
情书的邮戳 2021-01-05 15:13

In TDD(Test Driven Development) development process, how to deal with the test data? Assumption that a scenario, parse a log file to get the needed column. For a strong test

5条回答
  •  执念已碎
    2021-01-05 15:37

    getClass().getClassLoader().getResourceAsStream("....xml");
    

    inside the test worked for me. But

    getClass().getResourceAsStream("....xml");
    

    didn't worked. Don't know why but maybe it helps some others.

提交回复
热议问题