Cheers,
Peter
> --
> You received this message because you are subscribed to the Google Groups "Spock Framework - User" group.
> To post to this group, send email to spockfr...@googlegroups.com.
> To unsubscribe from this group, send email to spockframewor...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/spockframework?hl=en.
>
public AuditDynamicTest(String request,String response){
this.request = request;
this.response = response;
}
class DecryptionParameterized extends Specification {
def request;
def response;
@Shared factory
static final number_of_records = 65
def setupSpec(){
factory = EncryptionFactory.getInstance()
Object[][] dataArray = new Object[number_of_records][2];
}
def "trying to bring this into spock"() {
setup:
this.request = request
this.response = response
when:
String token1 = factory.decrypt(this.request).toString();
System.out.println(new String(StringUtils.substringBeforeLast(token1, ">") + ">"));
String token1_response = factory.decrypt(this.response).toString();
System.out.println(new String(StringUtils.substringBeforeLast(token1_response, ">") + ">"));
then:
token1 != null
token1_response != null
token1.length() > 0
token1_response.length() > 0
where:
groovy class :class DecryptionParameterized extends Specification {
def factory = EncryptionFactory.getInstance()
def "trying to bring this into spock"() {
when:
String token1 = factory.decrypt(request).toString()
println StringUtils.substringBeforeLast(token1, ">") + ">"
String token1_response = factory.decrypt(this.response).toString()
println StringUtils.substringBeforeLast(token1_response, ">") + ">"
then:
token1 != null
token1_response != null
token1.length() > 0
token1_response.length() > 0
where:
// assuming a line has just two values
// otherwise[request, response] << new File("/Users/bkern/table_export5.csv").readLines()*.split(",")
request = line[0]line << new File("/Users/bkern/table_export5.csv").readLines()*.split(",")