Search in sources :

Example 6 with SolutionProgrammingExerciseParticipation

use of de.tum.in.www1.artemis.domain.participation.SolutionProgrammingExerciseParticipation in project Artemis by ls1intum.

the class UrlServiceTest method testUserIndependentRepositoryUrl.

@Test
public void testUserIndependentRepositoryUrl() {
    var solutionProgrammingExerciseParticipation = new SolutionProgrammingExerciseParticipation();
    solutionProgrammingExerciseParticipation.setRepositoryUrl(repositoryUrl1.toString());
    assertThat(solutionProgrammingExerciseParticipation.getUserIndependentRepositoryUrl()).isEqualTo("https://bitbucket.ase.in.tum.de/scm/EIST2016RME/RMEXERCISE-ab123cd");
    var templateProgrammingExerciseParticipation = new TemplateProgrammingExerciseParticipation();
    templateProgrammingExerciseParticipation.setRepositoryUrl(repositoryUrl2.toString());
    assertThat(templateProgrammingExerciseParticipation.getUserIndependentRepositoryUrl()).isEqualTo("https://repobruegge.in.tum.de/scm/EIST2016RME/RMEXERCISE-ab123cd.git");
    var studentParticipation1 = new ProgrammingExerciseStudentParticipation();
    studentParticipation1.setRepositoryUrl(repositoryUrl3.toString());
    assertThat(studentParticipation1.getUserIndependentRepositoryUrl()).isEqualTo("https://artemistest2gitlab.ase.in.tum.de/TESTADAPTER/testadapter-exercise.git");
    var studentParticipation2 = new ProgrammingExerciseStudentParticipation();
    studentParticipation2.setRepositoryUrl(repositoryUrl4.toString());
    assertThat(studentParticipation2.getUserIndependentRepositoryUrl()).isEqualTo("https://artemistest2gitlab.ase.in.tum.de/FTCSCAGRADING1/ftcscagrading1-username");
    assertThat(new ProgrammingExerciseStudentParticipation().getUserIndependentRepositoryUrl()).isNull();
    var studentParticipation3 = new ProgrammingExerciseStudentParticipation();
    studentParticipation3.setRepositoryUrl("http://localhost:8080/Assignment/rest/words/{name}/protection");
    assertThat(studentParticipation3.getUserIndependentRepositoryUrl()).isNull();
}
Also used : ProgrammingExerciseStudentParticipation(de.tum.in.www1.artemis.domain.participation.ProgrammingExerciseStudentParticipation) TemplateProgrammingExerciseParticipation(de.tum.in.www1.artemis.domain.participation.TemplateProgrammingExerciseParticipation) SolutionProgrammingExerciseParticipation(de.tum.in.www1.artemis.domain.participation.SolutionProgrammingExerciseParticipation) Test(org.junit.jupiter.api.Test) AbstractSpringIntegrationBambooBitbucketJiraTest(de.tum.in.www1.artemis.AbstractSpringIntegrationBambooBitbucketJiraTest)

Aggregations

SolutionProgrammingExerciseParticipation (de.tum.in.www1.artemis.domain.participation.SolutionProgrammingExerciseParticipation)4 AbstractSpringIntegrationBambooBitbucketJiraTest (de.tum.in.www1.artemis.AbstractSpringIntegrationBambooBitbucketJiraTest)2 Result (de.tum.in.www1.artemis.domain.Result)2 ProgrammingExerciseStudentParticipation (de.tum.in.www1.artemis.domain.participation.ProgrammingExerciseStudentParticipation)2 TemplateProgrammingExerciseParticipation (de.tum.in.www1.artemis.domain.participation.TemplateProgrammingExerciseParticipation)2 EntityNotFoundException (de.tum.in.www1.artemis.web.rest.errors.EntityNotFoundException)2 InternalServerErrorException (de.tum.in.www1.artemis.web.rest.errors.InternalServerErrorException)2 GitAPIException (org.eclipse.jgit.api.errors.GitAPIException)2 Test (org.junit.jupiter.api.Test)2