@Test public void getFullAttributesArp() throws IOException { Map data = objectMapper.readValue(new ClassPathResource("janus-json/full-arp.json").getInputStream(), Map.class); when(restTemplate.getForObject((URI) anyObject(), eq(Map.class))).thenReturn(data); ARP arp = janusRestClient.getArp("entityid"); assertFalse(arp.isNoArp()); assertFalse(arp.isNoAttrArp()); assertFalse(arp.getAttributes().isEmpty()); }
@Override public ARP getArp(String entityId) { Map<String, String> parameters = new HashMap<String, String>(); parameters.put("entityid", entityId); URI signedUri = null; try { signedUri = sign("arp", parameters); if (LOG.isTraceEnabled()) { LOG.trace("Signed Janus-request is: {}", signedUri); } } catch (IOException e) { LOG.error("Could not do ARP request to Janus", e); } final Map restResponse = restTemplate.getForObject(signedUri, Map.class); if (LOG.isTraceEnabled()) { LOG.trace("Janus-request returned: {}", restResponse.toString()); } return (restResponse == null) ? null : ARP.fromRestResponse(restResponse); }
JanusRestClient implements Janus { @Override public ARP getArp(String entityId) { Map<String, String> parameters = new HashMap<String, String>(); parameters.put("entityid", entityId); URI signedUri = null; try { signedUri = sign("arp", parameters); if (LOG.isTraceEnabled()) { LOG.trace("Signed Janus-request is: {}", signedUri); } } catch (IOException e) { LOG.error("Could not do ARP request to Janus", e); } final Map restResponse = restTemplate.getForObject(signedUri, Map.class); if (LOG.isTraceEnabled()) { LOG.trace("Janus-request returned: {}", restResponse.toString()); } return (restResponse == null) ? null : ARP.fromRestResponse(restResponse); } }
JanusRestClient implements Janus { @Override public ARP getArp(String entityId) { Map<String, String> parameters = new HashMap<String, String>(); parameters.put("entityid", entityId); URI signedUri = null; try { signedUri = sign("arp", parameters); if (LOG.isTraceEnabled()) { LOG.trace("Signed Janus-request is: {}", signedUri); } } catch (IOException e) { LOG.error("Could not do ARP request to Janus", e); } final Map restResponse = restTemplate.getForObject(signedUri, Map.class); if (LOG.isTraceEnabled()) { LOG.trace("Janus-request returned: {}", restResponse.toString()); } return (restResponse == null) ? null : ARP.fromRestResponse(restResponse); } JanusRestClient(); }
JanusRestClient implements Janus { @Override public ARP getArp(String entityId) { Map<String, String> parameters = new HashMap<String, String>(); parameters.put("entityid", entityId); URI signedUri = null; try { signedUri = sign("arp", parameters); if (LOG.isTraceEnabled()) { LOG.trace("Signed Janus-request is: {}", signedUri); } } catch (IOException e) { LOG.error("Could not do ARP request to Janus", e); } final Map restResponse = restTemplate.getForObject(signedUri, Map.class); if (LOG.isTraceEnabled()) { LOG.trace("Janus-request returned: {}", restResponse.toString()); } return (restResponse == null) ? null : ARP.fromRestResponse(restResponse); } JanusRestClient(); @Override EntityMetadata getMetadataByEntityId(String entityId); @Override List<String> getEntityIdsByMetaData(Metadata key, String value); @Override List<String> getAllowedSps(String idpentityid); @Override List<String> getAllowedSps(String idpentityid, String revision); @Override List<EntityMetadata> getSpList(); @Override List<EntityMetadata> getIdpList(); @Override ARP getArp(String entityId); @Override boolean isConnectionAllowed(String spEntityId, String idpEntityId); @Override JanusEntity getEntity(String entityId); void setRestTemplate(RestTemplate restTemplate); void setJanusUri(URI janusUri); void setUser(String user); void setSecret(String secret); }
JanusRestClient implements Janus { @Override public ARP getArp(String entityId) { Map<String, String> parameters = new HashMap<String, String>(); parameters.put("entityid", entityId); URI signedUri = null; try { signedUri = sign("arp", parameters); if (LOG.isTraceEnabled()) { LOG.trace("Signed Janus-request is: {}", signedUri); } } catch (IOException e) { LOG.error("Could not do ARP request to Janus", e); } final Map restResponse = restTemplate.getForObject(signedUri, Map.class); if (LOG.isTraceEnabled()) { LOG.trace("Janus-request returned: {}", restResponse.toString()); } return (restResponse == null) ? null : ARP.fromRestResponse(restResponse); } JanusRestClient(); @Override EntityMetadata getMetadataByEntityId(String entityId); @Override List<String> getEntityIdsByMetaData(Metadata key, String value); @Override List<String> getAllowedSps(String idpentityid); @Override List<String> getAllowedSps(String idpentityid, String revision); @Override List<EntityMetadata> getSpList(); @Override List<EntityMetadata> getIdpList(); @Override ARP getArp(String entityId); @Override boolean isConnectionAllowed(String spEntityId, String idpEntityId); @Override JanusEntity getEntity(String entityId); void setRestTemplate(RestTemplate restTemplate); void setJanusUri(URI janusUri); void setUser(String user); void setSecret(String secret);  }