Changing return from HelloMessage to String in Test fails
norricorp opened this issue · 1 comments
norricorp commented
I know this is not a problem with the code but I am interested to know the answer.
I have replaced the use of both Greeting and HelloMessage POJO's with String.
This works except for the unit test (so I skipTests).
The problem appears to be in getPayLoadType in GreetingIntegrationTests.java.
Here is the code change
public Type getPayloadType(StompHeaders headers) {
System.out.println("DEBUG: into getPayloadType");
return String.class;
}
Output shows the debug message but no return. Which means that it times out
if (latch.await(3, TimeUnit.SECONDS)) {
if (failure.get() != null) {
throw new AssertionError("", failure.get());
}
}
else {
fail("DEBUG: Greeting not received");
}
and the not received message is received.
So code changes in the actual code is correct but I have made mistakes in the integation test code.
Any ideas?
Regards,
dsyer commented
I guess you forgot to set the MessageConverter
in the test? E.g.
this.stompClient.setMessageConverter(new StringMessageConverter());