Commit 61855675 authored by Enriko Käsper's avatar Enriko Käsper
Browse files

Merge branch 'develop' into 'master'

Release: merge 'develop' into 'master' created by Enriko Käsper

See merge request teis/officials-service!31
parents dc25b83c a08f8ee0
theGroup=ee.sm.ti.teis
theVersion=0.3.0
commonsVersion=1.0.0
officeApiGatewayVersion=0.10.0
theVersion=1.0.0
commonsVersion=1.1.0
officeApiGatewayVersion=1.0.0
pluginVersion=1.0.0
mapstructVersion=1.3.0.Final
querydslVersion=4.1.3
......@@ -3,19 +3,8 @@ package ee.sm.ti.teis.officials.group.listener;
import ee.sm.ti.teis.OfficialsAppTestBase;
import ee.sm.ti.teis.officegateway.official.dto.OfficialUserDto;
import ee.sm.ti.teis.officegateway.official.dto.OfficialsGroupDto;
import ee.sm.ti.teis.officegateway.official.request.AddOfficialsGroupMembersRequest;
import ee.sm.ti.teis.officegateway.official.request.CreateOfficialsGroupRequest;
import ee.sm.ti.teis.officegateway.official.request.DeleteOfficialsGroupMemberRequest;
import ee.sm.ti.teis.officegateway.official.request.DeleteOfficialsGroupRequest;
import ee.sm.ti.teis.officegateway.official.request.OfficialsGroupRequest;
import ee.sm.ti.teis.officegateway.official.request.OfficialsGroupsRequest;
import ee.sm.ti.teis.officegateway.official.request.UpdateOfficialsGroupRequest;
import ee.sm.ti.teis.officegateway.official.response.AddOfficialsGroupMembersResponse;
import ee.sm.ti.teis.officegateway.official.response.CreateOfficialsGroupResponse;
import ee.sm.ti.teis.officegateway.official.response.DeleteOfficialsGroupMemberResponse;
import ee.sm.ti.teis.officegateway.official.response.OfficialsGroupResponse;
import ee.sm.ti.teis.officegateway.official.response.OfficialsGroupsResponse;
import ee.sm.ti.teis.officegateway.official.response.UpdateOfficialsGroupResponse;
import ee.sm.ti.teis.officegateway.official.request.*;
import ee.sm.ti.teis.officegateway.official.response.*;
import ee.sm.ti.teis.officials.group.OfficialsGroupRepository;
import ee.sm.ti.teis.officials.official.OfficialUserRepository;
import ee.sm.ti.teis.servicerequest.RequestMetaDTO;
......@@ -39,7 +28,8 @@ import static org.assertj.core.api.Assertions.assertThat;
@Transactional
class OfficialsGroupGwListenerTest extends OfficialsAppTestBase {
private static final RequestMetaDTO REQUEST_META_DTO = RequestMetaDTO.builder().userId(UUID.randomUUID().toString()).privileges(of("TI_MANAGE_OFFICIALS_GROUPS")).userType(UserType.OFFICIAL_USER).requestId(UUID.randomUUID().toString()).build();
private static final RequestMetaDTO REQUEST_META_DTO = RequestMetaDTO.builder().userId(UUID.randomUUID().toString())
.privileges(of("TI_MANAGE_OFFICIALS_GROUPS")).userType(UserType.OFFICIAL_USER).requestId(UUID.randomUUID().toString()).build();
private static final UUID ADMIN_GROUP_ID = UUID.fromString("68b5b265-9427-457f-8f16-0bd5cf608714");
private static final UUID DELETED_GROUP_ID = UUID.fromString("c6bbd0d0-a614-408e-b22b-c60eed1a0dc9");
private static final UUID ADMIN_USER_ID = UUID.fromString("b5d59f3b-57af-4971-8110-51019e5e827d");
......@@ -112,13 +102,13 @@ class OfficialsGroupGwListenerTest extends OfficialsAppTestBase {
void findOfficialGroup_statusDeleted_success() {
OfficialsGroupRequest request = new OfficialsGroupRequest();
OfficialsGroupRequest.Parameters payload = new OfficialsGroupRequest.Parameters();
payload.setId("c6bbd0d0-a614-408e-b22b-c60eed1a0dc9");
payload.setId(DELETED_GROUP_ID.toString());
request.setPayload(payload, REQUEST_META_DTO);
OfficialsGroupResponse response = groupListener.findOfficialsGroup(request);
OfficialsGroupDto responseDto = response.getPayload();
assertThat(responseDto.getId()).isEqualTo(UUID.fromString("c6bbd0d0-a614-408e-b22b-c60eed1a0dc9"));
assertThat(responseDto.getId()).isEqualTo(DELETED_GROUP_ID);
assertThat(responseDto.getName()).isEqualTo("Admin kasutajad (removed)");
assertThat(responseDto.getObjectStatus()).isEqualTo(DELETED);
}
......
package ee.sm.ti.teis.officials.group;
import ee.sm.ti.teis.exceptions.TeisResourceNotFoundException;
import ee.sm.ti.teis.types.enums.ObjectStatus;
import org.springframework.data.querydsl.QuerydslPredicateExecutor;
import org.springframework.data.repository.CrudRepository;
......@@ -13,7 +12,7 @@ public interface OfficialsGroupRepository extends CrudRepository<OfficialsGroupE
List<OfficialsGroupEntity> findByObjectStatus(ObjectStatus status);
OfficialsGroupEntity findFirstByIdAndObjectStatus(UUID id, ObjectStatus status) throws TeisResourceNotFoundException;
OfficialsGroupEntity findFirstByIdAndObjectStatus(UUID id, ObjectStatus status);
List<OfficialsGroupEntity> findAll();
......
......@@ -6,12 +6,9 @@ import ee.sm.ti.teis.domainrequest.DomainResponseDTO;
import ee.sm.ti.teis.officials.config.QueueConfig;
import ee.sm.ti.teis.officials.group.OfficialsGroupEntity;
import ee.sm.ti.teis.officials.group.service.OfficialsGroupService;
import ee.sm.ti.teis.types.enums.ObjectStatus;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;
import static java.util.Optional.ofNullable;
@Component
public class OfficialsGroupMsListener {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment