Skip to content

Commit

Permalink
docs: add testing section to Readme
Browse files Browse the repository at this point in the history
  • Loading branch information
vkrizan committed Dec 14, 2023
1 parent 0912984 commit 48cd6ac
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,41 @@ A header `TotalCount` returns the total number of policies.
curl -Hx-rh-identity:`cat src/test/resources/rhid.txt` http://localhost:8080/api/policies/v1.0/facts
----

=== Testing


To run unit and integration tests use:
[source,shell]
----
./mvnw test
----

==== Testing with Podman

The project uses testcontainers utility to provide supporting services, such as database.

To use testcontainers with Podman, first enable podman's socket:

[source,shell]
----
systemctl --user enable --now podman.socket
----

and (on some systems) set:
[source,shell]
----
export DOCKER_HOST=unix://${XDG_RUNTIME_DIR}/podman/podman.sock
----

It is recommended to turn off RYUK container, as it is not supported by Podman:
[source,shell]
----
export TESTCONTAINERS_RYUK_DISABLED=true
----

See also https://java.testcontainers.org/supported_docker_environment/#podman.


=== Validating (and storing) a policy

A POST to the /policies endpoint validates and potentially stores a passed policy.
Expand Down

0 comments on commit 48cd6ac

Please sign in to comment.