Comments (4)
Hi @AshaBPatil, I'm not able to reproduce this with the current version of the framework running springboot 3.2 as the dgs application boots successfully. I noticed error message mentions testClass = com.chegg.acds.answer.service.datafetcher.AnswerFieldDataFetcherTest, it appears this is failing in a test context?
from dgs-framework.
yes this is happening only in the test environment , this is the test code :
@ExtendWith(MockitoExtension.class)
@SpringBootTest(
classes = {
DgsAutoConfiguration.class,
AnswerFieldDataFetcher.class,
GraphQLRuntimeWiring.class,
DgsExtendedScalarsAutoConfiguration.class
},
properties = {})
public class AnswerFieldDataFetcherTest {
@Autowired DgsQueryExecutor dgsQueryExecutor;
@MockBean AnswerService answerService;
@MockBean Executor answerAsyncExecutor;
HttpHeaders httpHeaders;
@MockBean CompletableFuture completableFuture;
@beforeeach
public void init() {
openMocks(this);
httpHeaders =
new HttpHeaders(
new LinkedMultiValueMap<>() {
{
put(X_CHEGG_USER_UUID.getKey(), Collections.singletonList(USER_UUID.toString()));
}
});
}
@test
@DisplayName("Get ec answer field for question with exception")
public void testEcAnswersWithException() throws ExecutionException, InterruptedException {
doThrow(new RuntimeException()).when(answerAsyncExecutor).execute(any(Runnable.class));
Map<String, Object> variables = getVariables(QUESTION_UUID.toString());
ExecutionResult result =
dgsQueryExecutor.execute(GET_EC_ANSWER_FIELD_QUERY, variables, null, httpHeaders);
assertTrue(result.getErrors().size() > 0);
assertEquals(
result.getErrors().get(0).getMessage(),
String.format(
"%s: %s",
InternalServerError.class.getCanonicalName(),
String.format(UNABLE_TO_GET_EC_ANSWER_BY_QUESTION, QUESTION_UUID)));
}
}
from dgs-framework.
Confirming this did compile and run in spring 2.x and no longer in 3.x. The issue is that ScheduledExecutorService
is a dependency of dgsQueryExecutor and the issue arises when mocking it's superclass Executor
.
ScheduledExecutorService extends Executor with additional functionality. Can you try swapping Executor
for ScheduledExecutorService
for your mock?
from dgs-framework.
this worked for me thank you
from dgs-framework.
Related Issues (20)
- documentation: Enhancing documentation on Spring Security integration limitations in DGS Framework HOT 3
- feature: subscription HTTP callback support HOT 6
- Stack Overflow (Criteria.parse) with JsonPath HOT 8
- bug: Schema hot-reload not works at all, spring 3.2.1 HOT 7
- bug: Registering customer mapper bean leads to exception HOT 7
- bug: DataFetchingEnvironment::localContext overwritten by Spring Actuator for Nested Data Fetchers HOT 3
- bug: DGS 8.2.2 doesn't work out of the box with spring-boot 3.2.1 because of a reactor version mismatch
- bug: timer threads created in WebsocketGraphQLTransportWSProtocolHandler persist after session closes HOT 1
- bug: client throws error when parsing response with error. HOT 2
- bug: Extended JSON scalar serialization not working for mutation input HOT 1
- bug: Make path field of GraphQLError nullable HOT 6
- documentation: error handling example is outdated for currentl graphql-java version HOT 3
- InputMapDefinesTooManyFieldsException: Cancel Field Validation HOT 1
- bug: BaseDgsQueryExecutor silently handles exceptions from instrumentations HOT 5
- feature: Allow specifying custom scalars when generating queries using Kotlin query projections HOT 11
- bug: webRequest.getResponse() is null HOT 5
- bug: CORS errors in frontend app only after updating to v6 (with SpringBoot 3) HOT 1
- Scalar backed by value class inside input type fail to deserialize HOT 3
- bug: No qualifying bean of type 'com.fasterxml.jackson.databind.ObjectMapper' available HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dgs-framework.