@@ -66,15 +66,14 @@ public void fromCrtPutObjectOutputAllFields_shouldConvert() throws IllegalAccess
66
66
PutObjectResponse sdkResponse = S3CrtPojoConversion .fromCrtPutObjectOutput (crtResponse , sdkHttpResponse );
67
67
68
68
// ignoring fields with different casings and enum fields.
69
- assertThat (sdkResponse ).isEqualToIgnoringGivenFields (crtResponse ,
70
- "sseCustomerAlgorithm" ,
71
- "sseCustomerKeyMD5" ,
72
- "ssekmsKeyId" ,
73
- "ssekmsEncryptionContext" ,
74
- "serverSideEncryption" ,
75
- "requestCharged" ,
76
- "responseMetadata" ,
77
- "sdkHttpResponse" );
69
+ assertThat (sdkResponse ).usingRecursiveComparison ().ignoringFields ( "sseCustomerAlgorithm" ,
70
+ "sseCustomerKeyMD5" ,
71
+ "ssekmsKeyId" ,
72
+ "ssekmsEncryptionContext" ,
73
+ "serverSideEncryption" ,
74
+ "requestCharged" ,
75
+ "responseMetadata" ,
76
+ "sdkHttpResponse" ).isEqualTo (crtResponse );
78
77
assertThat (sdkResponse .serverSideEncryption ().name ()).isEqualTo (crtResponse .serverSideEncryption ().name ());
79
78
assertThat (sdkResponse .sseCustomerAlgorithm ()).isEqualTo (crtResponse .sSECustomerAlgorithm ());
80
79
assertThat (sdkResponse .ssekmsKeyId ()).isEqualTo (crtResponse .sSEKMSKeyId ());
@@ -120,11 +119,11 @@ public void fromCrtGetObjectOutput_shouldAddSdkHttpResponse() {
120
119
121
120
122
121
GetObjectResponse getObjectResponse = S3CrtPojoConversion .fromCrtGetObjectOutput (output , response );
123
- assertThat (output ).isEqualToIgnoringGivenFields ( getObjectResponse , "body" ,
124
- "sSECustomerAlgorithm" ,
125
- "sSECustomerKeyMD5" ,
126
- "sSEKMSKeyId" ,
127
- "metadata" );
122
+ assertThat (output ).usingRecursiveComparison (). ignoringFields ( "body" ,
123
+ "sSECustomerAlgorithm" ,
124
+ "sSECustomerKeyMD5" ,
125
+ "sSEKMSKeyId" ,
126
+ "metadata" ). isEqualTo ( getObjectResponse );
128
127
129
128
assertThat (getObjectResponse .sdkHttpResponse ()).isEqualTo (response );
130
129
assertThat (getObjectResponse .responseMetadata ().requestId ()).isEqualTo (expectedRequestId );
@@ -137,20 +136,19 @@ public void fromCrtGetObjectOutputAllFields_shouldConvert() throws IllegalAccess
137
136
GetObjectResponse sdkResponse = S3CrtPojoConversion .fromCrtGetObjectOutput (crtResponse , SdkHttpResponse .builder ().build ());
138
137
139
138
// ignoring fields with different casings and enum fields.
140
- assertThat (sdkResponse ).isEqualToIgnoringGivenFields (crtResponse ,
141
- "sseCustomerAlgorithm" ,
142
- "body" ,
143
- "sseCustomerKeyMD5" ,
144
- "ssekmsKeyId" ,
145
- "ssekmsEncryptionContext" ,
146
- "serverSideEncryption" ,
147
- "responseMetadata" ,
148
- "sdkHttpResponse" ,
149
- "storageClass" ,
150
- "requestCharged" ,
151
- "replicationStatus" ,
152
- "objectLockMode" ,
153
- "objectLockLegalHoldStatus" );
139
+ assertThat (sdkResponse ).usingRecursiveComparison ().ignoringFields ("sseCustomerAlgorithm" ,
140
+ "body" ,
141
+ "sseCustomerKeyMD5" ,
142
+ "ssekmsKeyId" ,
143
+ "ssekmsEncryptionContext" ,
144
+ "serverSideEncryption" ,
145
+ "responseMetadata" ,
146
+ "sdkHttpResponse" ,
147
+ "storageClass" ,
148
+ "requestCharged" ,
149
+ "replicationStatus" ,
150
+ "objectLockMode" ,
151
+ "objectLockLegalHoldStatus" ).isEqualTo (crtResponse );
154
152
assertThat (sdkResponse .serverSideEncryption ().name ()).isEqualTo (crtResponse .serverSideEncryption ().name ());
155
153
assertThat (sdkResponse .sseCustomerAlgorithm ()).isEqualTo (crtResponse .sSECustomerAlgorithm ());
156
154
assertThat (sdkResponse .ssekmsKeyId ()).isEqualTo (crtResponse .sSEKMSKeyId ());
@@ -182,16 +180,15 @@ public void toCrtPutObjectRequestAllFields_shouldConvert() {
182
180
com .amazonaws .s3 .model .PutObjectRequest crtRequest = S3CrtPojoConversion .toCrtPutObjectRequest (sdkRequest );
183
181
184
182
// ignoring fields with different casings and enum fields.
185
- assertThat (crtRequest ).isEqualToIgnoringGivenFields (sdkRequest ,
186
- "aCL" , "body" , "sSECustomerAlgorithm" ,
187
- "sSECustomerKey" , "sSECustomerKeyMD5" ,
188
- "sSEKMSKeyId" , "sSEKMSEncryptionContext" ,
189
- "customHeaders" , "customQueryParameters" ,
190
- "serverSideEncryption" ,
191
- "storageClass" ,
192
- "requestPayer" ,
193
- "objectLockMode" ,
194
- "objectLockLegalHoldStatus" );
183
+ assertThat (crtRequest ).usingRecursiveComparison ().ignoringFields ("aCL" , "body" , "sSECustomerAlgorithm" ,
184
+ "sSECustomerKey" , "sSECustomerKeyMD5" ,
185
+ "sSEKMSKeyId" , "sSEKMSEncryptionContext" ,
186
+ "customHeaders" , "customQueryParameters" ,
187
+ "serverSideEncryption" ,
188
+ "storageClass" ,
189
+ "requestPayer" ,
190
+ "objectLockMode" ,
191
+ "objectLockLegalHoldStatus" ).isEqualTo (sdkRequest );
195
192
assertThat (crtRequest .aCL ().name ()).isEqualTo (sdkRequest .acl ().name ());
196
193
assertThat (crtRequest .serverSideEncryption ().name ()).isEqualTo (sdkRequest .serverSideEncryption ().name ());
197
194
assertThat (crtRequest .storageClass ().name ()).isEqualTo (sdkRequest .storageClass ().name ());
@@ -219,7 +216,7 @@ public void toCrtPutObjectRequest_withCustomHeaders_shouldAttach() {
219
216
com .amazonaws .s3 .model .PutObjectRequest crtRequest = S3CrtPojoConversion .toCrtPutObjectRequest (sdkRequest );
220
217
HttpHeader [] headers = crtRequest .customHeaders ();
221
218
verifyHeaders (headers );
222
- assertThat (crtRequest .customQueryParameters ()).isEqualTo ("? hello1=world1&hello2=world2" );
219
+ assertThat (crtRequest .customQueryParameters ()).isEqualTo ("hello1=world1&hello2=world2" );
223
220
}
224
221
225
222
@ Test
@@ -240,10 +237,10 @@ public void toCrtGetObjectRequestAllFields_shouldConvert() {
240
237
com .amazonaws .s3 .model .GetObjectRequest crtRequest = S3CrtPojoConversion .toCrtGetObjectRequest (sdkRequest );
241
238
242
239
// ignoring fields with different casings and enum fields.
243
- assertThat (crtRequest ).isEqualToIgnoringGivenFields ( sdkRequest , "body" , "sSECustomerAlgorithm" ,
244
- "sSECustomerKey" , "sSECustomerKeyMD5" ,
245
- "customHeaders" , "customQueryParameters" ,
246
- "requestPayer" );
240
+ assertThat (crtRequest ).usingRecursiveComparison (). ignoringFields ( "body" , "sSECustomerAlgorithm" ,
241
+ "sSECustomerKey" , "sSECustomerKeyMD5" ,
242
+ "customHeaders" , "customQueryParameters" ,
243
+ "requestPayer" ). isEqualTo ( sdkRequest );
247
244
assertThat (crtRequest .requestPayer ().name ()).isEqualTo (sdkRequest .requestPayer ().name ());
248
245
assertThat (crtRequest .sSECustomerAlgorithm ()).isEqualTo (sdkRequest .sseCustomerAlgorithm ());
249
246
assertThat (crtRequest .sSECustomerKey ()).isEqualTo (sdkRequest .sseCustomerKey ());
@@ -263,7 +260,7 @@ public void toCrtGetObjectRequest_withCustomHeaders_shouldAttach() {
263
260
264
261
HttpHeader [] headers = crtRequest .customHeaders ();
265
262
verifyHeaders (headers );
266
- assertThat (crtRequest .customQueryParameters ()).isEqualTo ("? hello1=world1&hello2=world2" );
263
+ assertThat (crtRequest .customQueryParameters ()).isEqualTo ("hello1=world1&hello2=world2" );
267
264
}
268
265
269
266
@ Test
0 commit comments