use of de.tum.in.www1.artemis.domain.enumeration.InitializationState in project ArTEMiS by ls1intum.
the class ParticipationResourceIntTest method updateParticipation.
@Test
@Transactional
public void updateParticipation() throws Exception {
// Initialize the database
participationService.save(participation);
int databaseSizeBeforeUpdate = participationRepository.findAll().size();
// Update the participation
Participation updatedParticipation = participationRepository.findOne(participation.getId());
updatedParticipation.repositoryUrl(UPDATED_REPOSITORY_URL).buildPlanId(UPDATED_BUILD_PLAN_ID).initializationState(UPDATED_INITIALIZATION_STATE).initializationDate(UPDATED_INITIALIZATION_DATE);
restParticipationMockMvc.perform(put("/api/participations").contentType(TestUtil.APPLICATION_JSON_UTF8).content(TestUtil.convertObjectToJsonBytes(updatedParticipation))).andExpect(status().isOk());
// Validate the Participation in the database
List<Participation> participationList = participationRepository.findAll();
assertThat(participationList).hasSize(databaseSizeBeforeUpdate);
Participation testParticipation = participationList.get(participationList.size() - 1);
assertThat(testParticipation.getRepositoryUrl()).isEqualTo(UPDATED_REPOSITORY_URL);
assertThat(testParticipation.getBuildPlanId()).isEqualTo(UPDATED_BUILD_PLAN_ID);
assertThat(testParticipation.getInitializationState()).isEqualTo(UPDATED_INITIALIZATION_STATE);
assertThat(testParticipation.getInitializationDate()).isEqualTo(UPDATED_INITIALIZATION_DATE);
}
Aggregations