Skip to content

Commit 4dfe07f

Browse files
committed
add end call test
1 parent 2c43a15 commit 4dfe07f

File tree

3 files changed

+49
-26
lines changed

3 files changed

+49
-26
lines changed

src/main/java/io/getstream/models/Flag.java

Lines changed: 29 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
import com.fasterxml.jackson.annotation.JsonProperty;
1616
import java.util.Date;
17+
import java.util.List;
1718
import java.util.Map;
1819
import org.jetbrains.annotations.Nullable;
1920

@@ -26,51 +27,57 @@ public class Flag {
2627
@JsonProperty("created_at")
2728
private Date createdAt;
2829

29-
@JsonProperty("created_by_automod")
30-
private Boolean createdByAutomod;
30+
@JsonProperty("entity_id")
31+
private String entityID;
32+
33+
@JsonProperty("entity_type")
34+
private String entityType;
3135

3236
@JsonProperty("updated_at")
3337
private Date updatedAt;
3438

39+
@JsonProperty("result")
40+
private List<Map<String, Object>> result;
41+
3542
@Nullable
36-
@JsonProperty("approved_at")
37-
private Date approvedAt;
43+
@JsonProperty("entity_creator_id")
44+
private String entityCreatorID;
3845

3946
@Nullable
40-
@JsonProperty("reason")
41-
private String reason;
47+
@JsonProperty("is_streamed_content")
48+
private Boolean isStreamedContent;
49+
50+
@Nullable
51+
@JsonProperty("moderation_payload_hash")
52+
private String moderationPayloadHash;
4253

4354
@Nullable
44-
@JsonProperty("rejected_at")
45-
private Date rejectedAt;
55+
@JsonProperty("reason")
56+
private String reason;
4657

4758
@Nullable
48-
@JsonProperty("reviewed_at")
49-
private Date reviewedAt;
59+
@JsonProperty("review_queue_item_id")
60+
private String reviewQueueItemID;
5061

5162
@Nullable
52-
@JsonProperty("reviewed_by")
53-
private String reviewedBy;
63+
@JsonProperty("type")
64+
private String type;
5465

5566
@Nullable
56-
@JsonProperty("target_message_id")
57-
private String targetMessageID;
67+
@JsonProperty("labels")
68+
private List<String> labels;
5869

5970
@Nullable
6071
@JsonProperty("custom")
6172
private Map<String, Object> custom;
6273

6374
@Nullable
64-
@JsonProperty("details")
65-
private FlagDetails details;
66-
67-
@Nullable
68-
@JsonProperty("target_message")
69-
private Message targetMessage;
75+
@JsonProperty("moderation_payload")
76+
private ModerationPayload moderationPayload;
7077

7178
@Nullable
72-
@JsonProperty("target_user")
73-
private User targetUser;
79+
@JsonProperty("review_queue_item")
80+
private ReviewQueueItem reviewQueueItem;
7481

7582
@Nullable
7683
@JsonProperty("user")

src/main/java/io/getstream/services/framework/StreamHTTPClient.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
import com.fasterxml.jackson.databind.DeserializationFeature;
44
import com.fasterxml.jackson.databind.ObjectMapper;
5+
import com.fasterxml.jackson.databind.SerializationFeature;
56
import com.fasterxml.jackson.databind.util.StdDateFormat;
6-
import io.getstream.services.*;
77
import io.jsonwebtoken.Jwts;
88
import io.jsonwebtoken.SignatureAlgorithm;
99
import java.io.IOException;
@@ -36,7 +36,8 @@ public class StreamHTTPClient {
3636
new StdDateFormat()
3737
.withColonInTimeZone(true)
3838
.withTimeZone(TimeZone.getTimeZone("UTC")))
39-
.enable(DeserializationFeature.READ_UNKNOWN_ENUM_VALUES_USING_DEFAULT_VALUE);
39+
.enable(DeserializationFeature.READ_UNKNOWN_ENUM_VALUES_USING_DEFAULT_VALUE)
40+
.disable(SerializationFeature.FAIL_ON_EMPTY_BEANS);
4041

4142
@NotNull private String apiSecret;
4243
@NotNull private String apiKey;

src/test/java/io/getstream/CallTest.java

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,13 @@
66
import java.util.List;
77
import java.util.Map;
88
import org.apache.commons.lang3.RandomStringUtils;
9-
import org.junit.jupiter.api.*;
9+
import org.junit.jupiter.api.Assertions;
10+
import org.junit.jupiter.api.Disabled;
11+
import org.junit.jupiter.api.Test;
1012

1113
public class CallTest extends BasicTest {
12-
String callType = "default";
1314
private static String callTypeName;
15+
String callType = "default";
1416

1517
@Test
1618
@Disabled
@@ -302,4 +304,17 @@ void testGenerateSRTToken() {
302304
Assertions.assertNotNull(srtToken);
303305
Assertions.assertNotEquals("", srtToken);
304306
}
307+
308+
@Test
309+
void testEndCall() {
310+
String callID = "call-" + RandomStringUtils.randomAlphanumeric(10);
311+
Call testCall = video.call(callType, callID);
312+
Assertions.assertDoesNotThrow(
313+
() ->
314+
testCall.getOrCreate(
315+
GetOrCreateCallRequest.builder()
316+
.data(CallRequest.builder().createdByID(testUser.getId()).build())
317+
.build()));
318+
Assertions.assertDoesNotThrow(() -> testCall.end());
319+
}
305320
}

0 commit comments

Comments
 (0)