Note that there are some explanatory texts on larger screens.

plurals
  1. POIs there BDD java framework capable of reusing Given, Then? (with varying When step )
    primarykey
    data
    text
    <p>I am looking for BDD java framework with possibility to reuse Given &amp; Then for Unit and Integration tests.</p> <p>In other words 1. <strong>Given</strong> some precondition. 2. <strong>When</strong> - depending on the environment 3. <strong>Then</strong> verify results of <strong>When</strong></p> <p>I want to be able by changing When, and keeping <strong>Given</strong> and <strong>Then</strong> intact, change the type of the test, for example in simple REST service:</p> <ol> <li><strong>UNIT test</strong> <ul> <li><strong>Given</strong> <ul> <li>generates some POJO object</li> </ul></li> <li><strong>When</strong> <ul> <li>receives POJO from <strong>Given</strong></li> <li><strong>calls internal service with this POJO</strong></li> <li><strong>receives result in POJO form from the service</strong></li> <li>forwards received POJO to <strong>Then</strong></li> </ul></li> <li><strong>Then</strong> <ul> <li>verifies POJO from <strong>When</strong></li> </ul></li> </ul></li> <li><strong>INTEGRATION test</strong> <ul> <li><strong>Given</strong> <ul> <li>generates some POJO object</li> </ul></li> <li><strong>When</strong> <ul> <li>receives POJO from <strong>Given</strong> </li> <li><strong>encrypts POJO in external service format</strong> </li> <li><strong>calls external service</strong></li> <li><strong>receives result in external service format from exposed service</strong></li> <li><strong>transforms received result in POJO</strong> </li> <li>forwards received POJO to <strong>Then</strong></li> </ul></li> <li><strong>Then</strong> <ul> <li>verifies POJO from <strong>When</strong></li> </ul></li> </ul></li> </ol> <p>So in example, <strong>Given</strong> and <strong>Then</strong> behave the same way, for both integration and unit tests, and by simply changin <strong>When the scope of the test goes from UNIT to INTEGRATION</strong>.</p> <p><strong>Can someone point me in the right direction?</strong></p> <p>I don't want to reinvent the wheel</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload