Commit c7893b4f authored by Siiri Tann's avatar Siiri Tann
Browse files

TEIS-2082: new endpoint for testing getRolesByEmailRecipient. added email...

TEIS-2082: new endpoint for testing getRolesByEmailRecipient. added email recipient field to RoleDefinitionPublicDto.
parents 94a05735 6872a730
......@@ -23,6 +23,7 @@ public class RoleDefinitionPublicDto {
private String excludedRoleOverlap;
private Long defaultValidityPeriod;
private Boolean locationLink;
private Boolean emailRecipient;
private String objectStatus;
}
package ee.sm.ti.teis.commongateway.role;
import ee.sm.ti.teis.AbstractDTO;
import ee.sm.ti.teis.ErrorDTO;
public class TestRolesDefinitionsRequest extends AbstractDTO<Boolean, ErrorDTO> {
public static final String ROUTING_KEY = "api.RolesDefinitionsTestRequest";
@Override
public String routingKey() {
return ROUTING_KEY;
}
}
package ee.sm.ti.teis.commongateway.role;
import ee.sm.ti.teis.AbstractDTO;
import ee.sm.ti.teis.ErrorDTO;
import java.util.List;
public class TestRolesDefinitionsResponse extends AbstractDTO<List<RoleDefinitionPublicDto>, ErrorDTO> {
public static final String ROUTING_KEY = "api.RolesDefinitionsTestResponse";
@Override
public String routingKey() {
return ROUTING_KEY;
}
}
......@@ -47,4 +47,16 @@ class RoleTestControllerTest extends CommonApiGatewayTestBase {
verify(requestProcessingService).sendAndReceive(any(TestRolePrivilegesRequest.class));
}
@Test
void getRolesByEmailRecipient_success() {
when(requestProcessingService.sendAndReceive(any(TestRolesDefinitionsRequest.class)))
.thenReturn(List.of(new RoleDefinitionPublicDto()));
parameters.add("emailRecipient", "true");
mockMvcUtil.testGet(BASE_URL + "rolesbyemailrecipient", parameters, new TypeReference<List<RoleDefinitionPublicDto>>() {
});
verify(requestProcessingService).sendAndReceive(any(TestRolesDefinitionsRequest.class));
}
}
......@@ -55,4 +55,14 @@ public class RoleTestController extends TeisBaseController {
return (Set<String>) service.sendAndReceive(request);
}
@ApiOperation(value = "${teis.api.messages.get-roles-by-email-recipient}")
@GetMapping("rolesbyemailrecipient")
public List<RoleDefinitionPublicDto> getRolesByEmailRecipient(@RequestParam(value = "emailRecipient") Boolean emailRecipient,
RequestMetaDTO requestMetaDTO) {
TestRolesDefinitionsRequest request = new TestRolesDefinitionsRequest();
request.setPayload(emailRecipient, requestMetaDTO);
return (List<RoleDefinitionPublicDto>) service.sendAndReceive(request);
}
}
......@@ -41,6 +41,7 @@ teis.api.messages.patch-contacts: Isiku, kelle poolet esindajaks olemise andmeid
teis.api.messages.auth-config: Tagastab autentimise jaoks vajalikud parameetrid
teis.api.messages.auth-token: Access tokeni pärimine ajutise ligipääsu koodi või refresh_tokeni alusel.
teis.api.messages.get-role-definitions-privileges: Teenus väljastab rollide privileegid. Teenust kasutatakse selleks, et kui on teada kasutaja rollid, siis oleks võimalik teada saada kasutaja privileegid.
teis.api.messages.get-roles-by-email-recipient: Teenus väljastab kõik rollid, millel on vastav email recipient väärtusega märge.
teis.api.messages.get-role-definitions-privileges-ids: 346a9e4c-59c5-4368-8b1f-90e06e3b6514,86cd6b6e-1b53-4997-a2fd-630b06d33f74
teis.api.messages.post-audit-log: Teenus lisab uue uue audit logi kirje
teis.api.messages.get-audit-log: Teenus tagastab soovitud objektiga seotud audit logi kirjed. Kui sisendis on esindatud mõlemad id väljad, kasutatakse otsingus dataObjectId-d.
......
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