@Override
        public PolicyTestBackEndApiResponse invoke(ApiRequest request, byte[] requestBody) {
            ApiResponse apiResponse = new ApiResponse();
            apiResponse.setCode(200);
            apiResponse.setMessage("OK"); //$NON-NLS-1$
            apiResponse.getHeaders().put("Date", new Date().toString()); //$NON-NLS-1$
            apiResponse.getHeaders().put("Server", "apiman.policy-test"); //$NON-NLS-1$ //$NON-NLS-2$
            apiResponse.getHeaders().put("Content-Type", "text/plain"); //$NON-NLS-1$ //$NON-NLS-2$

            int payloadSize = 20;
            String payloadSizeHeader = request.getHeaders().get("X-Payload-Size");
            if (payloadSizeHeader != null) {
                payloadSize = Integer.parseInt(payloadSizeHeader);
            }

            byte [] payloadData = new byte[payloadSize];
            Arrays.fill(payloadData, (byte) 80);
            String payload = new String(payloadData);
            return new PolicyTestBackEndApiResponse(apiResponse, payload);
        }
@see io.apiman.test.policies.IPolicyTestBackEndApi#invoke(io.apiman.gateway.engine.beans.ApiRequest, byte[])
gateway/engine/policies/src/test/java/io/apiman/gateway/engine/policies/TransferQuotaPolicyTest.java