Search in sources :

Example 6 with ModelingSubmission

use of de.tum.in.www1.artemis.domain.ModelingSubmission in project ArTEMiS by ls1intum.

the class ModelingSubmissionResourceIntTest method createModelingSubmission.

@Test
@Transactional
public void createModelingSubmission() throws Exception {
    int databaseSizeBeforeCreate = modelingSubmissionRepository.findAll().size();
    // Create the ModelingSubmission
    restModelingSubmissionMockMvc.perform(post("/api/modeling-submissions").contentType(TestUtil.APPLICATION_JSON_UTF8).content(TestUtil.convertObjectToJsonBytes(modelingSubmission))).andExpect(status().isCreated());
    // Validate the ModelingSubmission in the database
    List<ModelingSubmission> modelingSubmissionList = modelingSubmissionRepository.findAll();
    assertThat(modelingSubmissionList).hasSize(databaseSizeBeforeCreate + 1);
    ModelingSubmission testModelingSubmission = modelingSubmissionList.get(modelingSubmissionList.size() - 1);
    assertThat(testModelingSubmission.getSubmissionPath()).isEqualTo(DEFAULT_SUBMISSION_PATH);
}
Also used : ModelingSubmission(de.tum.in.www1.artemis.domain.ModelingSubmission) Test(org.junit.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest) Transactional(org.springframework.transaction.annotation.Transactional)

Aggregations

ModelingSubmission (de.tum.in.www1.artemis.domain.ModelingSubmission)6 Timed (com.codahale.metrics.annotation.Timed)3 Test (org.junit.Test)3 SpringBootTest (org.springframework.boot.test.context.SpringBootTest)3 Transactional (org.springframework.transaction.annotation.Transactional)3 URI (java.net.URI)1