Skip to content

Connection refused with Spring Boot Starter Webflux #274

Open
@mikrethor

Description

@mikrethor

For my tests I use com.epages:restdocs-api-spec-restassured and my application is developed with spring-boot-starter-webflux unfortunately restdocs-api-spec contains spring-boot-starter-web and it makes the tests fails with a connection refused so my test is not working.

For my use case I use the maven plugin

<groupId>io.github.berkleytechnologyservices</groupId>
<artifactId>restdocs-spec-maven-plugin</artifactId>

And the latest version (0.19.4).

So to make it work I exclude spring-boot-starter-web from restdocs-api-spec with the following code :

<dependency>
            <groupId>com.epages</groupId>
            <artifactId>restdocs-api-spec</artifactId>
            <version>${restdocs-api-spec.version}</version>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-starter-web</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

The code doesn't need to include the spring-boot-starter-web it can just use spring framework dependencies spring-web and spring-context.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions