22
33import org .firebirdsql .gds .impl .GDSServerVersion ;
44import org .firebirdsql .jdbc .FirebirdConnection ;
5- import org .junit .Ignore ;
6- import org .junit .Test ;
5+ import org .junit .jupiter . api . Disabled ;
6+ import org .junit .jupiter . api . Test ;
77
88import java .sql .*;
99
1414import static org .hamcrest .CoreMatchers .allOf ;
1515import static org .hamcrest .CoreMatchers .containsString ;
1616import static org .hamcrest .MatcherAssert .assertThat ;
17- import static org .junit .Assert .assertEquals ;
18- import static org .junit .Assert .assertFalse ;
19- import static org .junit .Assert .assertTrue ;
17+ import static org .junit .jupiter . api . Assertions .assertEquals ;
18+ import static org .junit .jupiter . api . Assertions .assertFalse ;
19+ import static org .junit .jupiter . api . Assertions .assertTrue ;
2020
21- public class FirebirdContainerTest {
21+ class FirebirdContainerTest {
2222
2323 @ Test
24- public void testWithSysdbaPassword () throws SQLException {
24+ void testWithSysdbaPassword () throws SQLException {
2525 final String sysdbaPassword = "sysdbapassword" ;
2626 try (FirebirdContainer <?> container = new FirebirdContainer <>(FIREBIRD_TEST_IMAGE )
2727 .withSysdbaPassword (sysdbaPassword )) {
2828 container .start ();
2929
3030 try (Connection connection = DriverManager .getConnection (container .getJdbcUrl (), "sysdba" , sysdbaPassword )) {
31- assertTrue ("Connection is valid" , connection . isValid ( 100 ) );
31+ assertTrue (connection . isValid ( 100 ), "Connection is valid" );
3232 }
3333 }
3434 }
3535
3636 @ SuppressWarnings ("deprecation" )
3737 @ Test
38- public void testImplicitImage () throws SQLException {
38+ void testImplicitImage () throws SQLException {
3939 final String sysdbaPassword = "sysdbapassword" ;
4040 try (FirebirdContainer <?> container = new FirebirdContainer <>()
4141 .withSysdbaPassword (sysdbaPassword )) {
4242 container .start ();
4343
4444 try (Connection connection = DriverManager .getConnection (container .getJdbcUrl (), "sysdba" , sysdbaPassword )) {
45- assertTrue ("Connection is valid" , connection . isValid ( 100 ) );
45+ assertTrue (connection . isValid ( 100 ), "Connection is valid" );
4646 }
4747 }
4848 }
@@ -51,36 +51,36 @@ public void testImplicitImage() throws SQLException {
5151 * With {@code username} set to sysdba, {@code password} should take precedence over {@code sysdbaPassword}
5252 */
5353 @ Test
54- public void testUserPasswordTakesPrecedenceOverWithSysdbaPassword () throws SQLException {
54+ void testUserPasswordTakesPrecedenceOverWithSysdbaPassword () throws SQLException {
5555 final String userPassword = "password1" ;
5656 final String withSysdbaPassword = "password2" ;
5757 try (FirebirdContainer <?> container = new FirebirdContainer <>(FIREBIRD_TEST_IMAGE )
5858 .withUsername ("sysdba" ).withPassword (userPassword ).withSysdbaPassword (withSysdbaPassword )) {
5959 container .start ();
6060
6161 try (Connection connection = DriverManager .getConnection (container .getJdbcUrl (), "sysdba" , userPassword )) {
62- assertTrue ("Connection is valid" , connection . isValid ( 100 ) );
62+ assertTrue (connection . isValid ( 100 ), "Connection is valid" );
6363 }
6464 }
6565 }
6666
6767 @ Test
68- public void testWithEnableLegacyClientAuth () throws SQLException {
68+ void testWithEnableLegacyClientAuth () throws SQLException {
6969 try (FirebirdContainer <?> container = new FirebirdContainer <>(FIREBIRD_TEST_IMAGE )
7070 .withEnableLegacyClientAuth ()) {
7171 container .start ();
7272
7373 try (Connection connection = container .createConnection ("" );
7474 Statement statement = connection .createStatement ();
7575 ResultSet rs = statement .executeQuery ("select MON$AUTH_METHOD from MON$ATTACHMENTS where MON$ATTACHMENT_ID = CURRENT_CONNECTION" )) {
76- assertTrue ("Expected a row" , rs . next () );
77- assertEquals ("Authentication method should be Legacy_Auth" , "Legacy_Auth" , rs .getString ("MON$AUTH_METHOD" ));
76+ assertTrue (rs . next (), "Expected a row" );
77+ assertEquals ("Legacy_Auth" , rs .getString ("MON$AUTH_METHOD" ), "Authentication method should be Legacy_Auth" );
7878 }
7979 }
8080 }
8181
8282 @ Test
83- public void testWithEnableLegacyClientAuth_jdbcUrlIncludeAuthPlugins_default () {
83+ void testWithEnableLegacyClientAuth_jdbcUrlIncludeAuthPlugins_default () {
8484 try (FirebirdContainer <?> container = new FirebirdContainer <>(FIREBIRD_TEST_IMAGE )
8585 .withEnableLegacyClientAuth ()) {
8686 container .start ();
@@ -93,7 +93,7 @@ public void testWithEnableLegacyClientAuth_jdbcUrlIncludeAuthPlugins_default() {
9393 }
9494
9595 @ Test
96- public void testWithEnableLegacyClientAuth_jdbcUrlIncludeAuthPlugins_explicitlySet () {
96+ void testWithEnableLegacyClientAuth_jdbcUrlIncludeAuthPlugins_explicitlySet () {
9797 try (FirebirdContainer <?> container = new FirebirdContainer <>(FIREBIRD_TEST_IMAGE )
9898 .withEnableLegacyClientAuth ()
9999 .withUrlParam ("authPlugins" , "Legacy_Auth" )) {
@@ -107,21 +107,21 @@ public void testWithEnableLegacyClientAuth_jdbcUrlIncludeAuthPlugins_explicitlyS
107107 }
108108
109109 @ Test
110- public void testWithEnableWireCrypt () throws SQLException {
110+ void testWithEnableWireCrypt () throws SQLException {
111111 try (FirebirdContainer <?> container = new FirebirdContainer <>(FIREBIRD_TEST_IMAGE ).withEnableWireCrypt ()) {
112112 container .start ();
113113
114114 if (FirebirdContainer .isWireEncryptionSupported ()) {
115115 // Check connecting with wire crypt
116116 try (Connection connection = container .createConnection ("" )) {
117117 GDSServerVersion serverVersion = connection .unwrap (FirebirdConnection .class ).getFbDatabase ().getServerVersion ();
118- assertTrue ("Expected encryption in use" , serverVersion . isWireEncryptionUsed () );
118+ assertTrue (serverVersion . isWireEncryptionUsed (), "Expected encryption in use" );
119119 }
120120 }
121121
122122 try (Connection connection = container .createConnection ("?wireCrypt=disabled" )) {
123123 GDSServerVersion serverVersion = connection .unwrap (FirebirdConnection .class ).getFbDatabase ().getServerVersion ();
124- assertFalse ("Expected encryption not in use" , serverVersion . isWireEncryptionUsed () );
124+ assertFalse (serverVersion . isWireEncryptionUsed (), "Expected encryption not in use" );
125125 }
126126 }
127127 }
@@ -130,15 +130,14 @@ public void testWithEnableWireCrypt() throws SQLException {
130130 * The 2.5 images of jacobalberty/firebird handle FIREBIRD_DATABASE and need an absolute path to access the database
131131 */
132132 @ Test
133- public void test259_scImage () throws Exception {
133+ void test259_scImage () throws Exception {
134134 try (FirebirdContainer <?> container = new FirebirdContainer <>(FIREBIRD_259_SC_IMAGE ).withDatabaseName ("test" )) {
135- assertEquals ("Expect original database name before start" ,
136- "test" , container .getDatabaseName ());
135+ assertEquals ("test" , container .getDatabaseName (), "Expect original database name before start" );
137136
138137 container .start ();
139138
140- assertEquals ("Expect modified database name after start" ,
141- "/firebird/data/test" , container . getDatabaseName () );
139+ assertEquals ("/firebird/data/test" , container . getDatabaseName () ,
140+ "Expect modified database name after start" );
142141
143142 try (Connection connection = DriverManager
144143 .getConnection ("jdbc:firebirdsql://" + container .getHost () + ":" + container .getMappedPort (FIREBIRD_PORT ) + "/" + container .getDatabaseName (),
@@ -155,17 +154,16 @@ public void test259_scImage() throws Exception {
155154 * NOTE: This test is ignored because it occasionally fails locally and repeatedly on GitHub Actions.
156155 * </p>
157156 */
158- @ Ignore
157+ @ Disabled
159158 @ Test
160- public void test259_ssImage () throws Exception {
159+ void test259_ssImage () throws Exception {
161160 try (FirebirdContainer <?> container = new FirebirdContainer <>(FIREBIRD_259_SS_IMAGE ).withDatabaseName ("test" )) {
162- assertEquals ("Expect original database name before start" ,
163- "test" , container .getDatabaseName ());
161+ assertEquals ("test" , container .getDatabaseName (), "Expect original database name before start" );
164162
165163 container .start ();
166164
167- assertEquals ("Expect modified database name after start" ,
168- "/firebird/data/test" , container . getDatabaseName () );
165+ assertEquals ("/firebird/data/test" , container . getDatabaseName () ,
166+ "Expect modified database name after start" );
169167
170168 try (Connection connection = DriverManager
171169 .getConnection ("jdbc:firebirdsql://" + container .getHost () + ":" + container .getMappedPort (FIREBIRD_PORT ) + "/" + container .getDatabaseName (),
@@ -177,7 +175,7 @@ public void test259_ssImage() throws Exception {
177175 }
178176
179177 @ Test
180- public void testWithAdditionalUrlParamInJdbcUrl () {
178+ void testWithAdditionalUrlParamInJdbcUrl () {
181179 try (FirebirdContainer <?> firebird = new FirebirdContainer <>(FIREBIRD_TEST_IMAGE )
182180 .withUrlParam ("charSet" , "utf-8" )
183181 .withUrlParam ("blobBufferSize" , "2048" )) {
0 commit comments