@Test @Transactional public void updateDTUser() throws Exception { // Initialize the database dTUserRepository.saveAndFlush(dTUser); int databaseSizeBeforeUpdate = dTUserRepository.findAll().size(); // Update the dTUser dTUser.setUsername(UPDATED_USERNAME); dTUser.setPassword(UPDATED_PASSWORD); dTUser.setAvatar(UPDATED_AVATAR); dTUser.setPhone(UPDATED_PHONE); dTUser.setSign(UPDATED_SIGN); dTUser.setBirthday(UPDATED_BIRTHDAY); restDTUserMockMvc .perform( put("/api/dTUsers") .contentType(TestUtil.APPLICATION_JSON_UTF8) .content(TestUtil.convertObjectToJsonBytes(dTUser))) .andExpect(status().isOk()); // Validate the DTUser in the database List<DTUser> dTUsers = dTUserRepository.findAll(); assertThat(dTUsers).hasSize(databaseSizeBeforeUpdate); DTUser testDTUser = dTUsers.get(dTUsers.size() - 1); assertThat(testDTUser.getUsername()).isEqualTo(UPDATED_USERNAME); assertThat(testDTUser.getPassword()).isEqualTo(UPDATED_PASSWORD); assertThat(testDTUser.getAvatar()).isEqualTo(UPDATED_AVATAR); assertThat(testDTUser.getPhone()).isEqualTo(UPDATED_PHONE); assertThat(testDTUser.getSign()).isEqualTo(UPDATED_SIGN); assertThat(testDTUser.getBirthday()).isEqualTo(UPDATED_BIRTHDAY); }
@Before public void initTest() { dTUser = new DTUser(); dTUser.setUsername(DEFAULT_USERNAME); dTUser.setPassword(DEFAULT_PASSWORD); dTUser.setAvatar(DEFAULT_AVATAR); dTUser.setPhone(DEFAULT_PHONE); dTUser.setSign(DEFAULT_SIGN); dTUser.setBirthday(DEFAULT_BIRTHDAY); }