@Test(groups = "unit") public void should_return_object_at_ith_index() { Object expected = new Object(); Object actual = select().from("test").where(eq("foo", expected)).getObject(0); assertThat(actual).isSameAs(expected); }
@Test( groups = "unit", expectedExceptions = {IndexOutOfBoundsException.class}) public void should_throw_IOOBE_if_getObject_called_with_wrong_index() { select().from("test").where(eq("foo", new Object())).getObject(1); }
@Test( groups = "unit", expectedExceptions = {IllegalStateException.class}) public void should_throw_ISE_if_getObject_called_on_statement_without_values() { select() .from("test") .where(eq("foo", 42)) .getObject(0); // integers are appended to the CQL string }
@Test( groups = "unit", expectedExceptions = {IndexOutOfBoundsException.class}) public void should_throw_IOOBE_if_getObject_called_with_wrong_index() { select().from("test").where(eq("foo", new Object())).getObject(1); }
@Test(groups = "unit") public void should_return_object_at_ith_index() { Object expected = new Object(); Object actual = select().from("test").where(eq("foo", expected)).getObject(0); assertThat(actual).isSameAs(expected); }
@Test( groups = "unit", expectedExceptions = {IllegalStateException.class}) public void should_throw_ISE_if_getObject_called_on_statement_without_values() { select() .from("test") .where(eq("foo", 42)) .getObject(0); // integers are appended to the CQL string }