cyberark/conjur-api-java

Unit tests exist for each class

Opened this issue · 0 comments

Is your feature request related to a problem? Please describe.

Currently, tests are built for an end-to-end environment. There are four JUnit
tests located within the Java classpath, which require external setup and teardown.

Describe the solution you would like

A unit test is written for each individual method in each class for the Conjur Java API.
This includes:

  • Mocking framework for tests that require complex input
  • JUnit superclass's setUp() and tearDown() methods for shared resources
  • All tests should be runnable "offline", or piecemeal, quickly
  • The existing bin/test.sh script becomes bin/run-integration.sh, and a new script called bin/run-unit.sh is created to easily run the new tests
  • Integration tests (the four currently existing) are moved to their own Class and are only run when specified, rather than part of the standard unit test suite.

Additional context

To run existing tests, run ./bin/test.sh. This will create a Conjur environment and export variables required for the
existing tests.