@Test @Transactional public void getClasseType() throws Exception { // Initialize the database classeTypeRepository.saveAndFlush(classeType); // Get the classeType restClasseTypeMockMvc .perform(get("/api/classeTypes/{id}", classeType.getId())) .andExpect(status().isOk()) .andExpect(content().contentType(MediaType.APPLICATION_JSON)) .andExpect(jsonPath("$.id").value(classeType.getId().intValue())) .andExpect(jsonPath("$.intitule").value(DEFAULT_INTITULE.toString())) .andExpect(jsonPath("$.dateCreation").value(DEFAULT_DATE_CREATION.toString())); }
@Test @Transactional public void deleteClasseType() throws Exception { // Initialize the database classeTypeRepository.saveAndFlush(classeType); int databaseSizeBeforeDelete = classeTypeRepository.findAll().size(); // Get the classeType restClasseTypeMockMvc .perform( delete("/api/classeTypes/{id}", classeType.getId()) .accept(TestUtil.APPLICATION_JSON_UTF8)) .andExpect(status().isOk()); // Validate the database is empty List<ClasseType> classeTypes = classeTypeRepository.findAll(); assertThat(classeTypes).hasSize(databaseSizeBeforeDelete - 1); }