final List<Map<String, String>> nestedPayloadsList = new ArrayList<Map<String,String>>();
// Only define testDef.payloadJavaClass if the API user has
// claimed she expects a payload.
if (testSpecification.getPayload() != null) {
final String specifiedPayloadTypeName = testSpecification.getPayload().getType();
final PayloadType specifiedPayloadType = PayloadType.payloadTypeForName(specifiedPayloadTypeName);
if(specifiedPayloadType == PayloadType.MAP) {
testDef.put("isMap","true");
for(Map.Entry<String,String> entry : testSpecification.getPayload().getSchema().entrySet()) {
final Map<String,String> nestedPayloadsMap = Maps.newHashMap();
nestedPayloadsMap.put("key",entry.getKey());
final PayloadType payloadTypeForValue = PayloadType.payloadTypeForName(entry.getValue());
if(payloadTypeForValue != PayloadType.MAP) {
nestedPayloadsMap.put("value", payloadTypeForValue.javaClassName);
nestedPayloadsMap.put("valueWithoutArray",
payloadTypeForValue.javaClassName.substring(0, payloadTypeForValue.javaClassName.length() - 2));
if (PayloadType.STRING_ARRAY == payloadTypeForValue) {