Search in sources :

Example 1 with EimDbCreator

use of io.elastest.eim.database.mysql.EimDbCreator in project elastest-instrumentation-manager by elastest.

the class Bootstrap method init.

@Override
public void init(ServletConfig config) throws ServletException {
    Info info = new Info().title("Swagger Server").description("RESTful API specification for the ElasTest Instrumentation Manager (EIM)").termsOfService("TBD").contact(new Contact().email("david.rojoa@atos.net")).license(new License().name("Apache 2.0").url("http://www.apache.org/licenses/LICENSE-2.0.html"));
    ServletContext context = config.getServletContext();
    Swagger swagger = new Swagger().info(info);
    // load properties
    String propertiesFile = "/WEB-INF/bootstrap.properties";
    Properties.load(config.getServletContext().getResourceAsStream(propertiesFile), propertiesFile);
    // create database schema
    EimDbCreator dbCreator = new EimDbCreator();
    dbCreator.createSchema();
    new SwaggerContextService().withServletConfig(config).updateSwagger(swagger);
}
Also used : SwaggerContextService(io.swagger.jaxrs.config.SwaggerContextService) Swagger(io.swagger.models.Swagger) License(io.swagger.models.License) ServletContext(javax.servlet.ServletContext) Info(io.swagger.models.Info) EimDbCreator(io.elastest.eim.database.mysql.EimDbCreator) Contact(io.swagger.models.Contact)

Aggregations

EimDbCreator (io.elastest.eim.database.mysql.EimDbCreator)1 SwaggerContextService (io.swagger.jaxrs.config.SwaggerContextService)1 Contact (io.swagger.models.Contact)1 Info (io.swagger.models.Info)1 License (io.swagger.models.License)1 Swagger (io.swagger.models.Swagger)1 ServletContext (javax.servlet.ServletContext)1