Skip to content

Commit

Permalink
fix: javadoc (#164)
Browse files Browse the repository at this point in the history
* fix: javadoc

* feat: run javadoc on pr

* fix: remove prints

* feat: add querying for archived channels in tests
  • Loading branch information
shaljam authored Dec 13, 2024
1 parent 38c7348 commit 69f4266
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 6 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,5 @@ jobs:
STREAM_SECRET: ${{ secrets.STREAM_SECRET }}
run: |
./gradlew spotlessCheck --no-daemon
./gradlew javadoc --no-daemon
./gradlew jacocoTestReport --no-daemon
1 change: 1 addition & 0 deletions src/main/java/io/getstream/chat/java/models/Flag.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
17 changes: 14 additions & 3 deletions src/main/java/io/getstream/chat/java/models/Moderation.java
Original file line number Diff line number Diff line change
Expand Up @@ -190,22 +190,33 @@ protected Call<ConfigGetResponse> 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
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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ protected Call<UnreadCountsBatchResponse> generateCall(Client client) {
/**
* Creates a get request.
*
* @param userId the user id
* @return the created request
*/
@NotNull
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ public void requestAsync(
* Use custom client implementation to execute requests
*
* @param client the client implementation
* @return the request
*/
public StreamRequest<T> withClient(Client client) {
this.client = client;
Expand Down
14 changes: 11 additions & 3 deletions src/test/java/io/getstream/chat/java/ChannelTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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 =
Expand All @@ -519,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(
() ->
Expand Down

0 comments on commit 69f4266

Please sign in to comment.