SAP Commerce ( Hybris ) integration tests without platform restart and for free
One of the most effective things you can do in your SAP Commerce project is to build up a profound integration tests suite. I want to emphasise that by integration tests, I specifically mean the tests extending from ServiceLayerTransactionalTest and hitting your full spring config as well as the junit tenant database. Doing it the right way is a separate topic.
I am not a fan of massively mocked unit tests and specifically not in a hybris environment. I have many reasons for that and will discuss it in a separate post.
Back to the topic, yes you heard that right, you can compile and rerun your integration tests without restarting the SAP Commerce platform. This works with two things combined.
- HotSwap with Hybris ( Kudos to Suleman Mohd ) (a new free solution)
- Using the Testweb Front End, that is reachable via http://yourhybrisbasedomain:port/test
Your code change cycles will go down tremendously.
Some hints for the implementation.
- First of all use the given blogpost from Suleman to setup your hotswap reload
- start the hybris server in the debug mode: ./hybrisserver debug
- open the Testweb Front End, filter for your test and press the “run” button at the bottom, don’t confuse it with the one at the top of the screen
- verify your tests are green, now you can start developing, after each change only execute “ant build” in the extension with the actual code change