Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »


This page is a work in progress.

This page is a work in progress. This info box will be removed once complete.

Postgres Repositories Unit tests


Units tests have been defined that unit test the Postgres repository package org.opensrp.repository.postgres. The repositories unit tests are in the package org.opensrp.repository.postgres
The unit tests use Junit for unit testing and test for various scenarios for each method in the respective repository class being tested. Each of the test extend the class org.opensrp.repository.postgres.BaseRepositoryTest. This class defines tow methods

  • populateDatabase method that cleans and populates the database with seed data before the test starts. Its annotated with Junit  annotation @Before and this runs before each test.
  • getDatabaseScripts abstract method which returns a set of string. Each test must implement this method, the set returned by the implementation should have a set of sql files to be executed before starting each test.


The tests use the seed data in the folder opensrp-core/src/test/resources/test-scripts/. Each script clears any existing data and then populates the test data.

Services Integration Tests

  • No labels