-
Spring Boot Test unable to autowired MockMvc
Spring Boot integeration test, but unable to @Autowired MockMvc
Date: 2019-08-11 View: 1520
-
JSONAssert How to unit test JSON data
In Java, we can use JSONAssert to unit test JSON data easily.
Date: 2019-08-11 View: 1520
-
Mockito How to mock repository findById thenReturn() Optional?
Try to mock a repository findById method, but no idea use thenReturn() to return an object, as it accepts an Optional?
Date: 2019-08-11 View: 1520
-
Spring Boot How to init a Bean for testing?
In Spring Boot, we can create a @TestConfiguration class to initialize some beans for testing class only.
Date: 2019-08-11 View: 1520
-
Spring + Mockito Unable to mock save method?
Try to mock a repository save() method, but it is always returning null?
Date: 2019-08-11 View: 1520
-
Spring Test How to test a JSON Array in jsonPath
In Spring, we can use Hamcrest APIs like hasItem and hasSize to test a JSON Array. Review the following example :
Date: 2019-08-11 View: 1520
-
Spring REST Integration Test Example
In this article, we will show you how to test the Spring Boot REST application. Normally, we use the MockMvc or TestRestTemplate for the integration test.
Date: 2019-08-11 View: 1520