From 351b880f4c44ed2195331d49d99fda0f926e2deb Mon Sep 17 00:00:00 2001 From: Ali Momen Sani Date: Fri, 13 Dec 2024 12:01:25 +0100 Subject: [PATCH 1/4] fix: javadoc --- .../io/getstream/chat/java/models/Flag.java | 1 + .../getstream/chat/java/models/Moderation.java | 17 ++++++++++++++--- .../chat/java/models/UnreadCounts.java | 1 + .../java/models/framework/StreamRequest.java | 1 + 4 files changed, 17 insertions(+), 3 deletions(-) diff --git a/src/main/java/io/getstream/chat/java/models/Flag.java b/src/main/java/io/getstream/chat/java/models/Flag.java index 7abfbab6..14b9cf5b 100644 --- a/src/main/java/io/getstream/chat/java/models/Flag.java +++ b/src/main/java/io/getstream/chat/java/models/Flag.java @@ -452,6 +452,7 @@ public static QueryFlagReportsRequest queryFlagReports() { /** * Creates a review flag report request * + * @param id the flag report id * @return the created request */ @NotNull diff --git a/src/main/java/io/getstream/chat/java/models/Moderation.java b/src/main/java/io/getstream/chat/java/models/Moderation.java index 0fe6859f..5f0b224c 100644 --- a/src/main/java/io/getstream/chat/java/models/Moderation.java +++ b/src/main/java/io/getstream/chat/java/models/Moderation.java @@ -190,10 +190,9 @@ protected Call generateCall(Client client) { } /** - * Creates a get or create request + * Creates an upsert config request * - * @param type the channel type - * @param id the channel id + * @param key the moderation config key * @return the created request */ @NotNull @@ -201,11 +200,23 @@ public static UpsertConfigRequest upsertConfig(@NotNull String key) { return new UpsertConfigRequest(key); } + /** + * Creates a delete config request + * + * @param key the moderation config key + * @return the created request + */ @NotNull public static DeleteConfigRequest deleteConfig(@NotNull String key) { return new DeleteConfigRequest(key); } + /* + * Creates a get config request + * + * @param key the moderation config key + * @return the created request + */ @NotNull public static ConfigGetRequest getConfig(@NotNull String key) { return new ConfigGetRequest(key); diff --git a/src/main/java/io/getstream/chat/java/models/UnreadCounts.java b/src/main/java/io/getstream/chat/java/models/UnreadCounts.java index 4bfcb02f..a3c529b8 100644 --- a/src/main/java/io/getstream/chat/java/models/UnreadCounts.java +++ b/src/main/java/io/getstream/chat/java/models/UnreadCounts.java @@ -145,6 +145,7 @@ protected Call generateCall(Client client) { /** * Creates a get request. * + * @param userId the user id * @return the created request */ @NotNull diff --git a/src/main/java/io/getstream/chat/java/models/framework/StreamRequest.java b/src/main/java/io/getstream/chat/java/models/framework/StreamRequest.java index b27b94d2..da14fe94 100644 --- a/src/main/java/io/getstream/chat/java/models/framework/StreamRequest.java +++ b/src/main/java/io/getstream/chat/java/models/framework/StreamRequest.java @@ -46,6 +46,7 @@ public void requestAsync( * Use custom client implementation to execute requests * * @param client the client implementation + * @return the request */ public StreamRequest withClient(Client client) { this.client = client; From 615e17e1dfd48b5f2a8f1a800fbb9a11c913a643 Mon Sep 17 00:00:00 2001 From: Ali Momen Sani Date: Fri, 13 Dec 2024 12:11:48 +0100 Subject: [PATCH 2/4] feat: run javadoc on pr --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 86ec2f79..556177fc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,4 +25,5 @@ jobs: STREAM_SECRET: ${{ secrets.STREAM_SECRET }} run: | ./gradlew spotlessCheck --no-daemon + ./gradlew javadoc --no-daemon ./gradlew jacocoTestReport --no-daemon From 87b86c3ccf4fb0be256f82188c5f83f5385e8d4d Mon Sep 17 00:00:00 2001 From: Ali Momen Sani Date: Fri, 13 Dec 2024 14:28:13 +0100 Subject: [PATCH 3/4] fix: remove prints --- src/test/java/io/getstream/chat/java/ChannelTest.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/test/java/io/getstream/chat/java/ChannelTest.java b/src/test/java/io/getstream/chat/java/ChannelTest.java index 17d45b5c..77cb4d07 100644 --- a/src/test/java/io/getstream/chat/java/ChannelTest.java +++ b/src/test/java/io/getstream/chat/java/ChannelTest.java @@ -446,7 +446,6 @@ void whenUpdatingChannelMemberPartially_thenIsUpdated() { .setValue("channel_role", "channel_moderator") .request()); - System.out.println(channelMemberResponse.getMember()); Assertions.assertEquals( "custom_value", channelMemberResponse.getMember().getAdditionalFields().get("custom_key")); Assertions.assertEquals( @@ -494,8 +493,6 @@ void whenPinningAndUnpinningAChannelUsingUnset_thenIsPinnedAndUnpinned() { () -> Channel.pin(channel.getType(), channel.getId(), testUserRequestObject.getId()) .request()); - System.out.println(channelMemberResponse.getMember()); - System.out.println(channelMemberResponse.getMember().getPinnedAt()); Assertions.assertNotNull(channelMemberResponse.getMember().getPinnedAt()); channelMemberResponse = From 70d36dedb6b8a0c9b7abd505a9774074e4a4b9ec Mon Sep 17 00:00:00 2001 From: Ali Momen Sani Date: Fri, 13 Dec 2024 14:59:01 +0100 Subject: [PATCH 4/4] feat: add querying for archived channels in tests --- src/test/java/io/getstream/chat/java/ChannelTest.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/test/java/io/getstream/chat/java/ChannelTest.java b/src/test/java/io/getstream/chat/java/ChannelTest.java index 77cb4d07..eefc8163 100644 --- a/src/test/java/io/getstream/chat/java/ChannelTest.java +++ b/src/test/java/io/getstream/chat/java/ChannelTest.java @@ -516,6 +516,17 @@ void whenArchivingChannel_thenIsArchived() { .request()); Assertions.assertNotNull(channelMemberResponse.getMember().getArchivedAt()); + ChannelListResponse channelListResponse = + Assertions.assertDoesNotThrow( + () -> + Channel.list() + .userId(testUserRequestObject.getId()) + .filterCondition("archived", true) + .request()); + Assertions.assertEquals(1, channelListResponse.getChannels().size()); + Assertions.assertEquals( + channel.getId(), channelListResponse.getChannels().get(0).getChannel().getId()); + channelMemberResponse = Assertions.assertDoesNotThrow( () ->