Written on
·
176
0
samplecontrollertest.java에 아래의 소스를 넣었을때 mockMvc.perform(get("/hello")) // get 으로 /hello 요청하면
.andExpect(status().isOk()) // status 는 200 이고
.andExpect(content().string("hello ironman")) // content 는 hello ironman 이고
.andDo(print()); // 해당 사항들을 print로 출력함
print로 출력이 run시킬때 run log창에 남는건가요?
저는 그냥 아래와 같이 뜨기만하고 print로 찍히는게 안보입니다.
2019-04-01 23:33:34.944 INFO 8148 --- [ main] m.i.s.SpringtestdemoApplication : Starting SpringtestdemoApplication on DESKTOP-2849P80 with PID 8148 (C:\SpringWork\IntelliJ\springtestdemo\target\classes started by nari1 in C:\SpringWork\IntelliJ\springtestdemo)
2019-04-01 23:33:34.944 INFO 8148 --- [ main] m.i.s.SpringtestdemoApplication : No active profile set, falling back to default profiles: default
2019-04-01 23:33:35.870 INFO 8148 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http)
2019-04-01 23:33:35.890 INFO 8148 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2019-04-01 23:33:35.890 INFO 8148 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.16]
2019-04-01 23:33:35.900 INFO 8148 --- [ main] o.a.catalina.core.AprLifecycleListener : The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: [C:Program FilesJavajdk1.8.0_201bin;C:WINDOWSSunJavabin;C:WINDOWSsystem32;C:WINDOWS;C:Program Files (x86)Common FilesOracleJavajavapath;C:WINDOWSsystem32;C:WINDOWS;C:WINDOWSSystem32Wbem;C:WINDOWSSystem32WindowsPowerShellv1.0;C:WINDOWSSystem32OpenSSH;C:Program FilesJavajdk1.8.0_201bin;C:Usersnari1AppDataLocalMicrosoftWindowsApps;;C:Program Files (x86)ESTsoftALSeex64;.]
2019-04-01 23:33:35.989 INFO 8148 --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2019-04-01 23:33:35.989 INFO 8148 --- [ main] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 998 ms
2019-04-01 23:33:36.157 INFO 8148 --- [ main] o.s.s.concurrent.ThreadPoolTaskExecutor : Initializing ExecutorService 'applicationTaskExecutor'
2019-04-01 23:33:36.473 INFO 8148 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8080 (http) with context path ''
2019-04-01 23:33:36.473 INFO 8148 --- [ main] m.i.s.SpringtestdemoApplication : Started SpringtestdemoApplication in 1.814 seconds (JVM running for 2.41)