Java 8 or higher
Mavenmvn clean
mvn testmvn clean
mvn spring-boot:run@PostMapping("/vehicle-api/v1/vehicles/vehicle")When above mentioned URL pattern with request body is called,Method with Signature
addVehicle(Vehicle vehicle) in VehicleController is executed.
This method checks for null and specfic value constraints and if found valid,
it passes the RequestBody to createService method of VehicleService class as an argument.
createService method is an async function whose configuration is specified in AsyncConfiguration
class and saves the data in the table.
TestCase 1: Return Success(OK 200) Response for valid Payload.
TestCase 2: Return Error(BadRequest 400) Response if Transmission Type is neither "AUTO" nor "MANUAL".
TestCase 3: Return Error(InternalServerError 500) Response if any of the value in payload is null.