Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Dody
Dody
Online

Badges

Badges
9

Accepted Solutions

Accepted Solutions
0

Likes

Likes
3

Posts

Posts
9

Discussions

Discussions
1

Questions

Questions
8

Ideas

Ideas
0

Blog Posts

Blog Posts
0
Top badges earned by Dody
Customize the badges you want to showcase on your profile
AEM AS CLOUD SERVICE - @aem-upload
Avatar
Boost 3
Level 2
Dody
Level 2

Likes

3 likes

Total Posts

9 posts

Correct reply

0 solutions
Top badges earned
Boost 3
Ignite 3
Affirm 1
Give Back 5
Boost 1
View profile
Dody
- Adobe Experience Manager
Hello Community, I need your help on a topic. I have several locally folders containing assets that i would like to upload to my aem author instance on the cloud. I have read the documentation at : https://github.com/adobe/aem-upload. I am a little bit confused : aio-aem aem:upload test.pdf -c admin:admin -h http://localhost:4502/content/dam : folder aem-upload-1635701310972 is created but no asset is uploaded into it with following error : error: unhandled exception attempting to upload files d...

Views

64

Likes

0

Replies

0
Re: Unit Test for a service using JobManger api
Avatar
Boost 3
Level 2
Dody
Level 2

Likes

3 likes

Total Posts

9 posts

Correct reply

0 solutions
Top badges earned
Boost 3
Ignite 3
Affirm 1
Give Back 5
Boost 1
View profile
Dody
- Adobe Experience Manager
Hi @MohitKumarK , But here is my question, because my service method is only creating a scheduled job and nothing is returned. So i mocked everything, it's fine but i don't now what to assert. Thanks for your help. I put it as correct answer.

Views

67

Like

1

Replies

0
Re: Unit Test for a service using JobManger api
Avatar
Boost 3
Level 2
Dody
Level 2

Likes

3 likes

Total Posts

9 posts

Correct reply

0 solutions
Top badges earned
Boost 3
Ignite 3
Affirm 1
Give Back 5
Boost 1
View profile
Dody
- Adobe Experience Manager
Hello @MohitKumarK , Thanks for the answer. It's more clear now. I did that and then the tests passes. So if i understood well, in my test method i am only calling my serviceMethod. @TeststartMyJob(){ scheduleJob.startMyJob(); Then if i correctly set up the right "when..thenReturn" instructions, i had nothing to do more ? No need to assertTrue.../equals.. nothing ? Thanks in advanceRegards

Views

98

Like

1

Replies

2
Unit Test for a service using JobManger api
Avatar
Boost 3
Level 2
Dody
Level 2

Likes

3 likes

Total Posts

9 posts

Correct reply

0 solutions
Top badges earned
Boost 3
Ignite 3
Affirm 1
Give Back 5
Boost 1
View profile
Dody
- Adobe Experience Manager
Hi Everybody. I opened a previous ticket : https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/mocking-jobmanager-in-junit-unit-test/td-p/429046 because i had issue on mocking annotations. I am opening a new ticket ( related to the previous ) because i will appreciate help or explanations that let me understand the process. I have a service : scheduleJob. In that service i have a function scheduling a job. It will looks like :class ScheduleJob...public void startMyJob(Strin...

Views

120

Likes

0

Replies

4
Re: Mocking JobManager in junit unit TEst
Avatar
Boost 3
Level 2
Dody
Level 2

Likes

3 likes

Total Posts

9 posts

Correct reply

0 solutions
Top badges earned
Boost 3
Ignite 3
Affirm 1
Give Back 5
Boost 1
View profile
Dody
- Adobe Experience Manager
Hi @MohitKumarK , it works well now ( cf previous answer ). Thanks for your remark. I checked and everything is working fine. Thanks for your time. Regards.

Views

109

Likes

0

Replies

0
Re: Mocking JobManager in junit unit TEst
Avatar
Boost 3
Level 2
Dody
Level 2

Likes

3 likes

Total Posts

9 posts

Correct reply

0 solutions
Top badges earned
Boost 3
Ignite 3
Affirm 1
Give Back 5
Boost 1
View profile
Dody
- Adobe Experience Manager
Hi @lukaszm , Thanks for your help. I tried that yesterday and had an error so i thought it wasn't working properly. In fact the error was related to my config and as you said : aemContext.registerService(JobManager.class, jobManager); works well ! Thanks again.

Views

111

Like

1

Replies

0
Re: Mocking JobManager in junit unit TEst
Avatar
Boost 3
Level 2
Dody
Level 2

Likes

3 likes

Total Posts

9 posts

Correct reply

0 solutions
Top badges earned
Boost 3
Ignite 3
Affirm 1
Give Back 5
Boost 1
View profile
Dody
- Adobe Experience Manager
Hello @SantoshSai .Thanks for your help. I tried to change the @Mock with @InjectMock on the jobManager but it doesn't work too. :Cannot instantiate @InjectMocks field named 'jobManager'! Cause: the type 'JobManager' is an interface.You haven't provided the instance at field declaration so I tried to construct the instance. Regards.

Views

141

Likes

0

Replies

0
Re: Mocking JobManager in junit unit TEst
Avatar
Boost 3
Level 2
Dody
Level 2

Likes

3 likes

Total Posts

9 posts

Correct reply

0 solutions
Top badges earned
Boost 3
Ignite 3
Affirm 1
Give Back 5
Boost 1
View profile
Dody
- Adobe Experience Manager
Hi @SivaPrasadReddyS , Thanks for taking some time for me. I already saw that ticket but doesn't feel it's the same isssue. Thanks.

Views

164

Likes

0

Replies

0
Mocking JobManager in junit unit TEst
Avatar
Boost 3
Level 2
Dody
Level 2

Likes

3 likes

Total Posts

9 posts

Correct reply

0 solutions
Top badges earned
Boost 3
Ignite 3
Affirm 1
Give Back 5
Boost 1
View profile
Dody
- Adobe Experience Manager
Hi everybody, Any help will be appreciated. i am trying to create a unit test for myCustomService. This service has a reference to a JobManager. I didn't find any precise documentation to do that. Here what i do : @ExtendsWith({AemContextExtension.class,MockitoExtension.class})class myCustomServiceTest.. @Mock private JobManager jobManager; .private MyCustomService myCustomService = new MyCustomService () .AemContext aemContext = new AemContext(); ..aemContext.registerService(JobManager); aemCon...

Views

177

Likes

0

Replies

8
Likes given to
Likes from