Skip to content

Commit

Permalink
Adding a test and adding a missed annotation.
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter Hicks authored and wslulciuc committed Aug 4, 2020
1 parent 07b477d commit 6f79b06
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/test/java/marquez/db/ColumnsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ public void testStringOrNull_null() throws SQLException {
assertThat(actual).isEqualTo(expected);
}

@Test
public void testStringOrThrow_string() throws SQLException {
final String column = "with_string";
final String expected = "string";
Expand All @@ -154,6 +155,17 @@ public void testStringOrThrow_string() throws SQLException {
assertThat(actual).isEqualTo(expected);
}

@Test
public void testIntOrThrow_int() throws SQLException {
final String column = "count";
final int expected = 1;
when(results.getObject(column)).thenReturn(expected);
when(results.getInt(column)).thenReturn(expected);

final int actual = Columns.intOrThrow(results, column);
assertThat(actual).isEqualTo(expected);
}

@Test
public void testStringOrThrow_throw() throws SQLException {
final String column = "with_null_string";
Expand Down

0 comments on commit 6f79b06

Please sign in to comment.