cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Dao Obect can not find anything in Integration testing

Former Member
0 Likes
356

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?

Accepted Solutions (0)

Answers (1)

Answers (1)

mpern
Product and Topic Expert
Product and Topic Expert
0 Likes

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

Former Member
0 Likes

Hi Markus, thank you very much for your comment, would I further know that is it possible to change the integration testing scenario to Master tenant?

mpern
Product and Topic Expert
Product and Topic Expert
0 Likes

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