Class CalloutVerificationTest

java.lang.Object
gg.xp.xivsupport.events.triggers.util.CalloutVerificationTest

public abstract class CalloutVerificationTest extends Object
CalloutVerificationTest is an all-in-one base class for testing duty callouts. To use this, you need a log file. The log file should be in the resources, and you specify the path in the getFileName() method.

You also need to implement the getExpectedCalls() method. If you have this method return an empty list, and then run the test, the log output will contain the actual calls, formatted in the exact form that you would need to specify the expected calls in. Thus, after checking to make sure they are correct, you can simply copy and paste.

There are also some optional methods to control some extra validations:

  • getExpectedAms() lets you specify expected automarker placements.
  • configure(MutablePicoContainer) lets you poke around in the DI container, in case you want to test alternative configurations or enable triggers which are disabled by default.
  • failOnCalloutErrors() can be overridden to return 'false' to disable the behavior of flagging any callout containing the string "Error" as being a failure.
  • minimumMsBetweenCalls() defaults to 1000 (ms) but can be overridden to a lower value. This value will flag callouts which happen in quick succession as failures, as this would often indicate callouts which are talking over one another.