Skip to content
Snippets Groups Projects
Unverified Commit e023834c authored by Martin Weise's avatar Martin Weise
Browse files

Fixed the tests after ~8h

parent c65150f0
No related branches found
No related tags found
2 merge requests!163Relase 1.3.0,!159Large update
Showing
with 3 additions and 78 deletions
......@@ -10,7 +10,7 @@ spring.cloud.config.enabled=false
# internal datasource
# spring 6 fix https://github.com/h2database/h2database/issues/3363
spring.datasource.url=jdbc:h2:mem:testdb;NON_KEYWORDS=VALUE;DATABASE_TO_UPPER=false;DB_CLOSE_ON_EXIT=FALSE;INIT=RUNSCRIPT FROM './src/test/resources/schema.sql'
spring.datasource.url=jdbc:h2:mem:testdb;NON_KEYWORDS=VALUE,KEY;DB_CLOSE_ON_EXIT=FALSE;INIT=CREATE SCHEMA IF NOT EXISTS FDA
spring.datasource.driverClassName=org.h2.Driver
spring.datasource.username=sa
spring.datasource.password=password
......
CREATE SCHEMA IF NOT EXISTS `fda`;
SET SCHEMA `fda`;
DROP TABLE IF EXISTS fda.mdb_concepts;
CREATE TABLE IF NOT EXISTS fda.mdb_concepts
(
uri VARCHAR(500) not null,
name VARCHAR(255),
created timestamp NOT NULL DEFAULT NOW(),
created_by bigint,
PRIMARY KEY (uri)
);
DROP TABLE IF EXISTS fda.mdb_units;
CREATE TABLE IF NOT EXISTS fda.mdb_units
(
uri VARCHAR(500) not null,
name VARCHAR(255),
created timestamp NOT NULL DEFAULT NOW(),
created_by bigint,
PRIMARY KEY (uri)
);
-- Modified for H2
-- Assume id=1 is invalid
-- Assume id=2 is still valid token
-- CREATE VIEW IF NOT EXISTS fda.mdb_invalid_tokens AS
-- (SELECT `id`, `token_hash`, `creator`, `created`, `expires`, `last_used` FROM fda.`mdb_tokens` WHERE `id` = 1);
\ No newline at end of file
......@@ -75,7 +75,6 @@ public class TableEndpointIntegrationTest extends BaseUnitTest {
/* create network */
DockerConfig.createAllNetworks();
/* metadata database */
h2Utils.runScript("schema.sql");
imageRepository.save(IMAGE_1);
realmRepository.save(REALM_DBREPO);
userRepository.save(USER_1_SIMPLE);
......
......@@ -92,7 +92,6 @@ public class TableServiceIntegrationReadTest extends BaseUnitTest {
@BeforeEach
public void beforeEach() {
h2Utils.runScript("schema.sql");
imageRepository.save(IMAGE_1);
realmRepository.save(REALM_DBREPO);
userRepository.save(USER_1_SIMPLE);
......
......@@ -92,7 +92,6 @@ public class TableServiceIntegrationWriteTest extends BaseUnitTest {
DockerConfig.createContainer(BIND_WEATHER, CONTAINER_1, CONTAINER_1_ENV);
DockerConfig.startContainer(CONTAINER_1);
/* metadata database */
h2Utils.runScript("schema.sql");
imageRepository.save(IMAGE_1);
realmRepository.save(REALM_DBREPO);
userRepository.save(USER_1_SIMPLE);
......
......@@ -10,7 +10,7 @@ spring.cloud.config.enabled=false
# internal datasource
# spring 6 fix https://github.com/h2database/h2database/issues/3363
spring.datasource.url=jdbc:h2:mem:testdb;NON_KEYWORDS=VALUE;DATABASE_TO_UPPER=false;DB_CLOSE_ON_EXIT=FALSE;INIT=RUNSCRIPT FROM 'classpath:schema.sql'
spring.datasource.url=jdbc:h2:mem:testdb;NON_KEYWORDS=VALUE,KEY;DB_CLOSE_ON_EXIT=FALSE;INIT=CREATE SCHEMA IF NOT EXISTS FDA
spring.datasource.driverClassName=org.h2.Driver
spring.datasource.username=sa
spring.datasource.password=password
......
CREATE SCHEMA IF NOT EXISTS `fda`;
SET SCHEMA `fda`;
DROP TABLE IF EXISTS fda.mdb_concepts;
CREATE TABLE fda.mdb_concepts
(
uri VARCHAR(500) not null,
name VARCHAR(255),
created timestamp NOT NULL DEFAULT NOW(),
created_by bigint,
PRIMARY KEY (uri)
);
DROP TABLE IF EXISTS fda.mdb_units;
CREATE TABLE fda.mdb_units
(
uri VARCHAR(500) not null,
name VARCHAR(255),
created timestamp NOT NULL DEFAULT NOW(),
created_by bigint,
PRIMARY KEY (uri)
);
\ No newline at end of file
......@@ -5,7 +5,6 @@ import io.swagger.v3.oas.annotations.enums.SecuritySchemeType;
import io.swagger.v3.oas.annotations.security.SecurityScheme;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.HttpMethod;
import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
......
......@@ -10,7 +10,7 @@ spring.cloud.config.enabled=false
# internal datasource
# spring 6 fix https://github.com/h2database/h2database/issues/3363
spring.datasource.url=jdbc:h2:mem:testdb;NON_KEYWORDS=VALUE;DATABASE_TO_UPPER=false;DB_CLOSE_ON_EXIT=FALSE;INIT=RUNSCRIPT FROM './src/test/resources/schema.sql'
spring.datasource.url=jdbc:h2:mem:testdb;NON_KEYWORDS=VALUE,KEY;DB_CLOSE_ON_EXIT=FALSE;INIT=CREATE SCHEMA IF NOT EXISTS FDA
spring.datasource.driverClassName=org.h2.Driver
spring.datasource.username=sa
spring.datasource.password=password
......
CREATE SCHEMA IF NOT EXISTS `fda`;
SET SCHEMA `fda`;
DROP TABLE IF EXISTS fda.mdb_concepts;
CREATE TABLE IF NOT EXISTS fda.mdb_concepts
(
uri VARCHAR(500) not null,
name VARCHAR(255),
created timestamp NOT NULL DEFAULT NOW(),
created_by bigint,
PRIMARY KEY (uri)
);
DROP TABLE IF EXISTS fda.mdb_units;
CREATE TABLE IF NOT EXISTS fda.mdb_units
(
uri VARCHAR(500) not null,
name VARCHAR(255),
created timestamp NOT NULL DEFAULT NOW(),
created_by bigint,
PRIMARY KEY (uri)
);
-- Modified for H2
-- Assume id=1 is invalid
-- Assume id=2 is still valid token
-- CREATE VIEW IF NOT EXISTS fda.mdb_invalid_tokens AS
-- (SELECT `id`, `token_hash`, `creator`, `created`, `expires`, `last_used` FROM fda.`mdb_tokens` WHERE `id` = 1);
\ No newline at end of file
......@@ -5,7 +5,6 @@ import io.swagger.v3.oas.annotations.enums.SecuritySchemeType;
import io.swagger.v3.oas.annotations.security.SecurityScheme;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.HttpMethod;
import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment