Skip to content

Commit 70363fc

Browse files
committed
style: fix code formatting
1 parent fc3a49c commit 70363fc

9 files changed

Lines changed: 271 additions & 401 deletions

src/test/java/io/getstream/ChatChannelIntegrationTest.java

Lines changed: 60 additions & 147 deletions
Large diffs are not rendered by default.

src/test/java/io/getstream/ChatMessageIntegrationTest.java

Lines changed: 101 additions & 84 deletions
Large diffs are not rendered by default.

src/test/java/io/getstream/ChatMiscIntegrationTest.java

Lines changed: 25 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,7 @@ void testCreateUpdateDeleteChannelType() throws Exception {
7676
client
7777
.chat()
7878
.updateChannelType(
79-
typeName,
80-
UpdateChannelTypeRequest.builder().typingEvents(false).build())
79+
typeName, UpdateChannelTypeRequest.builder().typingEvents(false).build())
8180
.execute();
8281
assertNotNull(updateResp.getData());
8382
assertEquals(Boolean.FALSE, updateResp.getData().getTypingEvents());
@@ -103,7 +102,8 @@ void testCreateUpdateDeleteChannelType() throws Exception {
103102
}
104103
}
105104
if (deleteErr != null) {
106-
System.err.println("Warning: failed to delete channel type " + typeName + ": " + deleteErr.getMessage());
105+
System.err.println(
106+
"Warning: failed to delete channel type " + typeName + ": " + deleteErr.getMessage());
107107
}
108108
}
109109
}
@@ -113,7 +113,8 @@ void testCreateUpdateDeleteChannelType() throws Exception {
113113
void testListChannelTypes() throws Exception {
114114
var listResp = client.chat().listChannelTypes().execute();
115115
assertNotNull(listResp.getData().getChannelTypes());
116-
assertTrue(listResp.getData().getChannelTypes().size() > 0, "Should have at least one channel type");
116+
assertTrue(
117+
listResp.getData().getChannelTypes().size() > 0, "Should have at least one channel type");
117118
// Default channel types should be present
118119
assertTrue(
119120
listResp.getData().getChannelTypes().containsKey("messaging"),
@@ -262,9 +263,7 @@ void testCreateListDeleteDevice() throws Exception {
262263

263264
// List devices and verify found
264265
var listResp =
265-
client
266-
.listDevices(ListDevicesRequest.builder().UserID(userId).build())
267-
.execute();
266+
client.listDevices(ListDevicesRequest.builder().UserID(userId).build()).execute();
268267

269268
assertNotNull(listResp.getData().getDevices());
270269
boolean found = false;
@@ -284,9 +283,7 @@ void testCreateListDeleteDevice() throws Exception {
284283

285284
// Verify deleted
286285
var listAfterDelete =
287-
client
288-
.listDevices(ListDevicesRequest.builder().UserID(userId).build())
289-
.execute();
286+
client.listDevices(ListDevicesRequest.builder().UserID(userId).build()).execute();
290287

291288
if (listAfterDelete.getData().getDevices() != null) {
292289
for (DeviceResponse d : listAfterDelete.getData().getDevices()) {
@@ -322,8 +319,10 @@ void testGetPermission() throws Exception {
322319
var resp = client.getPermission("create-channel").execute();
323320
assertNotNull(resp.getData(), "Response data should not be null");
324321
assertNotNull(resp.getData().getPermission(), "Permission should not be null");
325-
assertEquals("create-channel", resp.getData().getPermission().getId(), "Permission ID should match");
326-
assertNotNull(resp.getData().getPermission().getAction(), "Permission action should not be null");
322+
assertEquals(
323+
"create-channel", resp.getData().getPermission().getId(), "Permission ID should match");
324+
assertNotNull(
325+
resp.getData().getPermission().getAction(), "Permission action should not be null");
327326
assertFalse(
328327
resp.getData().getPermission().getAction().isEmpty(),
329328
"Permission action should not be empty");
@@ -431,11 +430,7 @@ void testExportChannels() throws Exception {
431430
.exportChannels(
432431
ExportChannelsRequest.builder()
433432
.channels(
434-
List.of(
435-
ChannelExport.builder()
436-
.type("messaging")
437-
.id(channelId)
438-
.build()))
433+
List.of(ChannelExport.builder().type("messaging").id(channelId).build()))
439434
.build())
440435
.execute();
441436

@@ -481,11 +476,7 @@ void testMuteUnmuteUser() throws Exception {
481476
// Mute target user as muter
482477
var muteResp =
483478
moderation
484-
.mute(
485-
MuteRequest.builder()
486-
.targetIds(List.of(targetId))
487-
.userID(muterId)
488-
.build())
479+
.mute(MuteRequest.builder().targetIds(List.of(targetId)).userID(muterId).build())
489480
.execute();
490481

491482
assertNotNull(muteResp.getData(), "Mute response data should not be null");
@@ -502,11 +493,7 @@ void testMuteUnmuteUser() throws Exception {
502493
// Unmute the target user
503494
var unmuteResp =
504495
moderation
505-
.unmute(
506-
UnmuteRequest.builder()
507-
.targetIds(List.of(targetId))
508-
.userID(muterId)
509-
.build())
496+
.unmute(UnmuteRequest.builder().targetIds(List.of(targetId)).userID(muterId).build())
510497
.execute();
511498

512499
assertNotNull(unmuteResp.getData(), "Unmute response data should not be null");
@@ -555,9 +542,7 @@ void testThreads() throws Exception {
555542
.queryThreads(
556543
QueryThreadsRequest.builder()
557544
.userID(userId1)
558-
.filter(
559-
Map.of(
560-
"channel_cid", Map.of("$eq", channelCid)))
545+
.filter(Map.of("channel_cid", Map.of("$eq", channelCid)))
561546
.build())
562547
.execute();
563548

@@ -579,9 +564,7 @@ void testThreads() throws Exception {
579564
var getResp =
580565
client
581566
.chat()
582-
.getThread(
583-
parentId,
584-
GetThreadRequest.builder().ReplyLimit(10).build())
567+
.getThread(parentId, GetThreadRequest.builder().ReplyLimit(10).build())
585568
.execute();
586569

587570
assertNotNull(getResp.getData(), "GetThread response should not be null");
@@ -591,8 +574,7 @@ void testThreads() throws Exception {
591574
getResp.getData().getThread().getParentMessageID(),
592575
"Thread parent message ID should match");
593576
assertNotNull(
594-
getResp.getData().getThread().getLatestReplies(),
595-
"Latest replies should not be null");
577+
getResp.getData().getThread().getLatestReplies(), "Latest replies should not be null");
596578
assertTrue(
597579
getResp.getData().getThread().getLatestReplies().size() >= 2,
598580
"Thread should have at least 2 replies");
@@ -632,9 +614,7 @@ void testGetUnreadCountsBatch() throws Exception {
632614
client
633615
.chat()
634616
.unreadCountsBatch(
635-
UnreadCountsBatchRequest.builder()
636-
.userIds(List.of(readerId1))
637-
.build())
617+
UnreadCountsBatchRequest.builder().userIds(List.of(readerId1)).build())
638618
.execute();
639619

640620
assertNotNull(resp.getData(), "Batch unread counts response should not be null");
@@ -647,8 +627,7 @@ void testGetUnreadCountsBatch() throws Exception {
647627
assertNotNull(counts, "Counts for readerId1 should not be null");
648628
assertNotNull(counts.getTotalUnreadCount(), "Total unread count should not be null");
649629
assertTrue(
650-
counts.getTotalUnreadCount() >= 1,
651-
"readerId1 should have at least 1 unread message");
630+
counts.getTotalUnreadCount() >= 1, "readerId1 should have at least 1 unread message");
652631

653632
} finally {
654633
try {
@@ -773,9 +752,7 @@ void testReminders() throws Exception {
773752
var deleteResp =
774753
client
775754
.chat()
776-
.deleteReminder(
777-
messageId,
778-
DeleteReminderRequest.builder().UserID(userId).build())
755+
.deleteReminder(messageId, DeleteReminderRequest.builder().UserID(userId).build())
779756
.execute();
780757

781758
assertNotNull(deleteResp.getData(), "DeleteReminder response should not be null");
@@ -818,8 +795,7 @@ void testGetUnreadCounts() throws Exception {
818795
.execute();
819796

820797
assertNotNull(resp.getData(), "Unread counts response should not be null");
821-
assertNotNull(
822-
resp.getData().getTotalUnreadCount(), "Total unread count should not be null");
798+
assertNotNull(resp.getData().getTotalUnreadCount(), "Total unread count should not be null");
823799
assertTrue(
824800
resp.getData().getTotalUnreadCount() >= 1,
825801
"Reader should have at least 1 unread message");
@@ -866,8 +842,7 @@ void testQueryTeamUsageStats() throws Exception {
866842
|| msg.contains("not available")
867843
|| msg.contains("not supported")
868844
|| msg.contains("not enabled")) {
869-
Assumptions.assumeTrue(
870-
false, "QueryTeamUsageStats not available on this app: " + msg);
845+
Assumptions.assumeTrue(false, "QueryTeamUsageStats not available on this app: " + msg);
871846
}
872847
throw e;
873848
}
@@ -901,8 +876,7 @@ void testChannelBatchUpdate() throws Exception {
901876
{
902877
put(
903878
"$in",
904-
List.of(
905-
"messaging:" + channelId1, "messaging:" + channelId2));
879+
List.of("messaging:" + channelId1, "messaging:" + channelId2));
906880
}
907881
});
908882
}
@@ -933,8 +907,7 @@ void testChannelBatchUpdate() throws Exception {
933907

934908
} catch (io.getstream.exceptions.StreamException e) {
935909
String msg = e.getMessage() != null ? e.getMessage() : "";
936-
Integer statusCode =
937-
e.getResponseData() != null ? e.getResponseData().getStatusCode() : null;
910+
Integer statusCode = e.getResponseData() != null ? e.getResponseData().getStatusCode() : null;
938911
// ChannelBatchUpdate is behind Beta — skip gracefully on any server-side error.
939912
// The API may return "ChannelBatchUpdate failed with error: <empty>" when the
940913
// beta feature is not enabled for this app.
@@ -957,9 +930,7 @@ void testChannelBatchUpdate() throws Exception {
957930
client
958931
.chat()
959932
.deleteChannel(
960-
"messaging",
961-
channelId,
962-
DeleteChannelRequest.builder().HardDelete(true).build())
933+
"messaging", channelId, DeleteChannelRequest.builder().HardDelete(true).build())
963934
.execute();
964935
} catch (Exception ignored) {
965936
}

src/test/java/io/getstream/ChatPollsIntegrationTest.java

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,7 @@ void cleanup() {
3535
for (String channelId : createdChannelIds) {
3636
try {
3737
chat.deleteChannel(
38-
"messaging",
39-
channelId,
40-
DeleteChannelRequest.builder().HardDelete(true).build())
38+
"messaging", channelId, DeleteChannelRequest.builder().HardDelete(true).build())
4139
.execute();
4240
} catch (Exception ignored) {
4341
}
@@ -89,10 +87,7 @@ void testCreateAndQueryPoll() throws Exception {
8987
var queryResp =
9088
client
9189
.queryPolls(
92-
QueryPollsRequest.builder()
93-
.UserID(userId)
94-
.filter(Map.of("id", pollId))
95-
.build())
90+
QueryPollsRequest.builder().UserID(userId).filter(Map.of("id", pollId)).build())
9691
.execute();
9792

9893
assertNotNull(queryResp.getData().getPolls());
@@ -145,8 +140,7 @@ void testCastPollVote() throws Exception {
145140
createdPollIds.add(pollId);
146141

147142
// Create a channel with both users as members
148-
String channelId =
149-
createTestChannelWithMembers(creatorId, Arrays.asList(creatorId, voterId));
143+
String channelId = createTestChannelWithMembers(creatorId, Arrays.asList(creatorId, voterId));
150144
createdChannelIds.add(channelId);
151145

152146
// Send a message with the poll attached

src/test/java/io/getstream/ChatReactionIntegrationTest.java

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
import io.getstream.models.*;
66
import java.util.*;
77
import org.junit.jupiter.api.AfterAll;
8+
import org.junit.jupiter.api.MethodOrderer;
89
import org.junit.jupiter.api.Order;
910
import org.junit.jupiter.api.Test;
1011
import org.junit.jupiter.api.TestInstance;
1112
import org.junit.jupiter.api.TestMethodOrder;
12-
import org.junit.jupiter.api.MethodOrderer;
1313

1414
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
1515
@TestMethodOrder(MethodOrderer.OrderAnnotation.class)
@@ -23,9 +23,7 @@ void cleanup() {
2323
for (String channelId : createdChannelIds) {
2424
try {
2525
chat.deleteChannel(
26-
"messaging",
27-
channelId,
28-
DeleteChannelRequest.builder().HardDelete(true).build())
26+
"messaging", channelId, DeleteChannelRequest.builder().HardDelete(true).build())
2927
.execute();
3028
} catch (Exception ignored) {
3129
}
@@ -96,10 +94,7 @@ void testDeleteReaction() throws Exception {
9694
.execute();
9795

9896
// Delete the reaction
99-
chat.deleteReaction(
100-
messageId,
101-
"like",
102-
DeleteReactionRequest.builder().UserID(userId).build())
97+
chat.deleteReaction(messageId, "like", DeleteReactionRequest.builder().UserID(userId).build())
10398
.execute();
10499

105100
// Verify reaction is gone
@@ -146,8 +141,7 @@ void testEnforceUniqueReaction() throws Exception {
146141
// Verify user has exactly 1 reaction
147142
var getResp = chat.getReactions(messageId).execute();
148143
List<ReactionResponse> reactions = getResp.getData().getReactions();
149-
long userReactionCount =
150-
reactions.stream().filter(r -> userId.equals(r.getUserID())).count();
144+
long userReactionCount = reactions.stream().filter(r -> userId.equals(r.getUserID())).count();
151145
assertEquals(1, userReactionCount, "EnforceUnique should keep only one reaction per user");
152146
}
153147
}

src/test/java/io/getstream/ChatTestBase.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ protected String createTestChannel(String creatorId) throws Exception {
5151
}
5252

5353
/**
54-
* Creates a messaging channel with the given creator and members. Returns the channel ID.
55-
* Callers should hard-delete the channel in @AfterAll cleanup.
54+
* Creates a messaging channel with the given creator and members. Returns the channel ID. Callers
55+
* should hard-delete the channel in @AfterAll cleanup.
5656
*/
5757
protected String createTestChannelWithMembers(String creatorId, List<String> memberIds)
5858
throws Exception {
@@ -75,8 +75,8 @@ protected String createTestChannelWithMembers(String creatorId, List<String> mem
7575
* Sends a message to the specified channel as the given user. Returns the message ID. Asserts
7676
* that the message ID is non-null.
7777
*/
78-
protected String sendTestMessage(
79-
String channelType, String channelId, String userId, String text) throws Exception {
78+
protected String sendTestMessage(String channelType, String channelId, String userId, String text)
79+
throws Exception {
8080
var resp =
8181
chat.sendMessage(
8282
channelType,

0 commit comments

Comments
 (0)