All Downloads are FREE. Search and download functionalities are using the official Maven repository.

handlebars.JavaMicronaut.api_test.mustache Maven / Gradle / Ivy

There is a newer version: 1.0.54
Show newest version
package {{package}};

{{#imports}}import {{import}};
{{/imports}}

import io.micronaut.http.HttpResponse;
import io.micronaut.http.HttpStatus;
import io.micronaut.test.annotation.MicronautTest;
import org.junit.jupiter.api.Test;

import javax.inject.Inject;

import java.util.*;

import static org.junit.jupiter.api.Assumptions.assumeTrue;

@MicronautTest
class {{classname}}ControllerTest {

    @Inject
    private {{classname}} api;

    {{#operations}}
    {{#operation}}
    {{#contents}}
    @Test
    void {{operationId}}{{#isForm}}WithForm{{/isForm}}Test() {
        {{#parameters}}
        {{{dataType}}} {{paramName}} = {{{example}}};
        {{/parameters}}
        try {
            api.{{operationId}}({{#parameters}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/parameters}}).blockingGet();
        } catch (UnsupportedOperationException e) {
            assumeTrue(false, "API is not yet implemented");
        }
    }

    {{/contents}}
    {{/operation}}
    {{/operations}}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy