@@ -29,7 +29,7 @@ final class CommandCompleteUnitTests {
29
29
30
30
@ Test
31
31
void constructorNoCommand () {
32
- assertThatIllegalArgumentException ().isThrownBy (() -> new CommandComplete (null , 100 , 200 ))
32
+ assertThatIllegalArgumentException ().isThrownBy (() -> new CommandComplete (null , 100 , 200L ))
33
33
.withMessage ("command must not be null" );
34
34
}
35
35
@@ -42,7 +42,15 @@ void decodeCopy() {
42
42
43
43
return buffer ;
44
44
})
45
- .isEqualTo (new CommandComplete ("COPY" , null , 100 ));
45
+ .isEqualTo (new CommandComplete ("COPY" , null , 100L ));
46
+ assertThat (CommandComplete .class )
47
+ .decoded (buffer -> {
48
+ buffer .writeCharSequence ("COPY 4294967294" , UTF_8 );
49
+ buffer .writeByte (0 );
50
+
51
+ return buffer ;
52
+ })
53
+ .isEqualTo (new CommandComplete ("COPY" , null , 4294967294L ));
46
54
}
47
55
48
56
@ Test
@@ -54,7 +62,15 @@ void decodeDelete() {
54
62
55
63
return buffer ;
56
64
})
57
- .isEqualTo (new CommandComplete ("DELETE" , null , 100 ));
65
+ .isEqualTo (new CommandComplete ("DELETE" , null , 100L ));
66
+ assertThat (CommandComplete .class )
67
+ .decoded (buffer -> {
68
+ buffer .writeCharSequence ("DELETE 4294967294" , UTF_8 );
69
+ buffer .writeByte (0 );
70
+
71
+ return buffer ;
72
+ })
73
+ .isEqualTo (new CommandComplete ("DELETE" , null , 4294967294L ));
58
74
}
59
75
60
76
@ Test
@@ -66,7 +82,15 @@ void decodeFetch() {
66
82
67
83
return buffer ;
68
84
})
69
- .isEqualTo (new CommandComplete ("FETCH" , null , 100 ));
85
+ .isEqualTo (new CommandComplete ("FETCH" , null , 100L ));
86
+ assertThat (CommandComplete .class )
87
+ .decoded (buffer -> {
88
+ buffer .writeCharSequence ("FETCH 4294967294" , UTF_8 );
89
+ buffer .writeByte (0 );
90
+
91
+ return buffer ;
92
+ })
93
+ .isEqualTo (new CommandComplete ("FETCH" , null , 4294967294L ));
70
94
}
71
95
72
96
@ Test
@@ -78,7 +102,15 @@ void decodeInsert() {
78
102
79
103
return buffer ;
80
104
})
81
- .isEqualTo (new CommandComplete ("INSERT" , 100 , 200 ));
105
+ .isEqualTo (new CommandComplete ("INSERT" , 100 , 200L ));
106
+ assertThat (CommandComplete .class )
107
+ .decoded (buffer -> {
108
+ buffer .writeCharSequence ("INSERT 100 4294967294" , UTF_8 );
109
+ buffer .writeByte (0 );
110
+
111
+ return buffer ;
112
+ })
113
+ .isEqualTo (new CommandComplete ("INSERT" , 100 , 4294967294L ));
82
114
}
83
115
84
116
@ Test
@@ -90,7 +122,15 @@ void decodeMove() {
90
122
91
123
return buffer ;
92
124
})
93
- .isEqualTo (new CommandComplete ("MOVE" , null , 100 ));
125
+ .isEqualTo (new CommandComplete ("MOVE" , null , 100L ));
126
+ assertThat (CommandComplete .class )
127
+ .decoded (buffer -> {
128
+ buffer .writeCharSequence ("MOVE 4294967294" , UTF_8 );
129
+ buffer .writeByte (0 );
130
+
131
+ return buffer ;
132
+ })
133
+ .isEqualTo (new CommandComplete ("MOVE" , null , 4294967294L ));
94
134
}
95
135
96
136
@ Test
@@ -114,7 +154,15 @@ void decodeSelect() {
114
154
115
155
return buffer ;
116
156
})
117
- .isEqualTo (new CommandComplete ("SELECT" , null , 100 ));
157
+ .isEqualTo (new CommandComplete ("SELECT" , null , 100L ));
158
+ assertThat (CommandComplete .class )
159
+ .decoded (buffer -> {
160
+ buffer .writeCharSequence ("SELECT 4294967294" , UTF_8 );
161
+ buffer .writeByte (0 );
162
+
163
+ return buffer ;
164
+ })
165
+ .isEqualTo (new CommandComplete ("SELECT" , null , 4294967294L ));
118
166
assertThat (CommandComplete .class )
119
167
.decoded (buffer -> {
120
168
buffer .writeCharSequence ("SELECT" , UTF_8 );
@@ -134,7 +182,15 @@ void decodeUpdate() {
134
182
135
183
return buffer ;
136
184
})
137
- .isEqualTo (new CommandComplete ("UPDATE" , null , 100 ));
185
+ .isEqualTo (new CommandComplete ("UPDATE" , null , 100L ));
186
+ assertThat (CommandComplete .class )
187
+ .decoded (buffer -> {
188
+ buffer .writeCharSequence ("UPDATE 4294967294" , UTF_8 );
189
+ buffer .writeByte (0 );
190
+
191
+ return buffer ;
192
+ })
193
+ .isEqualTo (new CommandComplete ("UPDATE" , null , 4294967294L ));
138
194
}
139
195
140
196
}
0 commit comments