@Test public void test_should_get_distinct_next_statuses() { Long currentStatusId = 1L; List<Long> roles = asList(1L, 2L); List<ComplaintStatusMapping> complaintStatusMappingEntities = getListOfComplaintStatusMappingEntities(); when( complaintStatusMappingJpaRepository. findByCurrentStatusIdAndRoleInAndTenantIdOrderByOrderNoAsc(currentStatusId, roles,"default") ).thenReturn(complaintStatusMappingEntities); List<org.egov.workflow.domain.model.ComplaintStatus> result = complaintStatusMappingRepository.getNextStatuses(currentStatusId, roles,"default"); assertThat(result.size()).isEqualTo(2); assertThat(result.get(0).getName()).isEqualTo("PROCESSING"); assertThat(result.get(1).getName()).isEqualTo("COMPLETED"); }
public List<org.egov.workflow.domain.model.ComplaintStatus> getNextStatuses(Long currentStatusId , List<Long> roles, String tenantId) { return complaintStatusMappingJpaRepository .findByCurrentStatusIdAndRoleInAndTenantIdOrderByOrderNoAsc(currentStatusId, roles,tenantId).stream() .map(ComplaintStatusMapping::getShowStatus) .map(ComplaintStatus::toDomain) .distinct() .collect(Collectors.toList()); }
ComplaintStatusMappingRepository { public List<org.egov.workflow.domain.model.ComplaintStatus> getNextStatuses(Long currentStatusId , List<Long> roles, String tenantId) { return complaintStatusMappingJpaRepository .findByCurrentStatusIdAndRoleInAndTenantIdOrderByOrderNoAsc(currentStatusId, roles,tenantId).stream() .map(ComplaintStatusMapping::getShowStatus) .map(ComplaintStatus::toDomain) .distinct() .collect(Collectors.toList()); } }
ComplaintStatusMappingRepository { public List<org.egov.workflow.domain.model.ComplaintStatus> getNextStatuses(Long currentStatusId , List<Long> roles, String tenantId) { return complaintStatusMappingJpaRepository .findByCurrentStatusIdAndRoleInAndTenantIdOrderByOrderNoAsc(currentStatusId, roles,tenantId).stream() .map(ComplaintStatusMapping::getShowStatus) .map(ComplaintStatus::toDomain) .distinct() .collect(Collectors.toList()); } ComplaintStatusMappingRepository(ComplaintStatusMappingJpaRepository complaintStatusMappingJpaRepository); }
ComplaintStatusMappingRepository { public List<org.egov.workflow.domain.model.ComplaintStatus> getNextStatuses(Long currentStatusId , List<Long> roles, String tenantId) { return complaintStatusMappingJpaRepository .findByCurrentStatusIdAndRoleInAndTenantIdOrderByOrderNoAsc(currentStatusId, roles,tenantId).stream() .map(ComplaintStatusMapping::getShowStatus) .map(ComplaintStatus::toDomain) .distinct() .collect(Collectors.toList()); } ComplaintStatusMappingRepository(ComplaintStatusMappingJpaRepository complaintStatusMappingJpaRepository); List<org.egov.workflow.domain.model.ComplaintStatus> getNextStatuses(Long currentStatusId
        , List<Long> roles, String tenantId); }
ComplaintStatusMappingRepository { public List<org.egov.workflow.domain.model.ComplaintStatus> getNextStatuses(Long currentStatusId , List<Long> roles, String tenantId) { return complaintStatusMappingJpaRepository .findByCurrentStatusIdAndRoleInAndTenantIdOrderByOrderNoAsc(currentStatusId, roles,tenantId).stream() .map(ComplaintStatusMapping::getShowStatus) .map(ComplaintStatus::toDomain) .distinct() .collect(Collectors.toList()); } ComplaintStatusMappingRepository(ComplaintStatusMappingJpaRepository complaintStatusMappingJpaRepository); List<org.egov.workflow.domain.model.ComplaintStatus> getNextStatuses(Long currentStatusId
        , List<Long> roles, String tenantId);  }