How to maintain MongoClient connection as a 'singleton' for a TestSuite in groovy/ Soap UI

76 views Asked by At

I have tried as suggested here.

I am able to access the connection object, but it says

IllegalStateException - state should be: open

Below is the snippet which I have tried.

//set connection
testSuite.metaClass.db = db 

//get connection (i am trying to access it from the same testSuite for testing purpose)
def connection = testSuite.db.getConnection()
for(def userObj :connection.User.find()){
 log.info userObj
}
0

There are 0 answers