예제 #1
0
    @Test
    public void happyCase() {

      communicationChannels.findByReferenceAndType("REF-1", type);

      assertThat(finderInteraction.getFinderMethod(), is(FinderMethod.FIRST_MATCH));
      assertThat(
          finderInteraction.getResultType(), IsisMatchers.classEqualTo(CommunicationChannel.class));
      assertThat(finderInteraction.getQueryName(), is("findByReferenceAndType"));
      assertThat(
          finderInteraction.getArgumentsByParameterName().get("reference"), is((Object) "REF-1"));
      assertThat(finderInteraction.getArgumentsByParameterName().get("type"), is((Object) type));
      assertThat(finderInteraction.getArgumentsByParameterName().size(), is(2));
    }
예제 #2
0
    @Test
    public void findParties() {

      parties.findParties("*REF?1*");

      assertThat(finderInteraction.getFinderMethod(), is(FinderMethod.ALL_MATCHES));
      assertThat(finderInteraction.getResultType(), IsisMatchers.classEqualTo(Party.class));
      assertThat(finderInteraction.getQueryName(), is("matchByReferenceOrName"));
      assertThat(
          finderInteraction.getArgumentsByParameterName().get("referenceOrName"),
          is((Object) "(?i).*REF.1.*"));

      assertThat(finderInteraction.getArgumentsByParameterName().size(), is(1));
    }
예제 #3
0
  @Test
  public void findMatchingInvoices() {

    invoices.findMatchingInvoices(seller, buyer, paymentMethod, lease, invoiceStatus, dueDate);

    assertThat(finderInteraction.getFinderMethod(), is(FinderMethod.ALL_MATCHES));
    assertThat(finderInteraction.getResultType(), IsisMatchers.classEqualTo(Invoice.class));
    assertThat(finderInteraction.getQueryName(), is("findMatchingInvoices"));
    assertThat(finderInteraction.getArgumentsByParameterName().get("buyer"), is((Object) buyer));
    assertThat(finderInteraction.getArgumentsByParameterName().get("seller"), is((Object) seller));
    assertThat(
        finderInteraction.getArgumentsByParameterName().get("paymentMethod"),
        is((Object) paymentMethod));
    assertThat(finderInteraction.getArgumentsByParameterName().get("lease"), is((Object) lease));
    assertThat(
        finderInteraction.getArgumentsByParameterName().get("status"), is((Object) invoiceStatus));
    assertThat(
        finderInteraction.getArgumentsByParameterName().get("dueDate"), is((Object) dueDate));

    assertThat(finderInteraction.getArgumentsByParameterName().size(), is(6));
  }