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.

  1. HotSwap with Hybris ( Kudos to Suleman Mohd ) (a new free solution)
  2. Using the Testweb Front End, that is reachable via http://yourhybrisbasedomain:port/test

Thats it!

Image for post
Image for post
Photo by SpaceX on Unsplash

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

Written by

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store