dadrus / jpa-unit

JUnit extension to test javax.persistence entities
Apache License 2.0
29 stars 9 forks source link

Implement support for Concordion #10

Closed dadrus closed 7 years ago

dadrus commented 7 years ago

Concordion is a framework for BDD testing

dadrus commented 7 years ago

Adding support for Concordion seems to be impossible due to some insights on how Concordion is implemented:

  1. to enable integration with Concordion, a dynamic proxy needs to be created to be able to intercepts fixture methods called from the specification (at least this is the current approach). Concordion makes the implementation of this approach more complicated than it could be due to the implementation of when and how the fixture object is created. Nevertheless a dynamic proxy can be created. But (see below)
  2. the file name of the specification is derived from the name of the fixture class. Since it (the new fixture) is enhanced by a dynamic proxy, the class name differs from the original one, which results in an exception thrown by Concordion because the corresponding specification cannot be found. Unfortunately Concordion does not offer a way to overwrite the strategy to resolve the specification file name.

So, the above approach (based on the implementation of a derived CucumberRunner) seems to be impossible without the support from the Concordion team: To ease the implementation of 1, the ConcordionRunner should create a fixture object using a dedicated (protected) method (which can be overwritten) instead of calling super.createTest() in multiple places. And for 2 there should be a possibility to pass around a strategy object, which at the end should be used to resolve the name of the specification file.

dadrus commented 7 years ago

v2.1.1 of concordion implements the required functionality