-
Notifications
You must be signed in to change notification settings - Fork 16
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
Use @DataMongoTest
and @Testcontainers
annotations in WorkerServiceTests
#665
Use @DataMongoTest
and @Testcontainers
annotations in WorkerServiceTests
#665
Conversation
@DataMongoTest
and @Testcontainers
annotations in `WorkerSer…@DataMongoTest
and @Testcontainers
annotations in WorkerServiceTests
private MongoTemplate mongoTemplate; | ||
@Mock | ||
@SpyBean |
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.
Should we try and remove this @SpyBean
annotation? It is used twice:
- On line 192, to assert that a
save
has been done. This could be replaced by checking the object can be retrieved from the repository; - On line 479, to mock a call. This could be replaced by inserting the object beforehand.
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.
Please see aeb00e1
Assertions.assertThat(aliveWorkersGauge).isNotNull(); | ||
Assertions.assertThat(aliveTotalCpuGauge).isNotNull(); | ||
Assertions.assertThat(aliveAvailableCpuGauge).isNotNull(); | ||
assertThat(aliveWorkersGauge).isNotNull(); |
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.
with the test modification, you didn't take the opportunity to use assertAll ?
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.
Please see aeb00e1
Assertions.assertThat(aliveWorkersGauge.value()).isZero(); | ||
Assertions.assertThat(aliveTotalCpuGauge.value()).isZero(); | ||
Assertions.assertThat(aliveAvailableCpuGauge.value()).isZero(); | ||
assertThat(aliveWorkersGauge).isNotNull(); |
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.
with the test modification, you didn't take the opportunity to use assertAll ?
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.
Please see aeb00e1
Quality Gate passedIssues Measures |
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.
Thanks!
No description provided.