java.lang.Object
com.github.tomakehurst.wiremock.extension.responsetemplating.helpers.HandlebarsHelper<T>
Type Parameters:
T - Type used as context for the Handlebars helper.
All Implemented Interfaces:
com.github.jknack.handlebars.Helper<T>
Direct Known Subclasses:
ArrayHelper, ContainsHelper, FormDataHelper, HandlebarsCurrentDateHelper, HandlebarsJsonPathHelper, HandlebarsRandomValuesHelper, HandlebarsXPathHelper, HostnameHelper, MatchesRegexHelper, MathsHelper, ParseDateHelper, ParseJsonHelper, PickRandomHelper, RandomDecimalHelper, RandomIntHelper, RangeHelper, RegexExtractHelper, SizeHelper, SystemValueHelper, TruncateDateTimeHelper

public abstract class HandlebarsHelper<T> extends Object implements com.github.jknack.handlebars.Helper<T>
This abstract class is the base for all defined Handlebars helper in wiremock. It basically allows simpler error handling.
  • Field Details

  • Constructor Details

    • HandlebarsHelper

      public HandlebarsHelper()
  • Method Details

    • handleError

      protected String handleError(String message)
      Handle invalid helper data without exception details or because none was thrown.
      Parameters:
      message - message to log and return
      Returns:
      a message which will be used as content
    • handleError

      protected String handleError(String message, Throwable cause)
      Handle invalid helper data with exception details in the log message.
      Parameters:
      message - message to log and return
      cause - which occurred during application of the helper
      Returns:
      a message which will be used as content
    • handleError

      protected String handleError(String message, String logExclusive, Throwable cause)
      Handle invalid helper data with exception details in the log message. Also additional information regarding the issue is written in the logs.
      Parameters:
      message - message to log and return
      logExclusive - additional information just for the log
      cause - which occured during application of the helper
      Returns:
      a message which will be used as content
    • getRenderCache

      protected static RenderCache getRenderCache(com.github.jknack.handlebars.Options options)