Search in sources :

Example 1 with ProjectUpdateJobStatus

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

the class ProjectInstallationDatabaseRepositoryTest method shouldFindProjectUpdateJobByCommunityId.

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

Example 2 with ProjectUpdateJobStatus

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

the class ProjectInstallationDatabaseRepositoryTest method shouldFindProjectUpdateJobByProjectId.

@Test
void shouldFindProjectUpdateJobByProjectId() {
    // given
    CorrelationId correlationId = new CorrelationId(UUID.randomUUID().toString());
    ProjectUpdateJob request = ProjectUpdateJob.builder().correlationId(correlationId).siteId(siteId.toString()).projectId(projectId.toString()).status(ProjectUpdateStatus.PENDING).build();
    // when
    entityDatabaseRepository.createOrUpdate(request);
    // then
    Set<ProjectUpdateJobStatus> statuses = entityDatabaseRepository.findAllUpdatesByProjectId(projectId.toString());
    ProjectUpdateJobStatus status = statuses.iterator().next();
    assertThat(status.status).isEqualTo(ProjectUpdateStatus.PENDING);
    assertThat(status.projectId).isEqualTo(projectId.toString());
    assertThat(status.siteId).isEqualTo(siteId.toString());
}
Also used : CorrelationId(io.imunity.furms.domain.site_agent.CorrelationId) ProjectUpdateJob(io.imunity.furms.domain.project_installation.ProjectUpdateJob) ProjectUpdateJobStatus(io.imunity.furms.domain.project_installation.ProjectUpdateJobStatus) 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 ProjectUpdateJob (io.imunity.furms.domain.project_installation.ProjectUpdateJob)2 ProjectUpdateJobStatus (io.imunity.furms.domain.project_installation.ProjectUpdateJobStatus)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