handlebars.JavaSpring.libraries.spring-boot.api_test.mustache Maven / Gradle / Ivy
package {{package}};
{{#imports}}import {{import}};
{{/imports}}
import java.util.*;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.test.context.junit4.SpringRunner;
import static org.junit.Assert.assertEquals;
@RunWith(SpringRunner.class)
@SpringBootTest
public class {{classname}}ControllerIntegrationTest {
@Autowired
private {{classname}} api;
{{#operations}}
{{#operation}}
{{#contents}}
@Test
public void {{operationId}}Test() throws Exception {
{{#parameters}}
{{^isBinary}}
{{{dataType}}} {{paramName}} = {{{example}}};
{{/isBinary}}
{{#isBinary}}
org.springframework.web.multipart.MultipartFile {{paramName}} = null;
{{/isBinary}}
{{/parameters}}
ResponseEntity<{{>returnTypes}}> responseEntity = api.{{operationId}}({{#parameters}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/parameters}});
assertEquals(HttpStatus.NOT_IMPLEMENTED, responseEntity.getStatusCode());
}
{{/contents}}
{{/operation}}
{{/operations}}
}