@Test
public void addNewSchema() throws Exception {

  SchemaVersion schemaVersion = new SchemaVersion(schema, 1, false);
  when(paverService.addSchema(ROAD_NAME, schema)).thenReturn(schemaVersion);
  when(paverService.getRoad(ROAD_NAME)).thenReturn(road);
  mockMvc
      .perform(post(CONTEXT_PATH + "/roads/road1/schemas").contentType(APPLICATION_JSON_UTF8).content(schemaJson))
      .andExpect(status().isOk())
      .andExpect(content().contentType(APPLICATION_JSON_UTF8))
      .andExpect(jsonPath("$.success", is(true)))
      .andExpect(jsonPath("$.message", is("Request to add a new schema received.")));
  verify(paverService).addSchema(ROAD_NAME, schema);
}