All Downloads are FREE. Search and download functionalities are using the official Maven repository.

jio.test.pbt.FailureContext Maven / Gradle / Ivy

Go to download

JIO test library based on Property Based Testing and Java Flight Recording Debuggers

There is a newer version: 3.0.0-RC2
Show newest version
package jio.test.pbt;


import jsonvalues.JsObj;
import jsonvalues.JsStr;

/**
 * Represents information related to a failure that occurred during the execution of a specific test.
 *
 * @param context The context of the failure.
 * @param failure The failure.
 */
public record FailureContext(Context context,
                             TestFailure failure
) {

  /**
   * Serializes this record into a JSON object. The JSON schema is as follows:
   *
   * 
   *     {@code
   *     {
   *         "context": JsObj (see Context#toJson()),
   *         "reason": String (the reason for the failure)
   *     }
   *     }
   * 
* * @return A JSON representation of the failure context. * @see Context#toJson() */ public JsObj toJson() { return JsObj.of("context", context.toJson(), "reason", JsStr.of(failure.getMessage()) ); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy