Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -231,11 +231,22 @@ public URI getIdentifier() {
* Get the purposes of the access grant.
*
* @return the access grant purposes
* @deprecated as of Beta3, please use the {@link #getPurposes()} method
*/
@Deprecated
public Set<String> getPurpose() {
return purposes;
}

/**
* Get the purposes of the access grant.
*
* @return the access grant purposes
*/
public Set<String> getPurposes() {
return purposes;
}

/**
* Get the resources associated with the access grant.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ void testIssueGrant() {
assertEquals(expiration, grant.getExpiration());
assertEquals(baseUri, grant.getIssuer());
assertEquals(purposes, grant.getPurpose());
assertEquals(purposes, grant.getPurposes());
assertEquals(resources, grant.getResources());
}

Expand Down Expand Up @@ -250,6 +251,7 @@ void testIssueRequest() {
assertEquals(expiration, request.getExpiration());
assertEquals(baseUri, request.getIssuer());
assertEquals(purposes, request.getPurpose());
assertEquals(purposes, request.getPurposes());
assertEquals(resources, request.getResources());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ void testReadAccessGrant() throws IOException {
assertEquals(URI.create("https://accessgrant.example/credential/5c6060ad-2f16-4bc1-b022-dffb46bff626"),
grant.getIdentifier());
assertEquals(Collections.singleton("https://purpose.example/Purpose1"), grant.getPurpose());
assertEquals(Collections.singleton("https://purpose.example/Purpose1"), grant.getPurposes());
assertEquals(Collections.singleton(
URI.create("https://storage.example/e973cc3d-5c28-4a10-98c5-e40079289358/")),
grant.getResources());
Expand Down Expand Up @@ -88,6 +89,7 @@ void testReadAccessGrantSingletons() throws IOException {
assertEquals(URI.create("https://accessgrant.example/credential/5c6060ad-2f16-4bc1-b022-dffb46bff626"),
grant.getIdentifier());
assertEquals(Collections.singleton("https://purpose.example/Purpose1"), grant.getPurpose());
assertEquals(Collections.singleton("https://purpose.example/Purpose1"), grant.getPurposes());
assertEquals(Collections.singleton(
URI.create("https://storage.example/e973cc3d-5c28-4a10-98c5-e40079289358/")),
grant.getResources());
Expand Down