[NEW API CLIENT] Java Rest-assured#7492
Conversation
| additionalProperties.put("jackson", "true"); | ||
|
|
||
| } else if (REST_ASSURED.equals(getLibrary())) { | ||
| additionalProperties.put("java8", "true"); |
There was a problem hiding this comment.
Would it be hard to make it compatible with java6 ? That way it could be used on android.
There was a problem hiding this comment.
Initially this client is supposed to be comatible with java8 and supporting java6 would mean rewriting most of the functions, which are used by client.
| */ | ||
| @Test | ||
| public void shouldSee405AfterAddPet() { | ||
| Pet body = null; |
There was a problem hiding this comment.
The petstore samples should include actual tests against the petstore server to verify the generated code in CI
a270bbc to
c698765
Compare
|
|
||
| package {{invokerPackage}}; | ||
|
|
||
| import com.google.gson.Gson; |
There was a problem hiding this comment.
This template should be put in common with okhttp-gson
ApiClient has been added @deprecated has been added for operation {{{returnType}}} has been fixed build.gradle.mustache, build.sbt.mustache, api_doc_mustache has been added Samples has been added for rest-assured Useless supporting files has been removed for rest-assured Sample has been added for rest-assured
5955f62 to
6809d4d
Compare
|
@viclovsky I did some tests locally and the result is good. Thanks for your contribution. |
|
Added to CircleCI Java8 tests via 6bc84ee |
|
This is great! Can you point me to a sample that I can refer to try this? |
|
Hi @asaravindkumar! I have done a project https://github.com/viclovsky/swagger-rest-assured-example where I used swagger code generation. To my mind you can use it for experiments.. Moreover swagger-codegen project has tests examples for the client: https://github.com/swagger-api/swagger-codegen/tree/master/samples/client/petstore/java/rest-assured. Just for information: I am planning to add ability to customize mapper but it will be available after rest-assured 3.0.8 release. |
|
Hi @viclovsky, i cloned the project (https://github.com/viclovsky/swagger-rest-assured-example), during mvn clean install it showing error . example-api-client/target/generated-sources/swagger/src/main/java/ru/vicdev/example/swagger/client/api/PetApi.java:[258,36] no suitable method found for as(java.lang.reflect.Type) |
|
Hi @kuldeepkumar1989, my project had old version rest-assured (3.0.6). It has been updated now. |
|
This is great guys. Thanks @viclovsky |
PR checklist
./bin/to update Petstore sample so that CIs can verify the change. (For instance, only need to run./bin/{LANG}-petstore.shand./bin/security/{LANG}-petstore.shif updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates). Windows batch files can be found in.\bin\windows\.3.0.0branch for changes related to OpenAPI spec 3.0. Default:master.Description of the PR
There is a new API client. It can be used, for instance, for regression testing.
It based on rest-assured library: https://github.com/rest-assured/rest-assured
It is good for positive tests as well as negative.
I was inspired by RARC project: https://github.com/qameta/rarc
Added necessary tests.
Note: Java6 support will be in next PR