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

Cannot access spring beans in the JUnit Tenant Test Impex

0 Likes
601

Hello, I have an impex which I execute within JUnit Test

 INSERT_UPDATE LCronJobHistoryCleanUpCronJob;code[unique=true];job(code)
                                            ;myCronJob1       ;compareCatalogVersionsJobPerformable

On the JUnit tenant, the impex import fails with this exception:

 INSERT_UPDATE LCronJobHistoryCleanUpCronJob;code[unique=true];job(code)
 ,,,,error creating item despite missing mandatory/initial columns : line 6: cannot create LCronJobHistoryCleanUpCronJob with values ItemAttributeMap[ registry:  null, type: <null>, data: {code=myCronJob1} ] due to [de.hybris.platform.servicelayer.interceptor.impl.MandatoryAttributesValidator@3f92bc35]:missing values for [job] in model LCronJobHistoryCleanUpCronJobModel (<unsaved>) to create a new LCronJobHistoryCleanUpCronJob| column 2: cannot resolve value 'compareCatalogVersionsJobPerformable' for attribute 'job', error creating item despite missing mandatory/initial columns : line 3: cannot create LCronJobHistoryCleanUpCronJob with values ItemAttributeMap[ registry:  null, type: <null>, data: {code=myCronJob1} ] due to [de.hybris.platform.servicelayer.interceptor.impl.MandatoryAttributesValidator@3f92bc35]:missing values for [job] in model LCronJobHistoryCleanUpCronJobModel (<unsaved>) to create a new LCronJobHistoryCleanUpCronJob;myCronJob1;compareCatalogVersionsJobPerformable

Particularly: "cannot resolve value 'compareCatalogVersionsJobPerformable' for attribute 'job',"

Looks like I cannot access the bean compareCatalogVersionsJobPerformable (and other spring beans, I tested it) within the JUnit tenant during an impeximport ?

Same impex snippet is being imported without problems on the master tenant. What could be the problem?

Thanks in advance!

Sven

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member624549
Participant
0 Likes

you must create the job 'compareCatalogVersionsJobPerformable' in your impex.

This is done during update but only when essentialdata is executed. When essentialdata does not run the job is missing. I assume in junit tenant essentialdata does not run.

0 Likes

Thanks for the reply. But the compareCatalogVersionsJobPerformable ist actually a spring bean. It is already defined in

 hybris/bin/platform/ext/platformservices/resources/jobs-spring.xml

    <bean id="compareCatalogVersionsJobPerformable"
           class="de.hybris.platform.catalog.job.CompareCatalogVersionsJobPerformable" parent="abstractJobPerformable">
        ...
    </bean>

How can I define it in the Impex ?

Thanks.