use of io.elastest.etm.model.TJob in project elastest-torm by elastest.
the class TJobApiItTest method testGetTJobs.
@Test
public void testGetTJobs() {
log.info("Start the test testGetTJobs");
List<TJob> tJobsToGet = new ArrayList<>();
for (int i = 0; i < 3; i++) {
tJobsToGet.add(createTJob(projectId));
}
log.debug("GET /tjob");
ResponseEntity<TJob[]> response = httpClient.getForEntity("/api/tjob", TJob[].class);
TJob[] tJobs = response.getBody();
for (TJob tjob : tJobs) {
deleteTJob(tjob.getId());
}
log.info("TJobs Array size:" + tJobs.length);
assertTrue(tJobs.length > 0);
}
use of io.elastest.etm.model.TJob in project elastest-torm by elastest.
the class TJobServiceTest method createTJobTest.
// @Mock TJobRepository tJobRepository;
//
// @InjectMocks
// private TJobService tJobService;
// @BeforeEach
// void setUp(@Autowired TJobService tJobService ){
// this.tJobService = tJobService;
// }
@Test
public void createTJobTest(@Autowired TJob tJob, @Mock TJobRepository tJobRepo, @Mock TJobExecOrchestratorService epmIntegrationService, @Mock TJobExecRepository tJobExecRepo, @Mock EsmService esmService) {
// TJob createdTJob =
when(tJobRepo.save(tJob)).thenReturn(tJob);
TJobService tJobService = new TJobService(tJobRepo, tJobExecRepo, epmIntegrationService, esmService);
TJob tJob1 = tJobService.createTJob(tJob);
System.out.println("ImageName:" + tJob1.getImageName());
assertNotNull(tJob1.getId());
assertAll("Validating Project Properties", () -> assertTrue(tJob1.getName().equals("SimpleTest")), () -> assertTrue(tJob1.getProject().getName().equals("TestProject1")));
}
Aggregations