Skip to content

Commit 3f4fe30

Browse files
authored
JCL-340: Pluralize getter methods in the accessgrant module (#460)
1 parent 9fde98f commit 3f4fe30

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

access-grant/src/main/java/com/inrupt/client/accessgrant/AccessGrant.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,11 +231,22 @@ public URI getIdentifier() {
231231
* Get the purposes of the access grant.
232232
*
233233
* @return the access grant purposes
234+
* @deprecated as of Beta3, please use the {@link #getPurposes()} method
234235
*/
236+
@Deprecated
235237
public Set<String> getPurpose() {
236238
return purposes;
237239
}
238240

241+
/**
242+
* Get the purposes of the access grant.
243+
*
244+
* @return the access grant purposes
245+
*/
246+
public Set<String> getPurposes() {
247+
return purposes;
248+
}
249+
239250
/**
240251
* Get the resources associated with the access grant.
241252
*

access-grant/src/test/java/com/inrupt/client/accessgrant/AccessGrantClientTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,7 @@ void testIssueGrant() {
222222
assertEquals(expiration, grant.getExpiration());
223223
assertEquals(baseUri, grant.getIssuer());
224224
assertEquals(purposes, grant.getPurpose());
225+
assertEquals(purposes, grant.getPurposes());
225226
assertEquals(resources, grant.getResources());
226227
}
227228

@@ -250,6 +251,7 @@ void testIssueRequest() {
250251
assertEquals(expiration, request.getExpiration());
251252
assertEquals(baseUri, request.getIssuer());
252253
assertEquals(purposes, request.getPurpose());
254+
assertEquals(purposes, request.getPurposes());
253255
assertEquals(resources, request.getResources());
254256
}
255257

access-grant/src/test/java/com/inrupt/client/accessgrant/AccessGrantTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ void testReadAccessGrant() throws IOException {
5858
assertEquals(URI.create("https://accessgrant.example/credential/5c6060ad-2f16-4bc1-b022-dffb46bff626"),
5959
grant.getIdentifier());
6060
assertEquals(Collections.singleton("https://purpose.example/Purpose1"), grant.getPurpose());
61+
assertEquals(Collections.singleton("https://purpose.example/Purpose1"), grant.getPurposes());
6162
assertEquals(Collections.singleton(
6263
URI.create("https://storage.example/e973cc3d-5c28-4a10-98c5-e40079289358/")),
6364
grant.getResources());
@@ -88,6 +89,7 @@ void testReadAccessGrantSingletons() throws IOException {
8889
assertEquals(URI.create("https://accessgrant.example/credential/5c6060ad-2f16-4bc1-b022-dffb46bff626"),
8990
grant.getIdentifier());
9091
assertEquals(Collections.singleton("https://purpose.example/Purpose1"), grant.getPurpose());
92+
assertEquals(Collections.singleton("https://purpose.example/Purpose1"), grant.getPurposes());
9193
assertEquals(Collections.singleton(
9294
URI.create("https://storage.example/e973cc3d-5c28-4a10-98c5-e40079289358/")),
9395
grant.getResources());

0 commit comments

Comments
 (0)