This is a sample application used for a talk that shows testing improvements in Spring Boot 1.4. Look at the talk script in combination with the commit history for a high level overview.
If you want to run the application locally you’ll need to follow these steps:
A local MySQL server is required and should be configured using the following commands:
Add a cars
database and user:
CREATE DATABASE cars;
CREATE USER 'cars'@'localhost' IDENTIFIED BY 'cars';
GRANT ALL PRIVILEGES ON cars . * TO 'cars'@'localhost';
FLUSH PRIVILEGES;
Create a table:
USE cars;
CREATE TABLE user (id BIGINT NOT NULL AUTO_INCREMENT, username VARCHAR(255), vin VARCHAR(255), PRIMARY KEY (id));
ALTER TABLE user ADD CONSTRAINT UK_USERNAME UNIQUE (USERNAME);
Insert some data:
INSERT INTO user (username, vin) values ('mickey', '01234567890123456');
The sample calls a remote REST service that must be running.
The build includes a WireMock version that can be used.
For some reason the second request to WireMock seems to hang, so make sure you curl
it at least three times after starting:
mvn -Pwiremock curl http://localhost:8081/vs/vehicle/01234567890123456/details curl http://localhost:8081/vs/vehicle/01234567890123456/details (will fail, hit Ctrl^C) curl http://localhost:8081/vs/vehicle/01234567890123456/details