--
You received this message because you are subscribed to the Google Groups "REST assured" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rest-assured...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
RequestSpecification reqSpec;
// take static RequestSpecBuilder "reqSpecBuilder" and modify it: set base uri, add filters
reqSpec = reqSpecBuilder.build();
// Call appropriate HTTP Method via the following
given(reqSpec).expect().spec(ResponseSpecification).log().all().[insert HTTP method signature here](String arg0, Object... arg1);
Exception java.lang.ArrayIndexOutOfBoundsException
Message: 2
Stacktrace:
at java.util.ArrayList.add(ArrayList.java:441)
at org.codehaus.groovy.runtime.DefaultGroovyMethods.leftShift(DefaultGroovyMethods.java:9177)
at org.codehaus.groovy.runtime.dgm$36.invoke(Unknown Source)
at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoMetaMethodSiteNoUnwrapNoCoerce.invoke(PojoMetaMethodSite.java:71)
at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:53)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)
at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:55)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
at com.jayway.restassured.internal.RequestSpecificationImpl.filter(RequestSpecificationImpl.groovy:479)
at com.jayway.restassured.builder.RequestSpecBuilder.addFilter(RequestSpecBuilder.java:335)
Exception java.util.ConcurrentModificationException
Message: (none)
Stacktrace:
at java.util.ArrayList$Itr.next(ArrayList.java:837)
at org.codehaus.groovy.runtime.DefaultGroovyMethods.findAll(DefaultGroovyMethods.java:3237)
at org.codehaus.groovy.runtime.DefaultGroovyMethods.findAll(DefaultGroovyMethods.java:3146)
at org.codehaus.groovy.runtime.dgm$175.invoke(Unknown Source)
at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoMetaMethodSiteNoUnwrapNoCoerce.invoke(PojoMetaMethodSite.java:271)
at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:53)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
at com.jayway.restassured.internal.SpecificationMerger.mergeFilters(SpecificationMerger.groovy:147)
at sun.reflect.GeneratedMethodAccessor124.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
at org.codehaus.groovy.runtime.callsite.StaticMetaMethodSite$StaticMetaMethodSiteNoUnwrapNoCoerce.invoke(StaticMetaMethodSite.java:148)
at org.codehaus.groovy.runtime.callsite.StaticMetaMethodSite.callStatic(StaticMetaMethodSite.java:99)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callStatic(AbstractCallSite.java:169)
at com.jayway.restassured.internal.SpecificationMerger.merge(SpecificationMerger.groovy:105)
at com.jayway.restassured.internal.SpecificationMerger$merge.call(Unknown Source)
at com.jayway.restassured.internal.RequestSpecificationImpl.spec(RequestSpecificationImpl.groovy:742)
at com.jayway.restassured.RestAssured.given(RestAssured.java:747)
Are these Solution(s)?1. RA's static given(RequestSpecification) API could create it's own internal copies of any internal containers of the RequestSpecification object to prevent the clients from altering the container contents while RA's iterators are iterating over the container elements (and attempting to call add, remove, next, etc).
2. RA clients could explicitly make sure they only build a RequestSpecification with unique non static RequestBuilder objects - RA could try to prevent RequestSpecification objects from being built by static RequestSpecBuilder objects.