-
Spring Boot Test unable to autowired MockMvc
Spring Boot integeration test, but unable to @Autowired MockMvc
Date: 2019-08-11 View: 1520
-
Spring Security There is no PasswordEncoder mapped for the id null
Send a GET request with username and password, but hits the password encoder error?
Date: 2019-08-11 View: 1520
-
Spring REST + Spring Security Example
In this article, we will enhance the previous Spring REST Validation Example, by adding Spring Security to perform authentication and authorization for the requested URLs (REST API endpoints)
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
-
Spring REST Error Handling Example
In this article, we will show you error handling in Spring Boot REST application.
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
-
Spring Boot Run code when the application starts
In Spring Boot, we can create a CommandLineRunner bean to run code when the application is fully started.
Date: 2019-08-11 View: 1520
-
Spring Boot YAML example
In this article, we will show you how to use YAML instead of properties file in Spring Boot.
Date: 2019-08-11 View: 1520
-
Spring Boot + Spring data JPA
In this tutorial, we will show you how to use Spring Boot + Spring data JPA to save data into an H2 in-memory database and how to also query the data.
Date: 2019-08-11 View: 1520
-
Spring Boot + Spring data JPA + MySQL
The previous Spring Boot + Spring data JPA will be reused, modify to support MySQL database.
Date: 2019-08-11 View: 1520
-
Spring Boot MySQL : Table DB_NAME.hibernate_sequence doesnt exist
Spring Boot + Spring Data JPA + MySQL, and hits the following error message when the application starts :
Date: 2019-08-11 View: 1520