@Test @Transactional public void getOs_type() throws Exception { // Initialize the database os_typeRepository.saveAndFlush(os_type); // Get the os_type restOs_typeMockMvc .perform(get("/api/os_types/{id}", os_type.getId())) .andExpect(status().isOk()) .andExpect(content().contentType(MediaType.APPLICATION_JSON)) .andExpect(jsonPath("$.id").value(os_type.getId().intValue())) .andExpect(jsonPath("$.os_type_name").value(DEFAULT_OS_TYPE_NAME.toString())) .andExpect(jsonPath("$.description").value(DEFAULT_DESCRIPTION.toString())) .andExpect(jsonPath("$.status_id").value(DEFAULT_STATUS_ID)) .andExpect(jsonPath("$.created_by").value(DEFAULT_CREATED_BY.toString())) .andExpect(jsonPath("$.created_date").value(DEFAULT_CREATED_DATE.toString())) .andExpect(jsonPath("$.modified_by").value(DEFAULT_MODIFIED_BY.toString())) .andExpect(jsonPath("$.modified_date").value(DEFAULT_MODIFIED_DATE.toString())); }
@Test @Transactional public void deleteOs_type() throws Exception { // Initialize the database os_typeRepository.saveAndFlush(os_type); int databaseSizeBeforeDelete = os_typeRepository.findAll().size(); // Get the os_type restOs_typeMockMvc .perform( delete("/api/os_types/{id}", os_type.getId()).accept(TestUtil.APPLICATION_JSON_UTF8)) .andExpect(status().isOk()); // Validate the database is empty List<Os_type> os_types = os_typeRepository.findAll(); assertThat(os_types).hasSize(databaseSizeBeforeDelete - 1); }