Skip to content

documentation: #2156

@bardackx

Description

@bardackx

What are you missing in the docs

In the page https://netflix.github.io/dgs/query-execution-testing/ this code is recommended

import com.netflix.graphql.dgs.DgsQueryExecutor;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

import java.util.List;
import com.netflix.graphql.dgs.test.EnableDgsTest;

import static org.assertj.core.api.Assertions.assertThat;

@SpringBootTest(classes = {ShowsDatafetcher.class})
@EnableDgsTest
class ShowsDatafetcherTest {

    @Autowired
    DgsQueryExecutor dgsQueryExecutor;

    @Test
    void shows() {
        List<String> titles = dgsQueryExecutor.executeAndExtractJsonPath(
                " { shows { title releaseYear }}",
                "data.shows[*].title");

        assertThat(titles).contains("Ozark");
    }
}

But it won't work unless one removes the classes from SpringBootTest

Maybe is a problem with @EnableDgsTest but this is the message I get if I don't remove the classes parameter from @SpringBootTest

Parameter 1 of method cookieValueArgumentResolver in com.netflix.graphql.dgs.springgraphql.autoconfig.DgsSpringGraphQLAutoConfiguration$WebFluxArgumentHandlerConfiguration required a bean of type 'org.springframework.core.ReactiveAdapterRegistry' that could not be found.

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions