Class FieldMatcher

java.lang.Object
kong.unirest.core.FieldMatcher
All Implemented Interfaces:
BodyMatcher

public class FieldMatcher extends Object implements BodyMatcher
Matches simple form fields
  • Field Details

  • Constructor Details

    • FieldMatcher

      public FieldMatcher(Map<String,String> formParams)
      Creates a FieldMatcher expecting a map of keys and values
      Parameters:
      formParams - the map of field params
  • Method Details

    • of

      public static FieldMatcher of(String... keyValuePairs)
      Creates a FieldMatcher expecting a map of keys and values use like: FieldMatcher.of("fruit", "orange", "quantity" "42")
      Parameters:
      keyValuePairs - an array of key-value pairs to expect
      Returns:
      a new FieldMatcher
    • matches

      public MatchStatus matches(List<String> body) throws AssertionError
      Description copied from interface: BodyMatcher
      indicates if the Matcher succeeded in matching the body
      Specified by:
      matches in interface BodyMatcher
      Parameters:
      body - the list of body parts
      Returns:
      MatchStatus indicating if the Matcher succeeded in matching the body
      Throws:
      AssertionError
    • description

      private String description(boolean pass, List<String> missing)
    • mapOf

      private static <K, V> Map<K,V> mapOf(Object... keyValues)