camunda/camunda-bpm-assert

[CMMN] Make "untyped" `caseExecution` helper mehods `public`?

martinschimak opened this issue · 1 comments

Currently we have

  @Override
  public CaseExecutionAssert caseExecution(CaseExecutionQuery query) {
    return super.caseExecution(query.caseInstanceId(getActual().getId()));
  }

as part of the public API in CaseInstanceAssert. I am not yet convinced that we want to have that. I would actually think that test developers should know in advance what "type" of caseExecution they expect to see "inside" another one - e.g. a MileStone. Therefore they should use the typed method, e.g.

  @Override
  public MilestoneAssert milestone(CaseExecutionQuery query) {
    return super.milestone(query);
  }

This of course also has the advantage that we can easily return a "MilestoneAssert".

Therfore, my "mental model" was/is that we probably (I am not fully sure!) won't make caseExecution(...) public to retrieve "chained" runtime objects.

(By the way: this was also the reason why I did not return a "CaseExecutionAssert" in the caseExecution() methods of AbstractCaseAssert. I thought it is a rather internal method and therefore more convenient to directly return the CaseExecution)

Other arguments?

First of all, sorry for the late answer. As you already may have guessed, I'm using this framework in a customer project and this project kept me very busy last week.
Nevertheless, this also helps me to field test the assertions :)

In PR #64 i wrote that I followed some pattern I thought I had recognized in the BPMN part. But your arguments are very valid and not it feels like I was in a hurry, when I made that method public. As far as I remember, I even argued the same way in favor of having custom-tailored asserts (HumanTask, Milestone,..) instead of a generic CaseExecutionAssert.

We should make that method protected again.