Skip to content

Commit

Permalink
fix test under junit5
Browse files Browse the repository at this point in the history
  • Loading branch information
antoinemeyer committed Mar 2, 2024
1 parent 1de533d commit 185132b
Showing 1 changed file with 16 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
import org.assertj.core.matcher.AssertionMatcher;
import org.awaitility.Awaitility;
import org.hamcrest.CoreMatchers;
import org.hamcrest.MatcherAssert;
import org.hamcrest.Matchers;
import org.junit.Assert;
import org.junit.Test;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.web.servlet.request.MockMvcRequestBuilders;
import org.springframework.test.web.servlet.result.MockMvcResultMatchers;
Expand Down Expand Up @@ -35,9 +36,9 @@ public void test() throws Exception {
new AssertionMatcher<String>() {
@Override
public void assertion(String actual) throws AssertionError {
Assert.assertEquals(6, actual.length());
Assert.assertTrue(actual.endsWith("ms"));
Assert.assertThat(actual, CoreMatchers.startsWith("1"));
Assertions.assertEquals(6, actual.length());
Assertions.assertTrue(actual.endsWith("ms"));
MatcherAssert.assertThat(actual, CoreMatchers.startsWith("1"));
}
}
))
Expand Down Expand Up @@ -69,9 +70,9 @@ public void assertion(String actual) throws AssertionError {
new AssertionMatcher<String>() {
@Override
public void assertion(String actual) throws AssertionError {
Assert.assertEquals(6, actual.length());
Assert.assertTrue(actual.endsWith("ms"));
Assert.assertThat(actual, CoreMatchers.startsWith("2"));
Assertions.assertEquals(6, actual.length());
Assertions.assertTrue(actual.endsWith("ms"));
MatcherAssert.assertThat(actual, CoreMatchers.startsWith("2"));
}
}
))
Expand All @@ -80,7 +81,7 @@ public void assertion(String actual) throws AssertionError {
@Override
public void assertion(String actual) throws AssertionError {
final int difference = (int) Duration.between(upIndicator1FirstLastChecked[0], LocalDateTime.parse(actual)).toMillis();
Assert.assertThat(difference, Matchers.greaterThan(0));
MatcherAssert.assertThat(difference, Matchers.greaterThan(0));
}
}
))
Expand All @@ -89,7 +90,7 @@ public void assertion(String actual) throws AssertionError {
@Override
public void assertion(String actual) throws AssertionError {
final int difference = (int) Duration.between(timingOutSleepingIndicatorInterruptionDisabledFirstLastChecked[0], LocalDateTime.parse(actual)).toMillis();
Assert.assertThat(difference, Matchers.equalTo(0));
MatcherAssert.assertThat(difference, Matchers.equalTo(0));
}
}
));
Expand All @@ -105,9 +106,9 @@ public void assertion(String actual) throws AssertionError {
new AssertionMatcher<String>() {
@Override
public void assertion(String actual) throws AssertionError {
Assert.assertEquals(6, actual.length());
Assert.assertTrue(actual.endsWith("ms"));
Assert.assertThat(actual, CoreMatchers.startsWith("1"));
Assertions.assertEquals(6, actual.length());
Assertions.assertTrue(actual.endsWith("ms"));
MatcherAssert.assertThat(actual, CoreMatchers.startsWith("1"));
}
}
))
Expand All @@ -116,7 +117,7 @@ public void assertion(String actual) throws AssertionError {
@Override
public void assertion(String actual) throws AssertionError {
final int difference = (int) Duration.between(upIndicator1FirstLastChecked[0], LocalDateTime.parse(actual)).toMillis();
Assert.assertThat(difference, Matchers.greaterThan(0));
MatcherAssert.assertThat(difference, Matchers.greaterThan(0));
}
}
))
Expand All @@ -125,7 +126,7 @@ public void assertion(String actual) throws AssertionError {
@Override
public void assertion(String actual) throws AssertionError {
final int difference = (int) Duration.between(timingOutSleepingIndicatorInterruptionDisabledFirstLastChecked[0], LocalDateTime.parse(actual)).toMillis();
Assert.assertThat(difference, Matchers.greaterThan(0));
MatcherAssert.assertThat(difference, Matchers.greaterThan(0));
}
}
));
Expand Down

0 comments on commit 185132b

Please sign in to comment.