### Question:
ServiceV3AuthsGetResponseDeviceJWE { public AuthResponsePolicy getAuthPolicy() { return authPolicy; } ServiceV3AuthsGetResponseDeviceJWE(
            @JsonProperty(value = "type") String type,
            @JsonProperty(value = "reason") String reason,
            @JsonProperty(value = "denial_reason") String denialReason,
            @JsonProperty(value = "auth_request") UUID authorizationRequestId,
            @JsonProperty(value = "device_id") String deviceId,
            @JsonProperty(value = "service_pins") String[] servicePins,
            @JsonProperty(value = "auth_policy") AuthResponsePolicy authPolicy,
            @JsonProperty(value = "auth_methods") AuthMethod[] authMethods); String getType(); String getReason(); String getDenialReason(); UUID getAuthorizationRequestId(); String getDeviceId(); String[] getServicePins(); AuthResponsePolicy getAuthPolicy(); AuthMethod[] getAuthMethods(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }### Answer:
@Test public void getAuthPolicy() { AuthResponsePolicy expected = new AuthResponsePolicy("AMOUNT", 2, null, null); ServiceV3AuthsGetResponseDeviceJWE actual = new ServiceV3AuthsGetResponseDeviceJWE("Type", "Reason", "Denial Reason", UUID.randomUUID(), "Device ID", new String[]{"1", "2", "3"}, expected, null); assertEquals(expected, actual.getAuthPolicy()); }
@Test public void verifyJsonParseWithEmptyPolicyBuildsEmptyPolicy() throws Exception { String json = "{" + " \"type\": \"FAILED\"," + " \"reason\": \"CONFIGURATION\"," + " \"device_id\": \"c07c4907-dc67-11e7-bb14-0469f8dc10a5\"," + " \"service_pins\": [\"2648\", \"2046\", \"0583\", \"2963\", \"2046\"]," + " \"auth_request\": \"5d1acf5c-dc5d-11e7-9ea1-0469f8dc10a5\"," + " \"auth_policy\": {}" + "}"; ServiceV3AuthsGetResponseDeviceJWE actual = new ObjectMapper().readValue(json, ServiceV3AuthsGetResponseDeviceJWE.class); assertEquals(new AuthResponsePolicy(null, 0, null, null), actual.getAuthPolicy()); }
@Test public void verifyJsonParseWithNoPolicyReturnsNullForPolicy() throws Exception { String json = "{" + " \"type\": \"FAILED\"," + " \"reason\": \"CONFIGURATION\"," + " \"device_id\": \"c07c4907-dc67-11e7-bb14-0469f8dc10a5\"," + " \"service_pins\": [\"2648\", \"2046\", \"0583\", \"2963\", \"2046\"]," + " \"auth_request\": \"5d1acf5c-dc5d-11e7-9ea1-0469f8dc10a5\"," + " \"auth_policy\": null" + "}"; ServiceV3AuthsGetResponseDeviceJWE actual = new ObjectMapper().readValue(json, ServiceV3AuthsGetResponseDeviceJWE.class); assertNull(actual.getAuthPolicy()); }