This is a minimal HAL and HAL-FORMS client, to be used with integration tests.
var halFormsClient = HalFormsClient.builder().restClient(restClient).build();
var orgs = halFormsClient.follow(HalLink.from(URI.create("http://api.contentgrid.test/orgs")));
var myOrg = halFormsClient.requestDefaultTemplate(orgs)
.properties(Map.of("display_name", "test"))
.execute().toHalDocument();
var projects = halFormsClient.follow(myOrg.getRequiredLink("projects"));
var testProject = halFormsClient.requestDefaultTemplate(projects)
.properties(Map.of("name", "test"))
.execute().toHalDocument();
- More explicit support for OAuth2 clients
- Use Spring HATEOAS concepts:
RepresentationModel<T> - Use Spring HATEOAS / Traverson concepts:
LinkRelation,LinkDiscoverer, ... - Base internals on
RestOperationsto improve testability, potentially usingRestOperationsAdapter - Add support to automatically follow redirects (HTTP 302)
- Let
DefaultHalFormsClientextendDefaultHalClientto avoid duplication (possibly via ServiceLoader)