Junit减少控制台的详细日志

时间:2018-06-08 15:38:52

标签: java spring-boot junit

有没有办法在spring-boot上限制junit的日志?以下是我的JSONAssert.assertEquals的结果,因为body的大小太大而无法在控制台显示,我得到java.lang.OutOfMemoryError: Java heap space

顺便说一句,我无法增加jvm的堆大小。

MockHttpServletRequest:
      HTTP Method = GET
      Request URI = /301c646a-bdc0-40e4-812e-16e3c83f37a3
       Parameters = {}
          Headers = {Accept=[application/json]}

Handler:
             Type = ...
           Method = ...

Async:
    Async started = false
     Async result = null

Resolved Exception:
             Type = null

ModelAndView:
        View name = null
             View = null
            Model = null

FlashMap:
       Attributes = null

MockHttpServletResponse:
           Status = 200
    Error message = null
          Headers = {Content-Type=[application/json;charset=UTF-8]}
     Content type = application/json;charset=UTF-8
             Body = {"id":"301c646a-bdc0-40e4-812e-16e3c83f37a3","code":"70421341-199","...........

1 个答案:

答案 0 :(得分:0)

我禁用了所有模拟日志

application.properties:

spring.test.mockmvc.print=none