@Test(expected = NoSuchElementException.class) public void testGetStatusUnknownResourceId() { MultiStatusResponse response = new MultiStatusResponse(Collections.singletonMap("foo", 42)); response.getStatus("nonExistingResource"); }
public int getStatus(String resId) { Integer status = responses.get(resId); if (status == null) { throw new NoSuchElementException("Unknown resource ID: " + resId + "; not contained in this multi-status response."); } return status; }
MultiStatusResponse { public int getStatus(String resId) { Integer status = responses.get(resId); if (status == null) { throw new NoSuchElementException("Unknown resource ID: " + resId + "; not contained in this multi-status response."); } return status; } }
MultiStatusResponse { public int getStatus(String resId) { Integer status = responses.get(resId); if (status == null) { throw new NoSuchElementException("Unknown resource ID: " + resId + "; not contained in this multi-status response."); } return status; } MultiStatusResponse(Map<String, Integer> responses); }
MultiStatusResponse { public int getStatus(String resId) { Integer status = responses.get(resId); if (status == null) { throw new NoSuchElementException("Unknown resource ID: " + resId + "; not contained in this multi-status response."); } return status; } MultiStatusResponse(Map<String, Integer> responses); static MultiStatusResponse fromJson(ObjectMapper mapper, InputStream stream); Map<String, Integer> getResponses(); int responseCount(); boolean isAllSuccess(); boolean hasResourceId(String resId); int getStatus(String resId); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); }
MultiStatusResponse { public int getStatus(String resId) { Integer status = responses.get(resId); if (status == null) { throw new NoSuchElementException("Unknown resource ID: " + resId + "; not contained in this multi-status response."); } return status; } MultiStatusResponse(Map<String, Integer> responses); static MultiStatusResponse fromJson(ObjectMapper mapper, InputStream stream); Map<String, Integer> getResponses(); int responseCount(); boolean isAllSuccess(); boolean hasResourceId(String resId); int getStatus(String resId); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }