Skip to content

Commit 903a89f

Browse files
committed
JAVA-2226: Split one test into two for clarity and ignore one test on Java 6, where NIO2 is not supported
1 parent 9d348e0 commit 903a89f

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

driver-async/src/test/functional/com/mongodb/async/client/MongoClientsSpecification.groovy

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import com.mongodb.MongoCredential
2121
import com.mongodb.ServerAddress
2222
import com.mongodb.connection.AsynchronousSocketChannelStreamFactoryFactory
2323
import com.mongodb.connection.netty.NettyStreamFactoryFactory
24+
import spock.lang.IgnoreIf
2425

2526
import static java.util.concurrent.TimeUnit.MILLISECONDS
2627

@@ -71,18 +72,30 @@ class MongoClientsSpecification extends FunctionalSpecification {
7172
client?.close()
7273
}
7374

74-
def 'should apply connection string to netty stream type'() {
75+
def 'should apply connection string to ssl settings'() {
7576
when:
76-
def client = MongoClients.create('mongodb://localhost/?ssl=true&streamType=Netty')
77+
def client = MongoClients.create('mongodb://localhost/?ssl=true&sslInvalidHostNameAllowed=true&streamType=netty')
7778

7879
then:
7980
client.settings.sslSettings.enabled
81+
client.settings.sslSettings.invalidHostNameAllowed
82+
83+
cleanup:
84+
client?.close()
85+
}
86+
87+
def 'should apply connection string to netty stream type'() {
88+
when:
89+
def client = MongoClients.create('mongodb://localhost/?streamType=Netty')
90+
91+
then:
8092
client.settings.streamFactoryFactory instanceof NettyStreamFactoryFactory
8193

8294
cleanup:
8395
client?.close()
8496
}
8597

98+
@IgnoreIf({ javaVersion < 1.7 })
8699
def 'should apply connection string to nio2 stream type'() {
87100
when:
88101
def client = MongoClients.create('mongodb://localhost/?streamType=NIO2')

0 commit comments

Comments
 (0)