github.com/phrase/openapi@v0.0.0-20240514140800-49e8a106740e/openapi-generator/templates/java/libraries/google-api-client/api_test.mustache (about) 1 {{>licenseInfo}} 2 3 package {{package}}; 4 5 {{#imports}}import {{import}}; 6 {{/imports}} 7 import org.junit.Test; 8 import org.junit.Ignore; 9 10 import java.io.IOException; 11 {{^fullJavaUtil}} 12 import java.util.ArrayList; 13 import java.util.HashMap; 14 import java.util.List; 15 import java.util.Map; 16 {{/fullJavaUtil}} 17 18 /** 19 * API tests for {{classname}} 20 */ 21 @Ignore 22 public class {{classname}}Test { 23 24 private final {{classname}} api = new {{classname}}(); 25 26 {{#operations}}{{#operation}} 27 /** 28 * {{summary}} 29 * 30 * {{notes}} 31 * 32 * @throws IOException 33 * if the Api call fails 34 */ 35 @Test 36 public void {{operationId}}Test() throws IOException { 37 {{#allParams}} 38 {{{dataType}}} {{paramName}} = null; 39 {{/allParams}} 40 {{#returnType}}{{{returnType}}} response = {{/returnType}}api.{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); 41 42 // TODO: test validations 43 } 44 {{/operation}}{{/operations}} 45 }