-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
graphQL integration testing #54
Conversation
# Conflicts: # .gitignore
# Conflicts: # src/main/java/com/solvd/micro9/users/domain/elasticsearch/ESearchUser.java # src/test/java/com/solvd/micro9/users/TestUtils.java
@Test | ||
void verifyUsersAreFondByCriteriaTest() { | ||
int size = 10; | ||
String query = "{ findByCriteria (criteria: {name: \"a\"}, size: " + size |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@eyakauleva you can use formatted()
from java.lang.String
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed 02fd94b
import java.util.stream.IntStream; | ||
|
||
@GraphQlTest(GraphqlUserController.class) | ||
@Import(GraphQLITConfig.class) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@eyakauleva you have naming inconsistency, I mean GraphqlUserController
vs GraphQLITConfig
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed 02fd94b
@Autowired | ||
private UserProducer producer; | ||
|
||
@Test | ||
@SneakyThrows |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@eyakauleva try-catch is bad idea in tests
it's better to use throws
keyword inside your tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed 02fd94b
|
||
@GraphQlTest(GraphqlUserController.class) | ||
@Import(GraphQLITConfig.class) | ||
public class GraphQLIT { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can rename this class to GraphqlUserControllerIT
or GraphqlUserControllerITCase
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed 02fd94b
} | ||
|
||
@Test | ||
void verifyUsersAreFondByCriteriaTest() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@eyakauleva In JUnit 5, It's not necessary, to add suffix Test
to the method's signature
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed 83582da
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice
No description provided.