コード例 #1
0
  @Test
  public void testAddSimpleDocumentInContext() {
    final Pool pool = PoolBuilder.aPool().havingDocuments(aDocument().withName("myDoc")).build();
    engineProcessBuilder.casePool(pool);

    final ArgumentCaptor<Expression> argument = ArgumentCaptor.forClass(Expression.class);
    verify(processDefBuilder).addContextEntry(eq("myDoc_ref"), argument.capture());
    assertThat(argument.getValue().getName()).isEqualTo("myDoc");
    assertThat(argument.getValue().getExpressionType())
        .isEqualTo(ExpressionType.TYPE_DOCUMENT.name());
  }
コード例 #2
0
  @Test
  public void testAddBusinessDataInContext() {
    final Pool pool =
        PoolBuilder.aPool()
            .havingData(
                BusinessObjectDataBuilder.aBusinessData()
                    .withName("myBData")
                    .withClassname("my.classname"))
            .build();
    engineProcessBuilder.casePool(pool);

    final ArgumentCaptor<Expression> argument = ArgumentCaptor.forClass(Expression.class);
    verify(processDefBuilder).addContextEntry(eq("myBData_ref"), argument.capture());
    assertThat(argument.getValue().getName()).isEqualTo("myBData");
    assertThat(argument.getValue().getExpressionType())
        .isEqualTo(ExpressionType.TYPE_BUSINESS_DATA_REFERENCE.name());
  }