Search in sources :

Example 1 with ProjectInstallationJobStatus

use of io.imunity.furms.domain.project_installation.ProjectInstallationJobStatus in project furms by unity-idm.

the class ProjectInstallationDatabaseRepositoryTest method shouldFindProjectInstallationJobStatsByProjectId.

@Test
void shouldFindProjectInstallationJobStatsByProjectId() {
    // given
    CorrelationId correlationId = new CorrelationId(UUID.randomUUID().toString());
    ProjectInstallationJob request = ProjectInstallationJob.builder().correlationId(correlationId).siteId(siteId.toString()).projectId(projectId.toString()).status(PENDING).build();
    // when
    entityDatabaseRepository.createOrUpdate(request);
    // then
    Set<ProjectInstallationJobStatus> statuses = entityDatabaseRepository.findAllByProjectId(projectId.toString());
    assertThat(statuses.size()).isEqualTo(1);
    ProjectInstallationJobStatus status = statuses.iterator().next();
    assertThat(status.status).isEqualTo(PENDING);
    assertThat(status.projectId).isEqualTo(projectId.toString());
    assertThat(status.siteId).isEqualTo(siteId.toString());
}
Also used : ProjectInstallationJobStatus(io.imunity.furms.domain.project_installation.ProjectInstallationJobStatus) ProjectInstallationJob(io.imunity.furms.domain.project_installation.ProjectInstallationJob) CorrelationId(io.imunity.furms.domain.site_agent.CorrelationId) DBIntegrationTest(io.imunity.furms.db.DBIntegrationTest) Test(org.junit.jupiter.api.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest)

Example 2 with ProjectInstallationJobStatus

use of io.imunity.furms.domain.project_installation.ProjectInstallationJobStatus in project furms by unity-idm.

the class ProjectInstallationDatabaseRepositoryTest method shouldFindProjectInstallationJobStatsByCommunityId.

@Test
void shouldFindProjectInstallationJobStatsByCommunityId() {
    // given
    CorrelationId correlationId = new CorrelationId(UUID.randomUUID().toString());
    ProjectInstallationJob request = ProjectInstallationJob.builder().correlationId(correlationId).siteId(siteId.toString()).projectId(projectId.toString()).status(PENDING).build();
    // when
    entityDatabaseRepository.createOrUpdate(request);
    // then
    Set<ProjectInstallationJobStatus> statuses = entityDatabaseRepository.findAllByCommunityId(communityId.toString());
    assertThat(statuses.size()).isEqualTo(1);
    ProjectInstallationJobStatus status = statuses.iterator().next();
    assertThat(status.status).isEqualTo(PENDING);
    assertThat(status.projectId).isEqualTo(projectId.toString());
    assertThat(status.siteId).isEqualTo(siteId.toString());
}
Also used : ProjectInstallationJobStatus(io.imunity.furms.domain.project_installation.ProjectInstallationJobStatus) ProjectInstallationJob(io.imunity.furms.domain.project_installation.ProjectInstallationJob) CorrelationId(io.imunity.furms.domain.site_agent.CorrelationId) DBIntegrationTest(io.imunity.furms.db.DBIntegrationTest) Test(org.junit.jupiter.api.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest)

Aggregations

DBIntegrationTest (io.imunity.furms.db.DBIntegrationTest)2 ProjectInstallationJob (io.imunity.furms.domain.project_installation.ProjectInstallationJob)2 ProjectInstallationJobStatus (io.imunity.furms.domain.project_installation.ProjectInstallationJobStatus)2 CorrelationId (io.imunity.furms.domain.site_agent.CorrelationId)2 Test (org.junit.jupiter.api.Test)2 SpringBootTest (org.springframework.boot.test.context.SpringBootTest)2