package com.elab.spring.config;

import junit.framework.TestCase;
import org.junit.Test;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;

/**
 * @Module TODO
 * @Description TODO
 * @Author liukaixiong
 * @Date 2020/12/21 13:48
 */
public class SwaggerConfigBeanTest extends TestCase {


    @Test
    public void test1() {
        Docket build = new Docket(DocumentationType.SWAGGER_2)
                .apiInfo(apiInfo())
                .select()
                // 具体需要扫描的包
                .apis(RequestHandlerSelectors.basePackage("com.elab.spring.config"))
                .paths(PathSelectors.any())
                .build();

    }

    private ApiInfo apiInfo() {
        return new ApiInfoBuilder()
                .title("aaaa")
                .build();
    }

}