|
|
@ -92,8 +92,6 @@ public class AuthenticationHandlerTest extends BaseAPIHandlerTest {
|
|
|
|
HashMap<String, String> transportHeaders = new HashMap<>();
|
|
|
|
HashMap<String, String> transportHeaders = new HashMap<>();
|
|
|
|
transportHeaders.put(AuthConstants.MDM_SIGNATURE, "some cert");
|
|
|
|
transportHeaders.put(AuthConstants.MDM_SIGNATURE, "some cert");
|
|
|
|
setMockClient();
|
|
|
|
setMockClient();
|
|
|
|
this.mockClient.setResponse(getDCRResponse());
|
|
|
|
|
|
|
|
this.mockClient.setResponse(getAccessTokenReponse());
|
|
|
|
|
|
|
|
this.mockClient.setResponse(getValidationResponse());
|
|
|
|
this.mockClient.setResponse(getValidationResponse());
|
|
|
|
boolean response = this.handler.handleRequest(createSynapseMessageContext("<empty/>", this.synapseConfiguration,
|
|
|
|
boolean response = this.handler.handleRequest(createSynapseMessageContext("<empty/>", this.synapseConfiguration,
|
|
|
|
transportHeaders, "https://test.com/testservice/device-mgt/testdevice"));
|
|
|
|
transportHeaders, "https://test.com/testservice/device-mgt/testdevice"));
|
|
|
@ -107,7 +105,6 @@ public class AuthenticationHandlerTest extends BaseAPIHandlerTest {
|
|
|
|
HashMap<String, String> transportHeaders = new HashMap<>();
|
|
|
|
HashMap<String, String> transportHeaders = new HashMap<>();
|
|
|
|
transportHeaders.put(AuthConstants.PROXY_MUTUAL_AUTH_HEADER, "Test Header");
|
|
|
|
transportHeaders.put(AuthConstants.PROXY_MUTUAL_AUTH_HEADER, "Test Header");
|
|
|
|
setMockClient();
|
|
|
|
setMockClient();
|
|
|
|
this.mockClient.setResponse(getAccessTokenReponse());
|
|
|
|
|
|
|
|
this.mockClient.setResponse(getValidationResponse());
|
|
|
|
this.mockClient.setResponse(getValidationResponse());
|
|
|
|
boolean response = this.handler.handleRequest(createSynapseMessageContext("<empty/>", this.synapseConfiguration,
|
|
|
|
boolean response = this.handler.handleRequest(createSynapseMessageContext("<empty/>", this.synapseConfiguration,
|
|
|
|
transportHeaders, "https://test.com/testservice/device-mgt/testdevice"));
|
|
|
|
transportHeaders, "https://test.com/testservice/device-mgt/testdevice"));
|
|
|
@ -121,7 +118,6 @@ public class AuthenticationHandlerTest extends BaseAPIHandlerTest {
|
|
|
|
HashMap<String, String> transportHeaders = new HashMap<>();
|
|
|
|
HashMap<String, String> transportHeaders = new HashMap<>();
|
|
|
|
transportHeaders.put(AuthConstants.MUTUAL_AUTH_HEADER, "Test Header");
|
|
|
|
transportHeaders.put(AuthConstants.MUTUAL_AUTH_HEADER, "Test Header");
|
|
|
|
setMockClient();
|
|
|
|
setMockClient();
|
|
|
|
this.mockClient.setResponse(getAccessTokenReponse());
|
|
|
|
|
|
|
|
this.mockClient.setResponse(getValidationResponse());
|
|
|
|
this.mockClient.setResponse(getValidationResponse());
|
|
|
|
MessageContext messageContext = createSynapseMessageContext("<empty/>", this.synapseConfiguration,
|
|
|
|
MessageContext messageContext = createSynapseMessageContext("<empty/>", this.synapseConfiguration,
|
|
|
|
transportHeaders, "https://test.com/testservice/device-mgt/testdevice");
|
|
|
|
transportHeaders, "https://test.com/testservice/device-mgt/testdevice");
|
|
|
@ -141,7 +137,6 @@ public class AuthenticationHandlerTest extends BaseAPIHandlerTest {
|
|
|
|
HashMap<String, String> transportHeaders = new HashMap<>();
|
|
|
|
HashMap<String, String> transportHeaders = new HashMap<>();
|
|
|
|
transportHeaders.put(AuthConstants.ENCODED_PEM, "encoded pem");
|
|
|
|
transportHeaders.put(AuthConstants.ENCODED_PEM, "encoded pem");
|
|
|
|
setMockClient();
|
|
|
|
setMockClient();
|
|
|
|
this.mockClient.setResponse(getAccessTokenReponse());
|
|
|
|
|
|
|
|
this.mockClient.setResponse(getValidationResponse());
|
|
|
|
this.mockClient.setResponse(getValidationResponse());
|
|
|
|
MessageContext messageContext = createSynapseMessageContext("<empty/>", this.synapseConfiguration,
|
|
|
|
MessageContext messageContext = createSynapseMessageContext("<empty/>", this.synapseConfiguration,
|
|
|
|
transportHeaders, "https://test.com/testservice/device-mgt/testdevice");
|
|
|
|
transportHeaders, "https://test.com/testservice/device-mgt/testdevice");
|
|
|
@ -156,7 +151,6 @@ public class AuthenticationHandlerTest extends BaseAPIHandlerTest {
|
|
|
|
HashMap<String, String> transportHeaders = new HashMap<>();
|
|
|
|
HashMap<String, String> transportHeaders = new HashMap<>();
|
|
|
|
transportHeaders.put(AuthConstants.ENCODED_PEM, "encoded pem");
|
|
|
|
transportHeaders.put(AuthConstants.ENCODED_PEM, "encoded pem");
|
|
|
|
setMockClient();
|
|
|
|
setMockClient();
|
|
|
|
this.mockClient.setResponse(getAccessTokenReponse());
|
|
|
|
|
|
|
|
this.mockClient.setResponse(getInvalidResponse());
|
|
|
|
this.mockClient.setResponse(getInvalidResponse());
|
|
|
|
MessageContext messageContext = createSynapseMessageContext("<empty/>", this.synapseConfiguration,
|
|
|
|
MessageContext messageContext = createSynapseMessageContext("<empty/>", this.synapseConfiguration,
|
|
|
|
transportHeaders, "https://test.com/testservice/device-mgt/testdevice");
|
|
|
|
transportHeaders, "https://test.com/testservice/device-mgt/testdevice");
|
|
|
@ -185,7 +179,6 @@ public class AuthenticationHandlerTest extends BaseAPIHandlerTest {
|
|
|
|
HashMap<String, String> transportHeaders = new HashMap<>();
|
|
|
|
HashMap<String, String> transportHeaders = new HashMap<>();
|
|
|
|
transportHeaders.put(AuthConstants.ENCODED_PEM, "encoded pem");
|
|
|
|
transportHeaders.put(AuthConstants.ENCODED_PEM, "encoded pem");
|
|
|
|
setMockClient();
|
|
|
|
setMockClient();
|
|
|
|
this.mockClient.setResponse(getAccessTokenReponse());
|
|
|
|
|
|
|
|
this.mockClient.setResponse(null);
|
|
|
|
this.mockClient.setResponse(null);
|
|
|
|
MessageContext messageContext = createSynapseMessageContext("<empty/>", this.synapseConfiguration,
|
|
|
|
MessageContext messageContext = createSynapseMessageContext("<empty/>", this.synapseConfiguration,
|
|
|
|
transportHeaders, "https://test.com/testservice/device-mgt/testdevice");
|
|
|
|
transportHeaders, "https://test.com/testservice/device-mgt/testdevice");
|
|
|
|