EntityResourceDefinition extends BaseResourceDefinition { @Override public String resolveHref(Map<String, Object> properties) { Object id = properties.get("id"); return id == null ? null : String.format("v1/entities/%s", id); } EntityResourceDefinition(); @Override String getIdPropertyName(); @Override String getTypeName(); @Override void validateCreatePayload(Request request); @Override String resolveHref(Map<String, Object> properties);  }
@Test public void testResolveHref() { Map<String, Object> resourceProps = new HashMap<>(); resourceProps.put("id", "111-222-333"); resourceProps.put("name", "foo"); ResourceDefinition entityDefinition = new EntityResourceDefinition(); String href = entityDefinition.resolveHref(resourceProps); assertEquals(href, "v1/entities/111-222-333"); }