Junit5, Mockito for catch block for tidyJsonItemWriter.dump

Avatar

Avatar
Level 1
anilc27140375
Level 1

Likes

0 likes

Total Posts

1 post

Correct reply

0 solutions
View profile

Avatar
Level 1
anilc27140375
Level 1

Likes

0 likes

Total Posts

1 post

Correct reply

0 solutions
View profile
anilc27140375
Level 1

23-08-2020

How to cover the catch block for tidyJsonItemWriter.dump() method

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Boost 250
MVP
Nikhil-Kumar
MVP

Likes

251 likes

Total Posts

262 posts

Correct reply

38 solutions
Top badges earned
Boost 250
Validate 1
Ignite 3
Ignite 1
Give Back 5
View profile

Avatar
Boost 250
MVP
Nikhil-Kumar
MVP

Likes

251 likes

Total Posts

262 posts

Correct reply

38 solutions
Top badges earned
Boost 250
Validate 1
Ignite 3
Ignite 1
Give Back 5
View profile
Nikhil-Kumar
MVP

24-08-2020

@anilc27140375 
Please have a look into below link, it's not exact the same thing. But it might help.
https://www.codejava.net/testing/junit-test-exception-examples-how-to-assert-an-exception-is-thrown

Thanks,
Nikhil

Answers (1)

Answers (1)

Avatar

Avatar
Boost 500
MVP
Vijayalakshmi_S
MVP

Likes

573 likes

Total Posts

728 posts

Correct reply

240 solutions
Top badges earned
Boost 500
Give Back 50
Give Back 5
Ignite 10
Ignite 5
View profile

Avatar
Boost 500
MVP
Vijayalakshmi_S
MVP

Likes

573 likes

Total Posts

728 posts

Correct reply

240 solutions
Top badges earned
Boost 500
Give Back 50
Give Back 5
Ignite 10
Ignite 5
View profile
Vijayalakshmi_S
MVP

25-08-2020

Hi @anilc27140375,

Can you let know if you are printing log message or any logic is handled in catch block for JSONException, RepositoryException and/or ValueFormatException part of dump method