Package strikt.jackson

Methods

fun <T : JsonNode> Builder.has(fieldName: String): Builder

Asserts that the subject node has a field named fieldName.

Parameters:
  • fieldName: String
fun <T : JsonNode> Builder.path(fieldName: String): Builder

Maps the subject node of the assertion builder to the node accessed by fieldName.

Parameters:
  • fieldName: String
fun <T : JsonNode> Builder.isObject(): Builder

Asserts that the subject node is a JSON object.

Parameters:
  • No parameters
fun <T : JsonNode> Builder.isArray(): Builder

Asserts that the subject node is a JSON array.

Parameters:
  • No parameters
fun <T : JsonNode> Builder.isTextual(): Builder

Asserts that the subject node is a JSON text node.

Parameters:
  • No parameters
fun <T : JsonNode> Builder.isNumber(): Builder

Asserts that the subject node is a JSON numeric node.

Parameters:
  • No parameters
fun <T : JsonNode> Builder.isBoolean(): Builder

Asserts that the subject node is a JSON boolean node.

Parameters:
  • No parameters
fun <T : JsonNode> Builder.isMissing(): Builder

Asserts that the subject node is a JSON missing node.

Parameters:
  • No parameters
fun <T : JsonNode> Builder.textValue(): Builder

Maps the assertion to an assertion on the subject node's text value.

Be aware that if the node is not a text node this will map to an assertion on null.

Parameters:
  • No parameters
fun <T : JsonNode> Builder.numberValue(): Builder

Maps the assertion to an assertion on the subject node's number value.

Be aware that if the node is not a numeric node this will map to an assertion on null.

Parameters:
  • No parameters
fun <T : JsonNode> Builder.booleanValue(): Builder

Maps the assertion to an assertion on the subject node's boolean value.

Be aware that if the node is not a boolean node this will map to an assertion on false.

Parameters:
  • No parameters
fun <T : JsonNode> Builder.hasNodeType(nodeType: JsonNodeType): Builder

Asserts that the subject node's JsonNode.getNodeType method returns nodeType.

Convenient aliases for this assertion exist for common node types that also narrow the subject type of the resulting assertion builder.

Parameters:
  • nodeType: JsonNodeType