github.com/phrase/openapi@v0.0.0-20240514140800-49e8a106740e/openapi-generator/templates/java/libraries/resttemplate/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  {{^fullJavaUtil}}
    11  import java.util.ArrayList;
    12  import java.util.HashMap;
    13  import java.util.List;
    14  import java.util.Map;
    15  {{/fullJavaUtil}}
    16  
    17  /**
    18   * API tests for {{classname}}
    19   */
    20  @Ignore
    21  public class {{classname}}Test {
    22  
    23      private final {{classname}} api = new {{classname}}();
    24  
    25      {{#operations}}{{#operation}}
    26      /**
    27       * {{summary}}
    28       *
    29       * {{notes}}
    30       *
    31       * @throws ApiException
    32       *          if the Api call fails
    33       */
    34      @Test
    35      public void {{operationId}}Test() {
    36          {{#allParams}}
    37          {{{dataType}}} {{paramName}} = null;
    38          {{/allParams}}
    39          {{#returnType}}{{{returnType}}} response = {{/returnType}}api.{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});
    40  
    41          // TODO: test validations
    42      }
    43      {{/operation}}{{/operations}}
    44  }