Commit 99e7be14 authored by luc chatty's avatar luc chatty

PATREG-33 | deployed tests

parent a02c4e56
......@@ -201,7 +201,7 @@
<execution>
<id>drop-db-before-test-if-any</id>
<phase>generate-test-resources</phase>
<phase>pre-integration-test</phase>
<goals>
<goal>execute</goal>
</goals>
......@@ -217,7 +217,7 @@
<execution>
<id>create-db-before-test</id>
<phase>generate-test-resources</phase>
<phase>pre-integration-test</phase>
<goals>
<goal>execute</goal>
</goals>
......@@ -233,7 +233,7 @@
<execution>
<id>create-user-before-test</id>
<phase>generate-test-resources</phase>
<phase>pre-integration-test</phase>
<goals>
<goal>execute</goal>
</goals>
......@@ -241,7 +241,23 @@
<!-- need another database to drop the targeted one -->
<url>jdbc:postgresql://${postgresql.host}:${postgresql.port}/${postgresql.gazelle.name}</url>
<autocommit>true</autocommit>
<sqlCommand>create user gazelle with password '${postgresql.gazelle.password}'</sqlCommand>
<sqlCommand>create user ${postgresql.gazelle.login} with password '${postgresql.gazelle.password}'</sqlCommand>
<!-- ignore error when database is not avaiable -->
<onError>continue</onError>
</configuration>
</execution>
<execution>
<id>change-user-before-test</id>
<phase>pre-integration-test</phase>
<goals>
<goal>execute</goal>
</goals>
<configuration>
<!-- need another database to drop the targeted one -->
<url>jdbc:postgresql://${postgresql.host}:${postgresql.port}/${postgresql.root.login}</url>
<autocommit>true</autocommit>
<sqlCommand>ALTER DATABASE "${postgresql.gazelle.name}" OWNER TO ${postgresql.gazelle.login}</sqlCommand>
<!-- ignore error when database is not avaiable -->
<onError>continue</onError>
</configuration>
......@@ -249,7 +265,7 @@
<execution>
<id>create-schema</id>
<phase>generate-test-resources</phase>
<phase>pre-integration-test</phase>
<goals>
<goal>execute</goal>
</goals>
......@@ -268,7 +284,8 @@
<artifactId>wildfly-maven-plugin</artifactId>
<version>2.1.0.Beta1</version>
<configuration>
<jboss-home>${env.JBOSS_HOME}</jboss-home>
<jboss-home>${env.JBOSS_HOME}</jboss-home>
<startupTimeout>300</startupTimeout>
</configuration>
<executions>
<execution>
......@@ -308,7 +325,7 @@
<goal>deploy</goal>
</goals>
<configuration>
<filename>patient-registry-${project.version}-jar-with-dependencies.jar</filename>
<filename>patient-registry-${project.version}.jar</filename>
<runtimeName>patient-registry.jar</runtimeName>
</configuration>
</execution>
......
......@@ -22,10 +22,7 @@ import java.net.URL;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
import static org.junit.jupiter.api.Assertions.*;
......@@ -73,13 +70,12 @@ public class SearchExecutionStepDefinition {
public void the_following_patients_exist(List<Map<String, String>> patientDataList) throws ParseException {
for (Map<String, String> patientData : patientDataList) {
Patient patient = new Patient();
patient.setUuid(patientData.get("tmpuuid"));
patient.setUuid(patientData.get("tmpuuid"));
patient.setGender(GenderCode.valueOf(patientData.get("gender")));
patient.setActive(Boolean.valueOf(patientData.get("active")));
patient.setDateOfBirth(dateFormat.parse(patientData.get("dateOfBirth")));
patient.setDateOfDeath(dateFormat.parse(patientData.get("dateOfDeath")));
patient.setMultipleBirthOrder(Integer.valueOf(patientData.get("multipleBirthOrder")));
existingPatients.add(patient);
}
}
......@@ -116,7 +112,11 @@ public class SearchExecutionStepDefinition {
public void patient_is_fed_with_uuid(String uuid) throws PatientFeedException {
Patient patient = getExistingPatientWithUUID(uuid);
if (patient != null) {
uuidOfFedPatients.put(uuid, patientFeedClient.feedPatient(patient));
try {
String realUuid = patientFeedClient.feedPatient(patient);
uuidOfFedPatients.put(uuid, realUuid);
} catch (PatientFeedException ignored) {
}
} else {
throw new IllegalArgumentException(String.format("No patient existing with UUID %s !", uuid));
}
......
......@@ -6,8 +6,8 @@ Feature: Feed Patient information
| tmpuuid0 | MALE | true | 1984-03-12T17:25:04.017+0100 | 2020-03-12T17:25:04.017+0100 | 134 |
And patients have the following identifiers
| tmpuuid | systemIdentifier | value | systemName | type |
| tmpuuid0 | urn:oid:1.2.3.4 | identifier42 | system1 | PI |
| tmpuuid0 | urn:oid:5.6.7.8 | identifier42 | system2 | PI |
| tmpuuid0 | urn:oid:1.2.3.5 | identifier42 | system0 | PI |
| tmpuuid0 | urn:oid:5.6.7.9 | identifier42 | system2 | PI |
And patients have the following names
| tmpuuid | family | given1 | given2 | given3 |
| tmpuuid0 | Bars | Alain | Hilary | Didier |
......
......@@ -3,19 +3,19 @@ Feature: Search Patient information
Background:
Given the following patients exist
| tmpuuid | gender | active | dateOfBirth | dateOfDeath | multipleBirthOrder |
| tmpuuid0 | MALE | true | 1984-03-12T17:25:04.017+0100 | 2020-03-12T17:25:04.017+0100 | 134 |
| tmpuuid | MALE | true | 1984-03-12T17:25:04.017+0100 | 2020-03-12T17:25:04.017+0100 | 134 |
| tmpuuid1 | FEMALE | true | 1984-03-12T17:25:04.017+0100 | 2020-03-12T17:25:04.017+0100 | 134 |
| tmpuuid2 | FEMALE | true | 2019-01-19T17:25:04.017+0100 | 2020-08-28T17:25:04.017+0100 | 134 |
| tmpuuid3 | MALE | false | 1984-09-29T17:25:04.017+0100 | 2020-03-12T17:15:04.017+0100 | 134 |
And patients have the following identifiers
| tmpuuid | systemIdentifier | value | systemName | type |
| tmpuuid0 | urn:oid:1.2.3.4 | identifier0 | system0 | PI |
| tmpuuid0 | urn:oid:5.6.7.8 | identifier0 | system0 | PI |
| tmpuuid1 | urn:oid:1.2.3.4 | identifier1 | system1 | PI |
| tmpuuid2 | urn:oid:1.2.3.4 | identifier2 | system2 | PI |
| tmpuuid | urn:oid:1.2.3.4 | identifier0 | system0 | PI |
| tmpuuid | urn:oid:5.6.7.8 | identifier0 | system2 | PI |
| tmpuuid1 | urn:oid:1.2.3.4 | identifier1 | system0 | PI |
| tmpuuid2 | urn:oid:1.2.3.4 | identifier2 | system0 | PI |
| tmpuuid3 | urn:oid:1.2.3.5 | identifier3 | system3 | PI |
| tmpuuid3 | urn:oid:9.8.7.6 | identifier0 | system4 | PI |
And patient is fed with provisional uuid "tmpuuid0"
And patient is fed with provisional uuid "tmpuuid"
And patient is fed with provisional uuid "tmpuuid1"
And patient is fed with provisional uuid "tmpuuid2"
And patient is fed with provisional uuid "tmpuuid3"
......@@ -29,7 +29,6 @@ Feature: Search Patient information
Examples: Simple cases
| parameter | verb | value | resultSize |
| tmpuuid | is | tmpuuid0 | 1 |
| tmpuuid | is | tmpuuid1 | 1 |
| uuid | is | uuid123 | 0 |
| identifier.systemIdentifier | is | urn:oid:1.2.3.4 | 3 |
......
......@@ -68,7 +68,7 @@
<fork>true</fork>
<source>${java.version}</source>
<target>${java.version}</target>
<compilerArgument>-proc:none</compilerArgument>
<compilerArgument>-proc:none</compilerArgument>
</configuration>
</plugin>
<plugin>
......@@ -270,7 +270,7 @@
<dependency>
<groupId>net.ihe.gazelle</groupId>
<artifactId>lib.gitb-processing-client</artifactId>
<version>1.0.0</version>
<version>1.0.1</version>
</dependency>
<dependency>
<groupId>net.ihe.gazelle</groupId>
......@@ -287,7 +287,7 @@
<dependency>
<groupId>net.ihe.gazelle</groupId>
<artifactId>lib.gitb-utils</artifactId>
<version>1.0.0</version>
<version>1.0.1</version>
</dependency>
<dependency>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment