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
The following example doesn't work with TestNG 6.8.8, JMockit 1.12 and Java 1.8.0_20.
public class DateUser { public static boolean isLunchTime() { int hour = LocalDateTime.now().getHour(); return hour >= 12 && hour <= 14; } } public class DateUserTest { @Test public void shouldReturnTrueFor12h(@Mocked LocalDateTime dateTime) { new Expectations() {{ LocalDateTime.now(); result = dateTime; dateTime.getHour(); result = 12; }}; boolean isLunchTime = DateUser.isLunchTime(); assertThat(isLunchTime).isTrue(); } }
It works only with JUnit.
The text was updated successfully, but these errors were encountered:
jmockit/jmockit1@8e20ee2
rliesenfeld
No branches or pull requests
The following example doesn't work with TestNG 6.8.8, JMockit 1.12 and Java 1.8.0_20.
It works only with JUnit.
The text was updated successfully, but these errors were encountered: