0

I am having code for logging exception trace in case of any exception occurs in flow.

private void logExceptionStackTrace(Throwable throwable) { logger.error(throwable.getMessage() + " <==> " + ExceptionUtils.getFullStackTrace(throwable)); }

I want to write junit test cases covering above code.

I have passed parameters to my flow in such a way that NullPointer Exception will occur.

Regards Aditya

Aditya
  • 185
  • 1
  • 2
  • 8
  • what exactly is the question here? It's unclear, will you please rephrase the question and put some part of the code which is not working or issue you are facing? – Amit Kumar Lal Oct 23 '18 at 08:38
  • [It is impossible to answer your question because you do not provide a specification of what your code ought to do](https://stackoverflow.com/a/53757321/545127). – Raedwald Dec 13 '18 at 08:51

1 Answers1

0

The best way would be to register a special appender and collect the log events there. Then you can check for the existence of a certain event. How to do that depends on the logging framework you use.

jokster
  • 577
  • 5
  • 14