vehicles-api/src/test/java/com/udacity/vehicles/api/CarControllerTest.java
@Test
  public void createCar() throws Exception {
    Car car = getCar();
    mvc.perform(
            post(new URI("/cars"))
                    .content(json.write(car).getJson())
                    .contentType(MediaType.APPLICATION_JSON_UTF8)
                    .accept(MediaType.APPLICATION_JSON_UTF8))
            .andExpect(status().isCreated());
  }
/**
   * Tests for successful creation of new car in the system
   *
   * @throws Exception when car creation fails in the system
   */
Tests for successful creation of new car in the system
@throws Exception when car creation fails in the system
Tests for successful creation of new car in the system @throws Exception when car creation fails in the system
@Test
  public void createCar() throws Exception {
    Car car = getCar();
    mvc.perform(
            post(new URI("/cars"))
                    .content(json.write(car).getJson())
                    .contentType(MediaType.APPLICATION_JSON_UTF8)
                    .accept(MediaType.APPLICATION_JSON_UTF8))
            .andExpect(status().isCreated());
  }
@ Test public void createCar ( ) throws Exception { Car car = getCar ( ) ; mvc . perform ( post ( new URI ( "/cars" ) ) . content ( json . write ( car ) . getJson ( ) ) . contentType ( MediaType . APPLICATION_JSON_UTF8 ) . accept ( MediaType . APPLICATION_JSON_UTF8 ) ) . andExpect ( status ( ) . isCreated ( ) ) ; }
Tests for successful creation of new car in the system
 @throws Exception when car creation fails in the system
Tests for successful creation of new car in the system @throws Exception when car creation fails in the system