import com eviware soapui impl support http HttpRequest import com evi

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
import com.eviware.soapui.impl.support.http.HttpRequest
import com.eviware.soapui.config.HttpRequestConfig
import groovy.json.JsonSlurper
import java.net.*
import java.io.*
public class MailcatcherClient{
String server_url
def get_messages(){
def messages_url = server_url + "/messages"
URLConnection mc_connection = new URL(messages_url).openConnection()
BufferedReader br = new BufferedReader(new InputStreamReader(mc_connection.getInputStream()))
JsonSlurper jsonSlurper = new JsonSlurper()
jsonSlurper.parse(br)
}
}
def mc_client = new MailcatcherClient(server_url: project.getPropertyValue("mailcatcher_url"))
project.context.setProperty("mc_client", mc_client)