use of de.tum.in.www1.artemis.domain.ProgrammingExercise in project ArTEMiS by ls1intum.
the class ExerciseResourceIntTest method equalsVerifier.
@Test
@Transactional
public void equalsVerifier() throws Exception {
TestUtil.equalsVerifier(Exercise.class);
Exercise exercise1 = new ProgrammingExercise();
exercise1.setId(1L);
Exercise exercise2 = new ProgrammingExercise();
exercise2.setId(exercise1.getId());
assertThat(exercise1).isEqualTo(exercise2);
exercise2.setId(2L);
assertThat(exercise1).isNotEqualTo(exercise2);
exercise1.setId(null);
assertThat(exercise1).isNotEqualTo(exercise2);
}
use of de.tum.in.www1.artemis.domain.ProgrammingExercise in project ArTEMiS by ls1intum.
the class ProgrammingExerciseResourceIntTest method createProgrammingExercise.
@Test
@Transactional
public void createProgrammingExercise() throws Exception {
int databaseSizeBeforeCreate = programmingExerciseRepository.findAll().size();
// Create the ProgrammingExercise
restProgrammingExerciseMockMvc.perform(post("/api/programming-exercises").contentType(TestUtil.APPLICATION_JSON_UTF8).content(TestUtil.convertObjectToJsonBytes(programmingExercise))).andExpect(status().isCreated());
// Validate the ProgrammingExercise in the database
List<ProgrammingExercise> programmingExerciseList = programmingExerciseRepository.findAll();
assertThat(programmingExerciseList).hasSize(databaseSizeBeforeCreate + 1);
ProgrammingExercise testProgrammingExercise = programmingExerciseList.get(programmingExerciseList.size() - 1);
assertThat(testProgrammingExercise.getBaseRepositoryUrl()).isEqualTo(DEFAULT_BASE_REPOSITORY_URL);
assertThat(testProgrammingExercise.getBaseBuildPlanId()).isEqualTo(DEFAULT_BASE_BUILD_PLAN_ID);
assertThat(testProgrammingExercise.isPublishBuildPlanUrl()).isEqualTo(DEFAULT_PUBLISH_BUILD_PLAN_URL);
assertThat(testProgrammingExercise.isAllowOnlineEditor()).isEqualTo(DEFAULT_ALLOW_ONLINE_EDITOR);
}
use of de.tum.in.www1.artemis.domain.ProgrammingExercise in project ArTEMiS by ls1intum.
the class ProgrammingExerciseResourceIntTest method equalsVerifier.
@Test
@Transactional
public void equalsVerifier() throws Exception {
TestUtil.equalsVerifier(ProgrammingExercise.class);
ProgrammingExercise programmingExercise1 = new ProgrammingExercise();
programmingExercise1.setId(1L);
ProgrammingExercise programmingExercise2 = new ProgrammingExercise();
programmingExercise2.setId(programmingExercise1.getId());
assertThat(programmingExercise1).isEqualTo(programmingExercise2);
programmingExercise2.setId(2L);
assertThat(programmingExercise1).isNotEqualTo(programmingExercise2);
programmingExercise1.setId(null);
assertThat(programmingExercise1).isNotEqualTo(programmingExercise2);
}
Aggregations