@Test
public void createCategoryWithExistingId() {

    int databaseSizeBeforeCreate = categoryRepository.findAll().size();
    category.setId(10L);
    given()
            .contentType(JSON)
            .body(category)
            .when().post("/api/categories")
            .then()
            .statusCode(400);
    // Validate the Category in the database
    List<Category> categoryList = categoryRepository.findAll();
    Assertions.assertEquals(categoryList.size(), databaseSizeBeforeCreate);
}