Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Подключаем swagger фильтр для снятия запросов #4

Open
eroshenkoam opened this issue Jun 17, 2020 · 0 comments

Comments

@eroshenkoam
Copy link
Owner

eroshenkoam commented Jun 17, 2020

Добавляем репозиторий:

    maven { url 'https://dl.bintray.com/viclovsky/maven/' }

Добавляем зависимость:

compile("com.github.viclovsky.swagger.coverage:swagger-coverage-rest-assured:1.3.0")

Добавляем фильтр:

    public static RequestSpecification defaultSpec() {
        return new RequestSpecBuilder()
                .addFilter(new SwaggerCoverageRestAssured(defaultWriter()))
                .setBaseUri("https://petstore.swagger.io/v2")
                .addHeader("Accept", "application/json")
                .addHeader("Content-Type", "application/json")
                .build();
    }

    private static CoverageOutputWriter defaultWriter() {
        final Path build = Paths.get("build");
        return new FileSystemOutputWriter(build.resolve(OUTPUT_DIRECTORY));
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant