[ARVADOS] created: 2.1.0-1690-gf33aef679

Git user git at public.arvados.org
Wed Dec 1 19:36:48 UTC 2021


        at  f33aef679ff66f8623e0a9ccb9f3fc0a81322507 (commit)


commit f33aef679ff66f8623e0a9ccb9f3fc0a81322507
Merge: 350a728ce 4a598dbcd
Author: Peter Amstutz <peter.amstutz at curii.com>
Date:   Wed Dec 1 14:34:11 2021 -0500

    Merge remote-tracking branch 'MajewskiKrzysztof/links-tail-uuid' into 18511-java-sdk-groups-links
    
    Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <peter.amstutz at curii.com>


commit 350a728ce9757d4db39d66ef4a5fe1cb304d1156
Merge: e163d0f19 2a7f6192e
Author: Peter Amstutz <peter.amstutz at curii.com>
Date:   Wed Dec 1 14:33:30 2021 -0500

    Merge remote-tracking branch 'MajewskiKrzysztof/group-update' into 18511-java-sdk-groups-links
    
    Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <peter.amstutz at curii.com>


commit 4a598dbcd3e910bf82c95406c919470d0c4a43ce
Author: majewsk6 <krzysztof.majewski.km1 at contractors.roche.com>
Date:   Wed Dec 1 08:19:12 2021 +0100

    Add tails_uuid and tail_kind to Links API
    
    Arvados-DCO-1.1-Signed-off-by: Krzysztof Majewski majewski.kielce at gmail.com

diff --git a/sdk/java-v2/src/main/java/org/arvados/client/api/model/Link.java b/sdk/java-v2/src/main/java/org/arvados/client/api/model/Link.java
index a24f02a01..1d1a20fc7 100644
--- a/sdk/java-v2/src/main/java/org/arvados/client/api/model/Link.java
+++ b/sdk/java-v2/src/main/java/org/arvados/client/api/model/Link.java
@@ -15,15 +15,19 @@ import com.fasterxml.jackson.annotation.JsonPropertyOrder;
 
 @JsonInclude(JsonInclude.Include.NON_NULL)
 @JsonIgnoreProperties(ignoreUnknown = true)
- at JsonPropertyOrder({ "name", "head_kind", "head_uuid", "link_class" })
+ at JsonPropertyOrder({"name", "head_kind", "head_uuid", "link_class"})
 public class Link extends Item {
 
     @JsonProperty("name")
     private String name;
-    @JsonProperty("head_kind")
+    @JsonProperty(value = "head_kind", access = JsonProperty.Access.WRITE_ONLY)
     private String headKind;
     @JsonProperty("head_uuid")
     private String headUuid;
+    @JsonProperty("tail_uuid")
+    private String tailUuid;
+    @JsonProperty(value = "tail_kind", access = JsonProperty.Access.WRITE_ONLY)
+    private String tailKind;
     @JsonProperty("link_class")
     private String linkClass;
 
@@ -39,6 +43,14 @@ public class Link extends Item {
         return headUuid;
     }
 
+    public String getTailUuid() {
+        return tailUuid;
+    }
+
+    public String getTailKind() {
+        return tailKind;
+    }
+
     public String getLinkClass() {
         return linkClass;
     }
@@ -55,6 +67,14 @@ public class Link extends Item {
         this.headUuid = headUuid;
     }
 
+    public void setTailUuid(String tailUuid) {
+        this.tailUuid = tailUuid;
+    }
+
+    public void setTailKind(String tailKind) {
+        this.tailKind = tailKind;
+    }
+
     public void setLinkClass(String linkClass) {
         this.linkClass = linkClass;
     }
diff --git a/sdk/java-v2/src/test/java/org/arvados/client/api/client/LinkApiClientTest.java b/sdk/java-v2/src/test/java/org/arvados/client/api/client/LinkApiClientTest.java
new file mode 100644
index 000000000..f051b5603
--- /dev/null
+++ b/sdk/java-v2/src/test/java/org/arvados/client/api/client/LinkApiClientTest.java
@@ -0,0 +1,97 @@
+/*
+ * Copyright (C) The Arvados Authors. All rights reserved.
+ *
+ * SPDX-License-Identifier: AGPL-3.0 OR Apache-2.0
+ *
+ */
+
+package org.arvados.client.api.client;
+
+import okhttp3.mockwebserver.RecordedRequest;
+import org.arvados.client.api.model.Link;
+import org.arvados.client.api.model.LinkList;
+import org.arvados.client.test.utils.ArvadosClientMockedWebServerTest;
+import org.arvados.client.test.utils.RequestMethod;
+import org.junit.Test;
+
+import static org.arvados.client.test.utils.ApiClientTestUtils.assertAuthorizationHeader;
+import static org.arvados.client.test.utils.ApiClientTestUtils.assertRequestMethod;
+import static org.arvados.client.test.utils.ApiClientTestUtils.assertRequestPath;
+import static org.arvados.client.test.utils.ApiClientTestUtils.getResponse;
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.junit.Assert.assertEquals;
+
+public class LinkApiClientTest extends ArvadosClientMockedWebServerTest {
+
+    private static final String RESOURCE = "links";
+
+    private final LinksApiClient client = new LinksApiClient(CONFIG);
+
+    @Test
+    public void listLinks() throws Exception {
+        // given
+        server.enqueue(getResponse("links-list"));
+
+        // when
+        LinkList actual = client.list();
+
+        // then
+        RecordedRequest request = server.takeRequest();
+        assertAuthorizationHeader(request);
+        assertRequestPath(request, RESOURCE);
+        assertRequestMethod(request, RequestMethod.GET);
+        assertThat(actual.getItemsAvailable()).isEqualTo(2);
+    }
+
+    @Test
+    public void getLink() throws Exception {
+        // given
+        server.enqueue(getResponse("links-get"));
+
+        String uuid = "arkau-o0j2j-huxuaxbi46s1yml";
+
+        // when
+        Link actual = client.get(uuid);
+
+        // then
+        RecordedRequest request = server.takeRequest();
+        assertAuthorizationHeader(request);
+        assertRequestPath(request, RESOURCE + "/" + uuid);
+        assertRequestMethod(request, RequestMethod.GET);
+        assertEquals(actual.getUuid(), uuid);
+        assertEquals(actual.getName(), "can_read");
+        assertEquals(actual.getHeadKind(), "arvados#group");
+        assertEquals(actual.getHeadUuid(), "arkau-j7d0g-fcedae2076pw56h");
+        assertEquals(actual.getTailUuid(), "ardev-tpzed-n3kzq4fvoks3uw4");
+        assertEquals(actual.getTailKind(), "arvados#user");
+        assertEquals(actual.getLinkClass(), "permission");
+    }
+
+    @Test
+    public void createLink() throws Exception {
+        // given
+        server.enqueue(getResponse("links-create"));
+
+        String name = "Star Link";
+
+        Link collection = new Link();
+        collection.setName(name);
+
+        // when
+        Link actual = client.create(collection);
+
+        // then
+        RecordedRequest request = server.takeRequest();
+        assertAuthorizationHeader(request);
+        assertRequestPath(request, RESOURCE);
+        assertRequestMethod(request, RequestMethod.POST);
+        assertThat(actual.getName()).isEqualTo(name);
+        assertEquals(actual.getName(), name);
+        assertEquals(actual.getUuid(), "arkau-o0j2j-huxuaxbi46s1yml");
+        assertEquals(actual.getHeadKind(), "arvados#group");
+        assertEquals(actual.getHeadUuid(), "arkau-j7d0g-fcedae2076pw56h");
+        assertEquals(actual.getTailUuid(), "ardev-tpzed-n3kzq4fvoks3uw4");
+        assertEquals(actual.getTailKind(), "arvados#user");
+        assertEquals(actual.getLinkClass(), "star");
+    }
+}
\ No newline at end of file
diff --git a/sdk/java-v2/src/test/resources/org/arvados/client/api/client/links-create.json b/sdk/java-v2/src/test/resources/org/arvados/client/api/client/links-create.json
new file mode 100644
index 000000000..0664d886f
--- /dev/null
+++ b/sdk/java-v2/src/test/resources/org/arvados/client/api/client/links-create.json
@@ -0,0 +1,18 @@
+{
+  "href": "/links/arkau-o0j2j-huxuaxbi46s1yml",
+  "kind": "arvados#link",
+  "etag": "zw1rlnbig0kpm9btw8us3pn9",
+  "uuid": "arkau-o0j2j-huxuaxbi46s1yml",
+  "owner_uuid": "arkau-tpzed-000000000000000",
+  "created_at": "2021-11-30T08:45:04.373354745Z",
+  "modified_by_client_uuid": null,
+  "modified_by_user_uuid": "ardev-tpzed-n3kzq4fvoks3uw4",
+  "modified_at": "2021-11-30T08:45:04.374489000Z",
+  "tail_uuid": "ardev-tpzed-n3kzq4fvoks3uw4",
+  "link_class": "star",
+  "name": "Star Link",
+  "head_uuid": "arkau-j7d0g-fcedae2076pw56h",
+  "head_kind": "arvados#group",
+  "tail_kind": "arvados#user",
+  "properties": {}
+}
\ No newline at end of file
diff --git a/sdk/java-v2/src/test/resources/org/arvados/client/api/client/links-get.json b/sdk/java-v2/src/test/resources/org/arvados/client/api/client/links-get.json
new file mode 100644
index 000000000..25f63bda6
--- /dev/null
+++ b/sdk/java-v2/src/test/resources/org/arvados/client/api/client/links-get.json
@@ -0,0 +1,18 @@
+{
+  "href": "/links/arkau-o0j2j-huxuaxbi46s1yml",
+  "kind": "arvados#link",
+  "etag": "zw1rlnbig0kpm9btw8us3pn9",
+  "uuid": "arkau-o0j2j-huxuaxbi46s1yml",
+  "owner_uuid": "arkau-tpzed-000000000000000",
+  "created_at": "2021-11-30T08:45:04.373354745Z",
+  "modified_by_client_uuid": null,
+  "modified_by_user_uuid": "ardev-tpzed-n3kzq4fvoks3uw4",
+  "modified_at": "2021-11-30T08:45:04.374489000Z",
+  "tail_uuid": "ardev-tpzed-n3kzq4fvoks3uw4",
+  "link_class": "permission",
+  "name": "can_read",
+  "head_uuid": "arkau-j7d0g-fcedae2076pw56h",
+  "head_kind": "arvados#group",
+  "tail_kind": "arvados#user",
+  "properties": {}
+}
\ No newline at end of file
diff --git a/sdk/java-v2/src/test/resources/org/arvados/client/api/client/links-list.json b/sdk/java-v2/src/test/resources/org/arvados/client/api/client/links-list.json
new file mode 100644
index 000000000..e720ecf49
--- /dev/null
+++ b/sdk/java-v2/src/test/resources/org/arvados/client/api/client/links-list.json
@@ -0,0 +1,46 @@
+{
+  "kind": "arvados#linkList",
+  "etag": "",
+  "self_link": "",
+  "offset": 0,
+  "limit": 100,
+  "items": [
+    {
+      "href": "/links/arkau-o0j2j-x2b4rdadxs2fizn",
+      "kind": "arvados#link",
+      "etag": "dkhtr9tvp9zfy0d90xjn7w1t7",
+      "uuid": "arkau-o0j2j-x2b4rdadxs2fizn",
+      "owner_uuid": "arkau-j7d0g-publicfavorites",
+      "created_at": "2021-10-27T12:00:06.607794000Z",
+      "modified_by_client_uuid": null,
+      "modified_by_user_uuid": "arlog-tpzed-fyiau9qwo7ytntu",
+      "modified_at": "2021-10-27T12:00:06.609840000Z",
+      "tail_uuid": "arkau-j7d0g-publicfavorites",
+      "link_class": "star",
+      "name": "pRED Data Commons Service - Open access",
+      "head_uuid": "arkau-j7d0g-sfhw8b1uson0hwh",
+      "head_kind": "arvados#group",
+      "tail_kind": "arvados#group",
+      "properties": {}
+    },
+    {
+      "href": "/links/arkau-o0j2j-r5am4lz9gnu488k",
+      "kind": "arvados#link",
+      "etag": "9nt0c2xn5oz1jzjzawlycmehz",
+      "uuid": "arkau-o0j2j-r5am4lz9gnu488k",
+      "owner_uuid": "arkau-j7d0g-publicfavorites",
+      "created_at": "2021-06-23T14:58:06.189520000Z",
+      "modified_by_client_uuid": null,
+      "modified_by_user_uuid": "arlog-tpzed-xzjyeljl6co7vlz",
+      "modified_at": "2021-06-23T14:58:06.196208000Z",
+      "tail_uuid": "arkau-j7d0g-publicfavorites",
+      "link_class": "star",
+      "name": "Open Targets Genetics",
+      "head_uuid": "arkau-j7d0g-pj5wysmpy5wn8yo",
+      "head_kind": "arvados#group",
+      "tail_kind": "arvados#group",
+      "properties": {}
+    }
+  ],
+  "items_available": 2
+}
\ No newline at end of file

commit 2a7f6192e2b619f8e9760b7b937e29bf33791aa3
Author: majewsk6 <krzysztof.majewski.km1 at contractors.roche.com>
Date:   Wed Dec 1 08:11:46 2021 +0100

    Group update caused exception
    
    Arvados-DCO-1.1-Signed-off-by: Krzysztof Majewski majewski.kielce at gmail.com

diff --git a/sdk/java-v2/src/main/java/org/arvados/client/api/model/Group.java b/sdk/java-v2/src/main/java/org/arvados/client/api/model/Group.java
index e9fbdb744..6482215b1 100644
--- a/sdk/java-v2/src/main/java/org/arvados/client/api/model/Group.java
+++ b/sdk/java-v2/src/main/java/org/arvados/client/api/model/Group.java
@@ -28,7 +28,7 @@ public class Group extends Item {
     private String groupClass;
     @JsonProperty("description")
     private String description;
-    @JsonProperty("writable_by")
+    @JsonProperty(value = "writable_by", access = JsonProperty.Access.WRITE_ONLY)
     private List<String> writableBy;
     @JsonProperty("delete_at")
     private LocalDateTime deleteAt;

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list