on 2018 Oct 01 12:00 PM
In the Hybris system, I can find all the object when Hybris startup, but the same dao object can not find any entity in the @IntegrationTest annotated class, anyone know why?
Request clarification before answering.
The integration tests are started in a separate tenant, junit.
That means that all your integration test have a separate data set (thank god) and it's up to you to setup / import data before your test.
Check the Testing in SAP Hybris Commerce page for more details
Also, check how the integration tests shipped with the platform. Good artists copy, great artists steal
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
AFAIK, no
For @IntegrationTest and all the other tests that use the testing API of the platform you have to use junit.
The initial hurdle of setting up test data sucks, trust me, I know. But once you have all the necessary test data in impex files, its rather easy to write proper tests.
Tip: Use de.hybris.platform.servicelayer.ServicelayerTransactionalTest as base class for your integration tests. This starts a transaction before every @Test method and rolls it back afterwards -> any changes to the test data necessary to test are thrown away afterwards
| User | Count |
|---|---|
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.