Search in sources :

Example 21 with SutSpecification

use of io.elastest.etm.model.SutSpecification in project elastest-torm by elastest.

the class ModelsTest method tTobTest.

@Test
public void tTobTest() {
    Project project = new Project(3l, "name", new ArrayList<TJob>(), new ArrayList<SutSpecification>());
    Project project2 = new Project(3l, "name", new ArrayList<TJob>(), new ArrayList<SutSpecification>());
    SutSpecification sut = new SutSpecification(34l, "name", "specification", "description", project, new ArrayList<>(), SutTypeEnum.REPOSITORY, false, null, InstrumentedByEnum.WITHOUT, null, ManagedDockerType.IMAGE, CommandsOptionEnum.DEFAULT);
    SutSpecification sut2 = new SutSpecification(34l, "name", "specification", "description", project2, new ArrayList<>(), SutTypeEnum.REPOSITORY, false, null, InstrumentedByEnum.WITHOUT, null, ManagedDockerType.IMAGE, CommandsOptionEnum.DEFAULT);
    TJob tjob = new TJob(34l, "name", "imageName", sut, project, false, "execDashboardConfig", null);
    TJob tjob2 = new TJob(34l, "name", "imageName", sut2, project2, false, "execDashboardConfig", null);
    assertEquals(tjob, tjob2);
    assertEquals(tjob.hashCode(), tjob2.hashCode());
}
Also used : Project(io.elastest.etm.model.Project) SutSpecification(io.elastest.etm.model.SutSpecification) TJob(io.elastest.etm.model.TJob) Test(org.junit.jupiter.api.Test)

Example 22 with SutSpecification

use of io.elastest.etm.model.SutSpecification in project elastest-torm by elastest.

the class EtmApiItTest method createSut.

protected SutSpecification createSut(long projectId) {
    String requestJson = "{" + "\"description\": \"This is a SuT description example\"," + "\"id\": 0," + "\"name\": \"sut_definition_1\"," + "\"project\": { \"id\":" + projectId + "}," + "\"specification\": \"https://github.com/EduJGURJC/springbootdemo\"," + "\"sutType\": \"REPOSITORY\"," + "\"instrumentalize\": \"" + false + "\"," + "\"currentSutExec\": \"" + null + "\"," + "\"instrumentedBy\": \"" + InstrumentedByEnum.WITHOUT + "\"," + "\"port\": \"" + null + "\"," + "\"managedDockerType\": \"" + ManagedDockerType.IMAGE + "\"," + "\"commandsOption\": \"" + CommandsOptionEnum.DEFAULT + "\"" + "}";
    HttpHeaders headers = new HttpHeaders();
    headers.setContentType(MediaType.APPLICATION_JSON);
    HttpEntity<String> entity = new HttpEntity<String>(requestJson, headers);
    log.info("POST /api/sut");
    ResponseEntity<SutSpecification> response = httpClient.postForEntity("/api/sut", entity, SutSpecification.class);
    log.info("Sut created:" + response.getBody());
    return response.getBody();
}
Also used : HttpHeaders(org.springframework.http.HttpHeaders) HttpEntity(org.springframework.http.HttpEntity) SutSpecification(io.elastest.etm.model.SutSpecification)

Example 23 with SutSpecification

use of io.elastest.etm.model.SutSpecification in project elastest-torm by elastest.

the class SutServiceTest method setUp.

@BeforeEach
public void setUp() {
    sut = new SutSpecification();
    sutExec = new SutExecution(1L, sut, null, null);
}
Also used : SutExecution(io.elastest.etm.model.SutExecution) SutSpecification(io.elastest.etm.model.SutSpecification) BeforeEach(org.junit.jupiter.api.BeforeEach)

Aggregations

SutSpecification (io.elastest.etm.model.SutSpecification)23 SutExecution (io.elastest.etm.model.SutExecution)9 Test (org.junit.jupiter.api.Test)7 TJob (io.elastest.etm.model.TJob)4 TJobExecution (io.elastest.etm.model.TJobExecution)4 ArrayList (java.util.ArrayList)4 DockerContainer (io.elastest.epm.client.json.DockerContainerInfo.DockerContainer)3 Parameter (io.elastest.etm.model.Parameter)3 IOException (java.io.IOException)3 SpringBootTest (org.springframework.boot.test.context.SpringBootTest)3 HttpEntity (org.springframework.http.HttpEntity)3 HttpHeaders (org.springframework.http.HttpHeaders)3 Container (com.github.dockerjava.api.model.Container)2 Project (io.elastest.etm.model.Project)2 CreateContainerCmd (com.github.dockerjava.api.command.CreateContainerCmd)1 DockerClientException (com.github.dockerjava.api.exception.DockerClientException)1 InternalServerErrorException (com.github.dockerjava.api.exception.InternalServerErrorException)1 NotFoundException (com.github.dockerjava.api.exception.NotFoundException)1 NotModifiedException (com.github.dockerjava.api.exception.NotModifiedException)1 Bind (com.github.dockerjava.api.model.Bind)1