Ejemplo n.º 1
0
  @Test
  @Transactional
  public void getTableNo() throws Exception {
    // Initialize the database
    tableNoRepository.saveAndFlush(tableNo);

    // Get the tableNo
    restTableNoMockMvc
        .perform(get("/api/tableNos/{id}", tableNo.getId()))
        .andExpect(status().isOk())
        .andExpect(content().contentType(MediaType.APPLICATION_JSON))
        .andExpect(jsonPath("$.id").value(tableNo.getId().intValue()))
        .andExpect(jsonPath("$.name").value(DEFAULT_NAME.toString()))
        .andExpect(jsonPath("$.description").value(DEFAULT_DESCRIPTION.toString()));
  }
Ejemplo n.º 2
0
  @Test
  @Transactional
  public void deleteTableNo() throws Exception {
    // Initialize the database
    tableNoRepository.saveAndFlush(tableNo);

    int databaseSizeBeforeDelete = tableNoRepository.findAll().size();

    // Get the tableNo
    restTableNoMockMvc
        .perform(
            delete("/api/tableNos/{id}", tableNo.getId()).accept(TestUtil.APPLICATION_JSON_UTF8))
        .andExpect(status().isOk());

    // Validate the database is empty
    List<TableNo> tableNos = tableNoRepository.findAll();
    assertThat(tableNos).hasSize(databaseSizeBeforeDelete - 1);
  }