-
Notifications
You must be signed in to change notification settings - Fork 8
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
Migrate2junit5 #478
Migrate2junit5 #478
Conversation
Hogajama/hogajama-domain/pom.xml
Outdated
<dependency> | ||
<groupId>org.junit.jupiter</groupId> | ||
<artifactId>junit-jupiter</artifactId> | ||
<version>5.10.1</version> |
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.
Is there a reason, why the versions is not managed in the dependency-management section of the parent pom?
public void setUpMethod() throws Exception { | ||
Mockito.when(sensorCache.getByDeviceId(DEVICE_ID_NOTFOUND)).thenReturn(Optional.empty()); | ||
Mockito.when(sensorCache.getByDeviceId(DEVICE_GRUENER_GEPARD)).thenReturn(TestSensors.sensorGruenerGepard()); | ||
Mockito.lenient().when(sensorCache.getByDeviceId(DEVICE_ID_NOTFOUND)).thenReturn(Optional.empty()); |
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.
Lenient would not be necessary if we make two @nested Test-Classes for each type
- GruenerGepard
- DeviceIdNotFound
Then the Mocks could be done for each class seperately.
Hogajama/hogajama-rs/pom.xml
Outdated
<dependency> | ||
<groupId>org.junit.jupiter</groupId> | ||
<artifactId>junit-jupiter</artifactId> | ||
<version>5.10.1</version> |
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.
Is there a reason, why the versions is not managed in the dependency-management section of the parent pom?
@@ -61,7 +58,7 @@ public void testDateUtilTimeOK() { | |||
public void testDateUtilTimeNOKHour() { | |||
try { | |||
DateUtil.getTime(99, 0, 0); | |||
assertTrue("IllegalArgumentException was not thrown.", false); | |||
assertTrue(false, "IllegalArgumentException was not thrown."); |
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.
Maybe we should use assertThrows for this test and the following. This would increase readability.
Hogajama/hogajama-services/pom.xml
Outdated
<dependency> | ||
<groupId>org.junit.jupiter</groupId> | ||
<artifactId>junit-jupiter</artifactId> | ||
<version>5.10.1</version> |
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.
Is there a reason, why the versions is not managed in the dependency-management section of the parent pom?
<dependency> | ||
<groupId>org.junit.jupiter</groupId> | ||
<artifactId>junit-jupiter</artifactId> | ||
<version>5.10.1</version> |
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.
Is there a reason, why the versions is not managed in the dependency-management section of the parent pom?
Cleaned versions in POMs. |
|
Fixed Checks. |
Migrate Tests from JUnit 4 to 5 with OpenRewrite