コード例 #1
0
  @Test
  @Transactional
  public void updatePhysiotherapist() throws Exception {
    // Initialize the database
    physiotherapistRepository.saveAndFlush(physiotherapist);

    int databaseSizeBeforeUpdate = physiotherapistRepository.findAll().size();

    // Update the physiotherapist
    physiotherapist.setFirstName(UPDATED_FIRST_NAME);
    physiotherapist.setLastName(UPDATED_LAST_NAME);
    physiotherapist.setStreet(UPDATED_STREET);
    physiotherapist.setPostalCode(UPDATED_POSTAL_CODE);
    physiotherapist.setCity(UPDATED_CITY);
    physiotherapist.setCountry(UPDATED_COUNTRY);

    restPhysiotherapistMockMvc
        .perform(
            put("/api/physiotherapists")
                .contentType(TestUtil.APPLICATION_JSON_UTF8)
                .content(TestUtil.convertObjectToJsonBytes(physiotherapist)))
        .andExpect(status().isOk());

    // Validate the Physiotherapist in the database
    List<Physiotherapist> physiotherapists = physiotherapistRepository.findAll();
    assertThat(physiotherapists).hasSize(databaseSizeBeforeUpdate);
    Physiotherapist testPhysiotherapist = physiotherapists.get(physiotherapists.size() - 1);
    assertThat(testPhysiotherapist.getFirstName()).isEqualTo(UPDATED_FIRST_NAME);
    assertThat(testPhysiotherapist.getLastName()).isEqualTo(UPDATED_LAST_NAME);
    assertThat(testPhysiotherapist.getStreet()).isEqualTo(UPDATED_STREET);
    assertThat(testPhysiotherapist.getPostalCode()).isEqualTo(UPDATED_POSTAL_CODE);
    assertThat(testPhysiotherapist.getCity()).isEqualTo(UPDATED_CITY);
    assertThat(testPhysiotherapist.getCountry()).isEqualTo(UPDATED_COUNTRY);
  }
コード例 #2
0
 @Before
 public void initTest() {
   physiotherapist = new Physiotherapist();
   physiotherapist.setFirstName(DEFAULT_FIRST_NAME);
   physiotherapist.setLastName(DEFAULT_LAST_NAME);
   physiotherapist.setStreet(DEFAULT_STREET);
   physiotherapist.setPostalCode(DEFAULT_POSTAL_CODE);
   physiotherapist.setCity(DEFAULT_CITY);
   physiotherapist.setCountry(DEFAULT_COUNTRY);
 }