use of org.folio.oaipmh.Constants.REPOSITORY_STORAGE in project mod-oai-pmh by folio-org.
the class OaiPmhImplTest method setUpOnce.
@BeforeAll
void setUpOnce(Vertx vertx, VertxTestContext testContext) throws Exception {
resetSystemProperties();
VertxOptions options = new VertxOptions();
options.setBlockedThreadCheckInterval(1000 * 60 * 60);
System.setProperty(REPOSITORY_STORAGE, SOURCE_RECORD_STORAGE);
logger.info("Test setup starting for " + ModuleName.getModuleName());
PostgresClient.setPostgresTester(new PostgresTesterContainer());
PostgresClient.getInstance(vertx, OAI_TEST_TENANT).startPostgresTester();
TestUtil.initializeTestContainerDbSchema(vertx, OAI_TEST_TENANT);
RestAssured.baseURI = "http://localhost:" + okapiPort;
RestAssured.port = okapiPort;
RestAssured.enableLoggingOfRequestAndResponseIfValidationFails();
JsonObject conf = new JsonObject().put("http.port", okapiPort);
logger.info(format("mod-oai-pmh test: Deploying %s with %s", RestVerticle.class.getName(), Json.encode(conf)));
DeploymentOptions opt = new DeploymentOptions().setConfig(conf);
WebClientProvider.init(vertx);
vertx.deployVerticle(RestVerticle.class.getName(), opt, testContext.succeeding(id -> {
idleTimeout = System.getProperty(REPOSITORY_SRS_CLIENT_IDLE_TIMEOUT_SEC);
System.setProperty(REPOSITORY_SRS_CLIENT_IDLE_TIMEOUT_SEC, "1");
Context context = vertx.getOrCreateContext();
SpringContextUtil.init(vertx, context, ApplicationConfig.class);
SpringContextUtil.autowireDependencies(this, context);
logger.info("mod-oai-pmh Test: setup done. Using port " + okapiPort);
// Once MockServer starts, it indicates to junit that process is finished by calling context.completeNow()
new OkapiMockServer(vertx, mockPort).start(testContext);
}));
setupPredicates();
}
Aggregations