code: private void validateCommandResult(KubernetesCommand command, TestContext context) {
          if (log.isDebugEnabled()) {
              log.debug("Starting Kubernetes command result validation");
          }
  
          CommandResult<?> result = command.getCommandResult();
          if (StringUtils.hasText(commandResult) || !CollectionUtils.isEmpty(commandResultExpressions)) {
              if (result == null) {
                  throw new ValidationException("Missing Kubernetes command result");
              }
  
              try {
                  String commandResultJson = kubernetesClient.getEndpointConfiguration()
                          .getObjectMapper().writeValueAsString(result);
                  if (StringUtils.hasText(commandResult)) {
                      jsonTextMessageValidator.validateMessage(new DefaultMessage(commandResultJson), new DefaultMessage(commandResult), context, new JsonMessageValidationContext());
                      log.info("Kubernetes command result validation successful - all values OK!");
                  }
  
                  if (!CollectionUtils.isEmpty(commandResultExpressions)) {
                      JsonPathMessageValidationContext validationContext = new JsonPathMessageValidationContext();
                      validationContext.setJsonPathExpressions(commandResultExpressions);
                      jsonPathMessageValidator.validateMessage(new DefaultMessage(commandResultJson), new DefaultMessage(commandResult), context, validationContext);
                      log.info("Kubernetes command result path validation successful - all values OK!");
                  }
              } catch (JsonProcessingException e) {
                  throw new CitrusRuntimeException(e);
              }
          }
  
          if (command.getResultCallback() != null && result != null) {
              command.getResultCallback().validateCommandResult(result, context);
          }
      }
docs: Validate command results.
  @param command
  @param context