Quantcast
Channel: New board topics in SmartBear Community
Viewing all articles
Browse latest Browse all 21061

Compara response (JSON) with data in mongodb.

$
0
0

Hey,

I need to compare an response from an GET rest API (JSON) to data in mongodb.

I connected my mongodb with groovy in my soapui:

 

import com.gmongo.GMongo
import com.mongodb.MongoClient
import com.mongodb.MongoCredential as MC
import com.mongodb.ServerAddress

def mongoClient = new MongoClient( new ServerAddress('MyDataBase:27017') )
def mongo = new GMongo( mongoClient )
def db = mongo.getDB('PADOC')

// attr uit GET halen
def response = context.expand( '${GET 1 Project#Response#$.PROJECT.UUID}' )

//Request weghalen
db.V1Project.findOne('content.PROJECT.UUID': response)

 

So I see the outcome in the log but how can I compare it with my response?

 

Many thanks in advance


Viewing all articles
Browse latest Browse all 21061

Trending Articles