Skip to content

Commit

Permalink
test: Replace assertThat with assertInstance
Browse files Browse the repository at this point in the history
  • Loading branch information
giulong committed Oct 6, 2024
1 parent 94e2ba3 commit 6f2a5da
Showing 1 changed file with 8 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@
import java.lang.reflect.Proxy;
import java.util.List;

import static org.hamcrest.CoreMatchers.instanceOf;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.jupiter.api.Assertions.*;
import static org.mockito.Mockito.*;

Expand Down Expand Up @@ -174,11 +172,11 @@ public void testBeforeEach() {
// initPages
assertNull(childTest.toSkip);
assertNotNull(childTest.childTestPage);
assertThat(childTest.childTestPage, instanceOf(FakeSpectrumPage.class));
assertInstanceOf(FakeSpectrumPage.class, childTest.childTestPage);

assertNull(childTest.getParentToSkip());
assertNotNull(childTest.getParentTestPage());
assertThat(childTest.getParentTestPage(), instanceOf(FakeSpectrumPage.class));
assertInstanceOf(FakeSpectrumPage.class, childTest.getParentTestPage());
}

@Test
Expand All @@ -194,12 +192,12 @@ public void initPages() {

assertNull(childTest.toSkip);
assertNotNull(childTest.childTestPage);
assertThat(childTest.childTestPage, instanceOf(FakeSpectrumPage.class));
assertInstanceOf(FakeSpectrumPage.class, childTest.childTestPage);
assertEquals(data, childTest.childTestPage.data);

assertNull(childTest.getParentToSkip());
assertNotNull(childTest.getParentTestPage());
assertThat(childTest.getParentTestPage(), instanceOf(FakeSpectrumPage.class));
assertInstanceOf(FakeSpectrumPage.class, childTest.getParentTestPage());
assertEquals(data, childTest.getParentTestPage().data);
}

Expand All @@ -216,12 +214,12 @@ public void initPagesVoid() {

assertNull(childTestVoid.toSkip);
assertNotNull(childTestVoid.childTestPage);
assertThat(childTestVoid.childTestPage, instanceOf(FakeSpectrumPage.class));
assertInstanceOf(FakeSpectrumPage.class, childTestVoid.childTestPage);
assertEquals(data, childTestVoid.childTestPage.data);

assertNull(childTestVoid.getParentToSkip());
assertNotNull(childTestVoid.getParentTestPage());
assertThat(childTestVoid.getParentTestPage(), instanceOf(FakeSpectrumPage.class));
assertInstanceOf(FakeSpectrumPage.class, childTestVoid.getParentTestPage());
assertEquals(data, childTestVoid.getParentTestPage().data);
}

Expand All @@ -231,7 +229,7 @@ public void testInitPage() {
final SpectrumPage<?, FakeData> actual = spectrumTest.initPage(Reflections.getField("testPage", spectrumTest), spectrumTest.getSharedFields());

assertEquals(spectrumTest.testPage, actual);
assertThat(spectrumTest.testPage, instanceOf(FakeSpectrumPage.class));
assertInstanceOf(FakeSpectrumPage.class, spectrumTest.testPage);

assertEquals("blah", spectrumTest.testPage.getEndpoint());

Expand All @@ -251,7 +249,7 @@ public void initPageWithoutEndpoint() {
final SpectrumPage<?, FakeData> actual = spectrumTest.initPage(Reflections.getField("testPageWithoutEndpoint", spectrumTest), spectrumTest.getSharedFields());

assertEquals(spectrumTest.testPageWithoutEndpoint, actual);
assertThat(spectrumTest.testPageWithoutEndpoint, instanceOf(FakeSpectrumPageWithoutEndpoint.class));
assertInstanceOf(FakeSpectrumPageWithoutEndpoint.class, spectrumTest.testPageWithoutEndpoint);

assertEquals("", spectrumTest.testPageWithoutEndpoint.getEndpoint());

Expand Down

0 comments on commit 6f2a5da

Please sign in to comment.