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());
}
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());
}
Aggregations