Skip to content

Commit 5a4c642

Browse files
committed
#29 - Polishing.
Formatting for improved readability. Fixed cut'n'paste JavaDoc. Copying over the port from configuration to `ConnectionFactory`.
1 parent 69fa2a8 commit 5a4c642

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

src/test/java/org/springframework/data/r2dbc/testing/SqlServerTestSupport.java

+11-7
Original file line numberDiff line numberDiff line change
@@ -33,31 +33,35 @@ public class SqlServerTestSupport {
3333

3434
/**
3535
* Returns a locally provided database at {@code sqlserver:@localhost:1433/master}.
36-
*
37-
* @return
3836
*/
3937
public static ExternalDatabase database() {
4038
return local();
4139
}
4240

4341
/**
44-
* Returns a locally provided database at {@code postgres:@localhost:5432/postgres}.
45-
*
46-
* @return
42+
* Returns a locally provided database at {@code sqlserver:@localhost:1433/master}.
4743
*/
4844
private static ExternalDatabase local() {
49-
return ProvidedDatabase.builder().hostname("localhost").port(1433).database("master").username("sa")
50-
.password("A_Str0ng_Required_Password").build();
45+
46+
return ProvidedDatabase.builder() //
47+
.hostname("localhost") //
48+
.port(1433) //
49+
.database("master") //
50+
.username("sa") //
51+
.password("A_Str0ng_Required_Password") //
52+
.build();
5153
}
5254

5355
/**
5456
* Creates a new {@link ConnectionFactory} configured from the {@link ExternalDatabase}..
5557
*/
5658
public static ConnectionFactory createConnectionFactory(ExternalDatabase database) {
59+
5760
return new MssqlConnectionFactory(MssqlConnectionConfiguration.builder().host(database.getHostname()) //
5861
.database(database.getDatabase()) //
5962
.username(database.getUsername()) //
6063
.password(database.getPassword()) //
64+
.port(database.getPort()) //
6165
.build());
6266
}
6367

0 commit comments

Comments
 (0)