Skip to main content
Redhat Developers  Logo
  • AI

    Get started with AI

    • Red Hat AI
      Accelerate the development and deployment of enterprise AI solutions.
    • AI learning hub
      Explore learning materials and tools, organized by task.
    • AI interactive demos
      Click through scenarios with Red Hat AI, including training LLMs and more.
    • AI/ML learning paths
      Expand your OpenShift AI knowledge using these learning resources.
    • AI quickstarts
      Focused AI use cases designed for fast deployment on Red Hat AI platforms.
    • No-cost AI training
      Foundational Red Hat AI training.

    Featured resources

    • OpenShift AI learning
    • Open source AI for developers
    • AI product application development
    • Open source-powered AI/ML for hybrid cloud
    • AI and Node.js cheat sheet

    Red Hat AI Factory with NVIDIA

    • Red Hat AI Factory with NVIDIA is a co-engineered, enterprise-grade AI solution for building, deploying, and managing AI at scale across hybrid cloud environments.
    • Explore the solution
  • Learn

    Self-guided

    • Documentation
      Find answers, get step-by-step guidance, and learn how to use Red Hat products.
    • Learning paths
      Explore curated walkthroughs for common development tasks.
    • Guided learning
      Receive custom learning paths powered by our AI assistant.
    • See all learning

    Hands-on

    • Developer Sandbox
      Spin up Red Hat's products and technologies without setup or configuration.
    • Interactive labs
      Learn by doing in these hands-on, browser-based experiences.
    • Interactive demos
      Click through product features in these guided tours.

    Browse by topic

    • AI/ML
    • Automation
    • Java
    • Kubernetes
    • Linux
    • See all topics

    Training & certifications

    • Courses and exams
    • Certifications
    • Skills assessments
    • Red Hat Academy
    • Learning subscription
    • Explore training
  • Build

    Get started

    • Red Hat build of Podman Desktop
      A downloadable, local development hub to experiment with our products and builds.
    • Developer Sandbox
      Spin up Red Hat's products and technologies without setup or configuration.

    Download products

    • Access product downloads to start building and testing right away.
    • Red Hat Enterprise Linux
    • Red Hat AI
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products

    Featured

    • Red Hat build of OpenJDK
    • Red Hat JBoss Enterprise Application Platform
    • Red Hat OpenShift Dev Spaces
    • Red Hat Developer Toolset

    References

    • E-books
    • Documentation
    • Cheat sheets
    • Architecture center
  • Community

    Get involved

    • Events
    • Live AI events
    • Red Hat Summit
    • Red Hat Accelerators
    • Community discussions

    Follow along

    • Articles & blogs
    • Developer newsletter
    • Videos
    • Github

    Get help

    • Customer service
    • Customer support
    • Regional contacts
    • Find a partner

    Join the Red Hat Developer program

    • Download Red Hat products and project builds, access support documentation, learning content, and more.
    • Explore the benefits

Automated API testing for the KIE Server

May 1, 2020
Juliano Mohr
Related topics:
ContainersDeveloper toolsDevOpsMicroservices

    In software development, much has been said about testing and there are many ways to think about it. In the context of agility and DevOps, automated testing is considered a foundation for the principles of flow and fast feedback. Considering the implementation of jBPM and Drools within a software delivery project, it becomes natural to think about how to support reliable automated testing for both stages of development and continuous integration.

    The KIE Server is a standalone component that can be used to execute business processes and rules via a REST API interface. This article explores the concept of API testing where consumers are expected to interact with the APIs provided by the KIE Server. The test cases consist of HTTP requests and responses exchanged against a live server. Consequently, these test cases are completely agnostic to the technology behind the API, just like real consumers are expected to be.

    Why API testing?

    The API testing approach was previously described as agnostic, but what does that mean? Perhaps it's worth explaining by listing the benefits:

    • Tests are decoupled from changes in the system under test as long as the API contract is satisfied.
    • Higher confidence, as tests assert on exact upstream expectations.
    • Independence, as tests can be maintained as a separate artifact.
    • Scalability, as tests can be adapted to also assess performance.

    What about unit testing?

    Yes, unit testing is important and should not be neglected. There are well-established techniques in the jBPM and Drools ecosystem to unit test knowledge assets. Such techniques usually comprise of either plain JUnit or the test scenarios offered by Business Central (aka The Workbench).

    However, there are challenges that unit tests cannot address, especially if JUnit is not an option for your project. In that case, you are limited to only what Business Central offers:

    • Testing rule flows, where the combination of rules fired must be taken into account.
    • Testing transformations that occur with the input and output of the REST API.
    • Writing API testing even with no Java or JUnit skills.
    • Testing API performance (did I mention performance testing already?)

    Having said that, it is well known that unit tests are faster and simpler to write, maintain, and troubleshoot. Therefore, one should favor them whenever possible.

    Example implementation with Postman and containers

    If you read along to this point you must be looking for something concrete. Before we get started, Figure 1 illustrates what follows later.

    Automated API Testing for the KIE Server
    Automated API Testing for the KIE Server
    Figure 1: The example implementation.">

    Postman is a popular tool for creating and executing HTTP requests. Walking through the diagram, notice that Postman is a core component in this implementation. With it, developers write test cases that are grouped into collections and later exported to a native JSON format. This exported JSON collection is then used as an input to Newman, which is a powerful command-line collection runner for Postman. It allows you to run and test a Postman collection directly from the command line.

    The system we are testing is Red Hat JBoss Enterprise Application Platform running the KIE Server, which has the KJAR deployed.

    Finally, both Newman and JBoss / KIE Server are bootstrapped in Linux containers. This setup particularly enables:

    • Fast provisioning of components.
    • No need to worry about dependencies (NodeJS, Java, etc).
    • No difference when executed local or in the CI agent (e.g. Jenkins).

    Experiment

    In this example, docker and docker-compose are used to simplify the user experience. They are, together with Git, the only pre-requisites to running through the steps:

    $ git clone https://github.com/juliaaano/rhdm-quickstart.git && cd rhdm-quickstart 
    $ docker-compose up --detach --force-recreate rhdm-jboss

    Check the logs and wait for KIE Server to startup:

    $ docker-compose logs --follow rhdm-jboss

    Run the postman tests:

    $ docker-compose run --rm postman

    Notice it is possible to launch and build the containers directly with other tools such as Podman, Buildah, and Docker itself.

    You can also build the container image locally, which is useful if you made any changes to the source code. This process takes a bit longer, especially in the first run when there is no Docker cache on disk. Additionally, authentication is required with Red Hat's container registry to access the base image:

    $ docker login registry.redhat.io
    $ docker build --file d.jboss.Dockerfile --tag juliaaano/rhdm-jboss .

    Once a new image is built, repeat the step:

    $ docker-compose up --detach --force-recreate rhdm-jboss

    In the GitHub project you just checked out, there are instructions for how to run the same app with Spring Boot instead of JBoss EAP. Look over the project's README for more information.

    The example above features a business rules application, so business processes are left aside. However, the elements demonstrated there should not change and are also applicable to jBPM. KIE-Server and Business Central are integral parts of the Red Hat Decision Manager (RHDM) and Red Hat Process Automation Manager (RHPAM) platforms.

    Last updated: June 26, 2020

    Recent Posts

    • Trusted software factory: Building trust in the agentic AI era

    • Build a zero trust AI pipeline with OpenShift and RHEL CVMs

    • Red Hat Hardened Images: Top 5 benefits for software developers

    • How EvalHub manages two-layer Kubernetes control planes

    • Tekton joins the CNCF as an incubating project

    Red Hat Developers logo LinkedIn YouTube Twitter Facebook

    Platforms

    • Red Hat AI
    • Red Hat Enterprise Linux
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products

    Build

    • Developer Sandbox
    • Developer tools
    • Interactive tutorials
    • API catalog

    Quicklinks

    • Learning resources
    • E-books
    • Cheat sheets
    • Blog
    • Events
    • Newsletter

    Communicate

    • About us
    • Contact sales
    • Find a partner
    • Report a website issue
    • Site status dashboard
    • Report a security problem

    RED HAT DEVELOPER

    Build here. Go anywhere.

    We serve the builders. The problem solvers who create careers with code.

    Join us if you’re a developer, software engineer, web designer, front-end designer, UX designer, computer scientist, architect, tester, product manager, project manager or team lead.

    Sign me up

    Red Hat legal and privacy links

    • About Red Hat
    • Jobs
    • Events
    • Locations
    • Contact Red Hat
    • Red Hat Blog
    • Inclusion at Red Hat
    • Cool Stuff Store
    • Red Hat Summit
    © 2026 Red Hat

    Red Hat legal and privacy links

    • Privacy statement
    • Terms of use
    • All policies and guidelines
    • Digital accessibility

    Chat Support

    Please log in with your Red Hat account to access chat support.