コード例 #1
0
  /** @see DATAKV-114 */
  @Test
  public void countsEntitiesWithNullProperty() throws Exception {

    doReturn(people).when(adapter).getAllOf(anyString());

    assertThat(
        engine.count(createQueryForMethodWithArgs("findByFirstname", "bob"), anyString()), is(1L));
  }
コード例 #2
0
  /** @see DATAKV-114 */
  @Test
  @SuppressWarnings("unchecked")
  public void queriesEntitiesWithNullProperty() throws Exception {

    doReturn(people).when(adapter).getAllOf(anyString());

    assertThat(
        (Collection<Person>)
            engine.execute(
                createQueryForMethodWithArgs("findByFirstname", "bob"), null, -1, -1, anyString()),
        contains(BOB_WITH_FIRSTNAME));
  }
コード例 #3
0
  @Before
  public void setUp() {

    engine = new SpelQueryEngine<KeyValueAdapter>();
    engine.registerAdapter(adapter);
  }