Skip to content

Commit

Permalink
USE assertThat
Browse files Browse the repository at this point in the history
  • Loading branch information
tristaZero committed Jan 2, 2019
1 parent c9ec0c2 commit 6396932
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
import static org.mockito.Mockito.mock;
Expand Down Expand Up @@ -103,14 +102,14 @@ public void assertGetCalendarValueByColumnIndex() {
@Test
public void assertGetCalendarValueByColumnLabel() {
distinctQueryResult.next();
assertEquals(10, distinctQueryResult.getCalendarValue("order_id", Object.class, Calendar.getInstance()));
assertThat(distinctQueryResult.getCalendarValue("order_id", Object.class, Calendar.getInstance()), is((Object) 10));
}

@Test
@SneakyThrows
public void assertGetInputStreamByColumnIndex() {
distinctQueryResult.next();
assertEquals(getInputStream(10).read(), distinctQueryResult.getInputStream(1, "Unicode").read());
assertThat(distinctQueryResult.getInputStream(1, "Unicode").read(), is(getInputStream(10).read()));
}

@SneakyThrows
Expand All @@ -127,7 +126,7 @@ private InputStream getInputStream(final Object value) {
@SneakyThrows
public void assertGetInputStreamByColumnLabel() {
distinctQueryResult.next();
assertEquals(getInputStream(10).read(), distinctQueryResult.getInputStream("order_id", "Unicode").read());
assertThat(distinctQueryResult.getInputStream("order_id", "Unicode").read(), is(getInputStream(10).read()));
}

@Test
Expand All @@ -137,19 +136,19 @@ public void assertWasNull() {

@Test
public void assertGetColumnCount() {
assertEquals(1, distinctQueryResult.getColumnCount());
assertThat(distinctQueryResult.getColumnCount(), is(1));
}

@Test
@SneakyThrows
public void assertGetColumnLabel() {
assertEquals("order_id", distinctQueryResult.getColumnLabel(1));
assertThat(distinctQueryResult.getColumnLabel(1), is("order_id"));
}

@Test(expected = ShardingException.class)
@SneakyThrows
public void assertGetColumnLabelWithException() {
assertEquals("order_id", distinctQueryResult.getColumnLabel(2));
assertThat(distinctQueryResult.getColumnLabel(2), is("order_id"));
}

@Test
Expand All @@ -159,6 +158,7 @@ public void assertGetColumnIndex() {

@Test
public void assertGetColumnLabelAndIndexMap() {
assertThat(distinctQueryResult.getColumnLabelAndIndexMap())
}

@Test
Expand Down

0 comments on commit 6396932

Please sign in to comment.