[spring] add an option to choose the response wrapper type

Also generate the spring-cloud sample with a HystrixCommand wrapper
This commit is contained in:
cbornet
2016-10-25 15:40:51 +02:00
parent 92c474b2c2
commit 21ec2bc866
15 changed files with 157 additions and 129 deletions

View File

@@ -15,6 +15,7 @@ public class SpringOptionsProvider extends JavaOptionsProvider {
public static final String SINGLE_CONTENT_TYPES = "true";
public static final String JAVA_8 = "true";
public static final String ASYNC = "true";
public static final String RESPONSE_WRAPPER = "Callable";
@Override
public String getLanguage() {
@@ -32,6 +33,7 @@ public class SpringOptionsProvider extends JavaOptionsProvider {
options.put(SpringCodegen.SINGLE_CONTENT_TYPES, SINGLE_CONTENT_TYPES);
options.put(SpringCodegen.JAVA_8, JAVA_8);
options.put(SpringCodegen.ASYNC, ASYNC);
options.put(SpringCodegen.RESPONSE_WRAPPER, RESPONSE_WRAPPER);
return options;
}

View File

@@ -64,6 +64,8 @@ public class SpringOptionsTest extends JavaClientOptionsTest {
times = 1;
clientCodegen.setAsync(Boolean.valueOf(SpringOptionsProvider.ASYNC));
times = 1;
clientCodegen.setResponseWrapper(SpringOptionsProvider.RESPONSE_WRAPPER);
times = 1;
}};
}