11
11
import java .util .Properties ;
12
12
13
13
import static org .assertj .core .api .BDDAssertions .then ;
14
- import static org .junit .jupiter .api .Assertions .assertEquals ;
15
14
import static org .junit .jupiter .api .Assertions .assertThrows ;
16
15
import static org .junit .jupiter .api .Assertions .fail ;
17
16
import org .junit .jupiter .api .BeforeEach ;
@@ -59,23 +58,23 @@ public void overridesAsMap() {
59
58
map .put (S3_SPI_READ_MAX_FRAGMENT_SIZE_PROPERTY , "1212" );
60
59
S3NioSpiConfiguration c = new S3NioSpiConfiguration (map );
61
60
62
- assertEquals ( 1212 , c .getMaxFragmentSize ());
61
+ then ( c .getMaxFragmentSize ()). isEqualTo ( 1212 );
63
62
}
64
63
65
64
@ Test
66
65
public void getS3SpiReadMaxFragmentSize () {
67
- assertEquals ( S3_SPI_READ_MAX_FRAGMENT_SIZE_DEFAULT , config .getMaxFragmentSize ());
66
+ then ( config .getMaxFragmentSize ()). isEqualTo ( S3_SPI_READ_MAX_FRAGMENT_SIZE_DEFAULT );
68
67
69
- assertEquals ( 1111 , overriddenConfig .getMaxFragmentSize ());
70
- assertEquals ( S3_SPI_READ_MAX_FRAGMENT_SIZE_DEFAULT , badOverriddenConfig .getMaxFragmentSize ());
68
+ then ( overriddenConfig .getMaxFragmentSize ()). isEqualTo ( 1111 );
69
+ then ( badOverriddenConfig .getMaxFragmentSize ()). isEqualTo ( S3_SPI_READ_MAX_FRAGMENT_SIZE_DEFAULT );
71
70
}
72
71
73
72
@ Test
74
73
public void getS3SpiReadMaxFragmentNumber () {
75
- assertEquals ( S3_SPI_READ_MAX_FRAGMENT_NUMBER_DEFAULT , config .getMaxFragmentNumber ());
74
+ then ( config .getMaxFragmentNumber ()). isEqualTo ( S3_SPI_READ_MAX_FRAGMENT_NUMBER_DEFAULT );
76
75
77
- assertEquals ( 2 , overriddenConfig .getMaxFragmentNumber ());
78
- assertEquals ( S3_SPI_READ_MAX_FRAGMENT_NUMBER_DEFAULT , badOverriddenConfig .getMaxFragmentNumber ());
76
+ then ( overriddenConfig .getMaxFragmentNumber ()). isEqualTo ( 2 );
77
+ then ( badOverriddenConfig .getMaxFragmentNumber ()). isEqualTo ( S3_SPI_READ_MAX_FRAGMENT_NUMBER_DEFAULT );
79
78
}
80
79
81
80
@ Test
@@ -198,6 +197,7 @@ public void withAndGetCredentials() {
198
197
then (config .withCredentials (C2 )).isSameAs (config );
199
198
then (config .getCredentials ()).isSameAs (C2 );
200
199
then (config .withCredentials (null ).getCredentials ()).isNull ();
200
+ then (config .withCredentials (C1 ).withCredentials (null , null ).getCredentials ()).isNull ();
201
201
202
202
//
203
203
// withCredentials(AwsCredentials) takes priority over withCredentialas(String, String)
@@ -212,10 +212,10 @@ public void withAndGetCredentials() {
212
212
@ Test
213
213
public void convertPropertyNameToEnvVar () {
214
214
String expected = "FOO_BAA_FIZZ_BUZZ" ;
215
- assertEquals ( expected , config .convertPropertyNameToEnvVar ("foo.baa.fizz-buzz" ));
215
+ then ( config .convertPropertyNameToEnvVar ("foo.baa.fizz-buzz" )). isEqualTo ( expected );
216
216
217
217
expected = "" ;
218
- assertEquals ( expected , config .convertPropertyNameToEnvVar (null ));
219
- assertEquals ( expected , config .convertPropertyNameToEnvVar (" " ));
218
+ then ( config .convertPropertyNameToEnvVar (null )). isEqualTo ( expected );
219
+ then ( config .convertPropertyNameToEnvVar (" " )). isEqualTo ( expected );
220
220
}
221
221
}
0 commit comments