Commit 0398216f authored by Raigo Ukkivi's avatar Raigo Ukkivi
Browse files

In MS listener change logic to same as in GW listener, i.e. if group is asked...

In MS listener change logic to same as in GW listener, i.e. if group is asked by id, do not check statuses.
parent 26018043
......@@ -63,6 +63,13 @@ class OfficialsMsListenerTest extends OfficialsAppTestBase {
assertThat(response.getPayload().getId()).isEqualTo(UUID.fromString(USER_ID));
}
@Test
void findDeletedOfficialUser() {
OfficialMsListener.OfficialUserMsResponse response = officialListener.findOfficialUser(composeOfficialUserRequest(DELETED_USER_ID));
assertThat(response.getPayload().getId()).isEqualTo(UUID.fromString(DELETED_USER_ID));
}
@Test
void findOfficialUsers_by_idCode() {
OfficialMsListener.OfficialUsersMsResponse response = officialListener.findOfficialUsers(composeOfficialUsersRequest(ACTIVE_USER_IDCODE));
......
......@@ -15,7 +15,6 @@ import static java.util.Optional.ofNullable;
@Component
public class OfficialsGroupMsListener {
private final OfficialsGroupService service;
public OfficialsGroupMsListener(OfficialsGroupService service) {
......@@ -23,10 +22,8 @@ public class OfficialsGroupMsListener {
}
@RabbitListener(queues = {QueueConfig.MS_OFFICIALS_GROUPS_QUEUE})
public OfficialsGroupsDomainResponse findOfficialsGroups(QueueConfig.OfficialUserGroupDomainRequest request) {
ObjectStatus status = service.validateAndAssignDefaultStatus(
ofNullable(request.getPayload().getObjectStatus()).map(t -> t.name()).orElse(null));
OfficialsGroupEntity entity = service.findGroupByIdAndStatus(request.getPayload().getId(), status);
public OfficialsGroupsDomainResponse findOfficialsGroup(QueueConfig.OfficialUserGroupDomainRequest request) {
OfficialsGroupEntity entity = service.findGroup(request.getPayload().getId());
OfficialsGroupsDomainResponse response = new OfficialsGroupsDomainResponse();
response.setPayload(service.composeDomainDtoFromEntity(entity), request.getRequestMetaDTO());
return response;
......
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