Skip to content

Commit

Permalink
Add test starter and use @EnableDgsTest
Browse files Browse the repository at this point in the history
  • Loading branch information
paulbakker committed Dec 5, 2024
1 parent 418dc6b commit cafab62
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/test/java/com/example/demo/ReviewSubscriptionTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
import com.example.demo.services.ShowsService;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.netflix.graphql.dgs.DgsQueryExecutor;
import com.netflix.graphql.dgs.autoconfig.DgsAutoConfiguration;
import com.netflix.graphql.dgs.client.codegen.GraphQLQueryRequest;
import com.netflix.graphql.dgs.scalars.UploadScalar;
import com.netflix.graphql.dgs.test.EnableDgsTest;
import graphql.ExecutionResult;
import org.junit.jupiter.api.Test;
import org.reactivestreams.Publisher;
Expand All @@ -34,7 +34,8 @@
* Each time a review is added, a new ExecutionResult is given to subscriber.
* Normally, this publisher is consumed by the Websocket/SSE subscription handler and you don't deal with this code directly, but for testing purposes it's useful to use the stream directly.
*/
@SpringBootTest(classes = {DefaultReviewsService.class, ReviewsDataFetcher.class, DgsAutoConfiguration.class, DateTimeScalar.class, UploadScalar.class})
@SpringBootTest(classes = {DefaultReviewsService.class, ReviewsDataFetcher.class, DateTimeScalar.class, UploadScalar.class})
@EnableDgsTest
public class ReviewSubscriptionTest {
@Autowired
DgsQueryExecutor dgsQueryExecutor;
Expand Down
1 change: 0 additions & 1 deletion src/test/java/com/example/demo/ShowsDataFetcherTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import com.example.demo.services.ShowsService;
import com.jayway.jsonpath.TypeRef;
import com.netflix.graphql.dgs.DgsQueryExecutor;
import com.netflix.graphql.dgs.autoconfig.DgsAutoConfiguration;
import com.netflix.graphql.dgs.client.codegen.GraphQLQueryRequest;
import com.netflix.graphql.dgs.scalars.UploadScalar;
import com.netflix.graphql.dgs.test.EnableDgsTest;
Expand Down

0 comments on commit cafab62

Please sign in to comment.