@Test public void signServiceClientMetadata() { when(dssMetadataService.getClientMetadataAsString()).thenReturn("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Test>Inera AB</Test>"); Response response = signatureApiController.signServiceClientMetadata(); assertNotNull(response); assertEquals(Response.Status.OK.getStatusCode(), response.getStatus()); assertNotNull(response.getEntity()); assertEquals("application/samlmetadata+xml", response.getMediaType().toString()); assertEquals("attachment; filename=\"wc_dss_client_metadata.xml\"", response.getHeaderString(HttpHeaders.CONTENT_DISPOSITION)); }
@GET @Path(SIGN_SERVICE_METADATA_PATH) public Response signServiceClientMetadata() { String clientMetadataAsString = dssMetadataService.getClientMetadataAsString(); ResponseBuilder responseBuilder = Response.ok(clientMetadataAsString) .header(HttpHeaders.CONTENT_TYPE, "application/samlmetadata+xml") .header(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=\"wc_dss_client_metadata.xml\""); return responseBuilder.build(); }
SignatureApiController extends AbstractApiController { @GET @Path(SIGN_SERVICE_METADATA_PATH) public Response signServiceClientMetadata() { String clientMetadataAsString = dssMetadataService.getClientMetadataAsString(); ResponseBuilder responseBuilder = Response.ok(clientMetadataAsString) .header(HttpHeaders.CONTENT_TYPE, "application/samlmetadata+xml") .header(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=\"wc_dss_client_metadata.xml\""); return responseBuilder.build(); } }
SignatureApiController extends AbstractApiController { @GET @Path(SIGN_SERVICE_METADATA_PATH) public Response signServiceClientMetadata() { String clientMetadataAsString = dssMetadataService.getClientMetadataAsString(); ResponseBuilder responseBuilder = Response.ok(clientMetadataAsString) .header(HttpHeaders.CONTENT_TYPE, "application/samlmetadata+xml") .header(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=\"wc_dss_client_metadata.xml\""); return responseBuilder.build(); }  }
SignatureApiController extends AbstractApiController { @GET @Path(SIGN_SERVICE_METADATA_PATH) public Response signServiceClientMetadata() { String clientMetadataAsString = dssMetadataService.getClientMetadataAsString(); ResponseBuilder responseBuilder = Response.ok(clientMetadataAsString) .header(HttpHeaders.CONTENT_TYPE, "application/samlmetadata+xml") .header(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=\"wc_dss_client_metadata.xml\""); return responseBuilder.build(); }  @POST @Path("/{intygsTyp}/{intygsId}/{version}/signeringshash/{signMethod}") @Produces(MediaType.APPLICATION_JSON + UTF_8_CHARSET) @PrometheusTimeMethod SignaturStateDTO signeraUtkast(@PathParam("intygsTyp") String intygsTyp, @PathParam("intygsId") String intygsId,
        @PathParam("version") long version, @PathParam("signMethod") String signMethodStr); @POST @Path(SIGN_SERVICE_RESPONSE_PATH) @PrometheusTimeMethod Response signServiceResponse(@FormParam("RelayState") String relayState, @FormParam("EidSignResponse") String eidSignResponse); @GET @Path(SIGN_SERVICE_METADATA_PATH) Response signServiceClientMetadata(); @GET @Path("/{intygsTyp}/{ticketId}/signeringsstatus") @Produces(MediaType.APPLICATION_JSON + UTF_8_CHARSET) SignaturStateDTO signeringsStatus(@PathParam("intygsTyp") String intygsTyp, @PathParam("ticketId") String ticketId); @POST @Path("/{intygsTyp}/{biljettId}/signeranetidplugin") @Consumes({MediaType.APPLICATION_JSON, MediaType.APPLICATION_OCTET_STREAM}) @Produces(MediaType.APPLICATION_JSON + UTF_8_CHARSET) SignaturStateDTO klientSigneraUtkast(@PathParam("intygsTyp") String intygsTyp, @PathParam("biljettId") String biljettId,
        @Context HttpServletRequest request, KlientSignaturRequest signaturRequest); }
SignatureApiController extends AbstractApiController { @GET @Path(SIGN_SERVICE_METADATA_PATH) public Response signServiceClientMetadata() { String clientMetadataAsString = dssMetadataService.getClientMetadataAsString(); ResponseBuilder responseBuilder = Response.ok(clientMetadataAsString) .header(HttpHeaders.CONTENT_TYPE, "application/samlmetadata+xml") .header(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=\"wc_dss_client_metadata.xml\""); return responseBuilder.build(); }  @POST @Path("/{intygsTyp}/{intygsId}/{version}/signeringshash/{signMethod}") @Produces(MediaType.APPLICATION_JSON + UTF_8_CHARSET) @PrometheusTimeMethod SignaturStateDTO signeraUtkast(@PathParam("intygsTyp") String intygsTyp, @PathParam("intygsId") String intygsId,
        @PathParam("version") long version, @PathParam("signMethod") String signMethodStr); @POST @Path(SIGN_SERVICE_RESPONSE_PATH) @PrometheusTimeMethod Response signServiceResponse(@FormParam("RelayState") String relayState, @FormParam("EidSignResponse") String eidSignResponse); @GET @Path(SIGN_SERVICE_METADATA_PATH) Response signServiceClientMetadata(); @GET @Path("/{intygsTyp}/{ticketId}/signeringsstatus") @Produces(MediaType.APPLICATION_JSON + UTF_8_CHARSET) SignaturStateDTO signeringsStatus(@PathParam("intygsTyp") String intygsTyp, @PathParam("ticketId") String ticketId); @POST @Path("/{intygsTyp}/{biljettId}/signeranetidplugin") @Consumes({MediaType.APPLICATION_JSON, MediaType.APPLICATION_OCTET_STREAM}) @Produces(MediaType.APPLICATION_JSON + UTF_8_CHARSET) SignaturStateDTO klientSigneraUtkast(@PathParam("intygsTyp") String intygsTyp, @PathParam("biljettId") String biljettId,
        @Context HttpServletRequest request, KlientSignaturRequest signaturRequest); static final String SIGNATUR_API_CONTEXT_PATH; static final String SIGN_SERVICE_RESPONSE_PATH; static final String SIGN_SERVICE_METADATA_PATH; }