Class DslUtils


  • public class DslUtils
    extends java.lang.Object
    Contains static methods to make DSL more readable.

    Author:
    Erhan Bagdemir
    • Field Detail

      • DEFAULT_RESULT_OBJ

        public static final java.lang.String DEFAULT_RESULT_OBJ
        See Also:
        Constant Field Values
    • Method Detail

      • ifStatusCode

        public static java.util.function.Predicate<UserSession> ifStatusCode​(int statusCode)
        Used as predicate to conditional DSL components:
           until(ifStatusCode(200), http("Request"));
         

        Default session key for expected Http response is "result".

        Parameters:
        statusCode - Status code of the Http Response.
        Returns:
        Predicate instance.
      • wait

        public static LoadDsl wait​(java.time.Duration duration)
      • ensure

        public static LoadDsl ensure​(java.util.function.Predicate<UserSession> predicate)
      • ensure

        public static LoadDsl ensure​(java.util.function.Predicate<UserSession> predicate,
                                     java.lang.String reason)
      • session

        public static LoadDsl session​(java.lang.String sessionKey,
                                      java.util.function.Supplier<java.lang.Object> objectSupplier)
      • forEach

        public static <E,​R extends java.lang.Iterable<E>> LoadDsl forEach​(java.lang.String name,
                                                                                ForEachBuilder<E,​R> forEachBuilder)
      • filter

        public static LoadDsl filter​(java.util.function.Predicate<UserSession> predicate)
      • http

        public static HttpConfigDsl http​(java.lang.String name)
        Static factory method to create a new HttpDsl instance.
        Parameters:
        name - Measurement point name.
        Returns:
        A new instance of MaterializableDslItem.
      • some

        public static SomeDsl some​(java.lang.String name)