Commit e9e8126c authored by Matija Obreza's avatar Matija Obreza

Merge branch 'swagger-xml-problems' into 'master'

Swagger XML

Closes #4, #19, #15, #9, #20, and #22

See merge request !14
parents ac78d449 ec799b54
......@@ -7,7 +7,7 @@ run tests in branches:
image: maven:3-jdk-8
script:
- echo "Using username ${GLIS_USERNAME} for authentication against https://glistest.planttreaty.org"
- MAVEN_OPTS="${MAVEN_OPTS} -Dorg.slf4j.simpleLogger.defaultLogLevel=warn" mvn test -B -DskipTests=false
- MAVEN_OPTS="${MAVEN_OPTS} -Dorg.slf4j.simpleLogger.defaultLogLevel=warn" mvn test -B -U -DskipTests=false
except:
- master
- tags
......@@ -20,7 +20,7 @@ publish snapshot artifacts:
- gpg --list-keys
script:
- echo "Using username ${GLIS_USERNAME} for authentication against https://glistest.planttreaty.org"
- MAVEN_OPTS="${MAVEN_OPTS} -Dorg.slf4j.simpleLogger.defaultLogLevel=warn" mvn clean deploy --settings .ci-maven-settings.xml -B -U -DskipTests=false
- MAVEN_OPTS="${MAVEN_OPTS} -Dorg.slf4j.simpleLogger.defaultLogLevel=warn" mvn clean deploy -B -U --settings .ci-maven-settings.xml -B -U -DskipTests=false
only:
- master
......
......@@ -152,27 +152,33 @@ Anonymous calls are subject stricter rate limits than authenticated calls.
All URIs are relative to _<https://glistest.planttreaty.org>_
Class | Method | HTTP request | Description
---------- | ----------------------------------------------------------- | -------------------------- | -----------------------------------
_QueryApi_ | [**listRelationships**](docs/QueryApi.md#listRelationships) | **GET** /glisapi/v1/rels | Get PGRFA relationships
_QueryApi_ | [**listTerms**](docs/QueryApi.md#listTerms) | **GET** /glisapi/v1/terms | GLIS vocabularies
_QueryApi_ | [**search**](docs/QueryApi.md#search) | **GET** /glisapi/v1/pgrfas | Find passport data on PGRFA in GLIS
Class | Method | HTTP request | Description
------------ | ----------------------------------------------------------- | --------------------------------- | ---------------------------------------------------------------
_ManagerApi_ | [**registerPGRFA**](docs/ManagerApi.md#registerPGRFA) | **POST** /glis/xml/manager | Register PGRFA in GLIS and (potentially) obtain GLIS-minted DOI
_ManagerApi_ | [**updatePGRFA**](docs/ManagerApi.md#updatePGRFA) | **POST** /glis/xml/manager/update | Update PGRFA in GLIS
_QueryApi_ | [**listRelationships**](docs/QueryApi.md#listRelationships) | **GET** /glisapi/v1/rels | Get PGRFA relationships
_QueryApi_ | [**listTerms**](docs/QueryApi.md#listTerms) | **GET** /glisapi/v1/terms | GLIS vocabularies
_QueryApi_ | [**search**](docs/QueryApi.md#search) | **GET** /glisapi/v1/pgrfas | Find passport data on PGRFA in GLIS
## Documentation for Models
- [Actor](docs/Actor.md)
- [ApiError](docs/ApiError.md)
- [Location](docs/Location.md)
- [BasePGRFA](docs/BasePGRFA.md)
- [Names](docs/Names.md)
- [OtherIdentifier](docs/OtherIdentifier.md)
- [PGRFA](docs/PGRFA.md)
- [RateLimitError](docs/RateLimitError.md)
- [RegistrationResponse](docs/RegistrationResponse.md)
- [Relationship](docs/Relationship.md)
- [Species](docs/Species.md)
- [Target](docs/Target.md)
- [Term](docs/Term.md)
- [TermValue](docs/TermValue.md)
- [UpdateInformation](docs/UpdateInformation.md)
- [GLISUpdate](docs/GLISUpdate.md)
- [Location](docs/Location.md)
- [Registration](docs/Registration.md)
## Recommendation
......
# Acquisition
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**provider** | [**Actor**](Actor.md) | |
**sampleid** | **String** | | [optional]
**provenance** | **String** | ISO-3166 alpha-3 country code (https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) of the country of provenance. | [optional]
# BasePGRFA
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**username** | **String** | | [optional]
**password** | **String** | | [optional]
**location** | [**Location**](Location.md) | | [optional]
**sampledoi** | **String** | A Digital Object Identifier (DOI) obtained from a service other than GLIS and that is already assigned to the PGRFA. | [optional]
**sampleid** | **String** | A string that identifies the PGRFA that is being registered. This value will be returned by GLIS in the response message and is assumed to be used to associate the DOI to the corresponding material in the local database. You must provide &lt;sampleid&gt; even if &lt;sampledoi&gt; is provided. In case you use the DOI as unique identifier in your local database, you can repeat it in &lt;sampleid&gt;. Mandatory. Please read more details in the “HTTPS reply” chapter. | [optional]
**date** | **String** | Date in which PGRFA became part of the collection. Date fragments (YYYY-MM and YYYY) are also accepted. | [optional]
**method** | **String** | Method through which the PGRFA has been acquired. Mandatory. | [optional]
**genus** | **String** | The taxon of the genus for the PGRFA. At least one between &lt;genus&gt; and &lt;cropname&gt; must be provided. | [optional]
**cropnames** | **List&lt;String&gt;** | Common name of the crop. At least one between &lt;genus&gt; and one cropname must be provided. Multiple names are allowed. | [optional]
**targets** | [**List&lt;Target&gt;**](Target.md) | | [optional]
**progdoi** | **List&lt;String&gt;** | DOI of the progenitor PGRFA as registered in GLIS. Please note that the number of allowed DOIs depends on the method as follows * Acquisition - 1 DOI * In-house copy - 1 DOI * In-house variant - 1 DOI * Novel distinct PGRFA - 1 or more DOIs * Observation - Natural - 0 DOI * Observation – Inherited - 0 DOI | [optional]
**biostatus** | **Integer** | Biological status of the PGRFA. | [optional]
**species** | **String** | Specific epithet of the PGRFA scientific name. If not provided, \&quot;sp.\&quot; is assumed. | [optional]
**spauth** | **String** | Authority for the specific epithet. | [optional]
**subtaxa** | **String** | Any additional infra-specific taxon such as subspecies, variety, form, Group and so on. | [optional]
**stauth** | **String** | Authority for the subtaxon at the most detailed level provided. | [optional]
**names** | **List&lt;String&gt;** | Other name of the PGRFA. Any number of names can be provided. | [optional]
**ids** | **List&lt;String&gt;** | | [optional]
**mlsstatus** | **Integer** | Code that identifies the status of the PGRFA with regard to the MLS. | [optional]
**historical** | **String** | Indicates whether the PGRFA currently exists. Allowed value is y/n | [optional]
**acquisition** | [**Acquisition**](Acquisition.md) | | [optional]
**collection** | [**Collection**](Collection.md) | | [optional]
**breeding** | [**Breeding**](Breeding.md) | | [optional]
# Breeder
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**wiews** | **String** | FAO/WIEWS Institute code | [optional]
**pid** | **String** | Easy-SMTA PID | [optional]
**name** | **String** | Name | [optional]
**address** | **String** | Address | [optional]
**country** | **String** | ISO-3166 apha-3 country code | [optional]
# Breeding
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**breeders** | [**List&lt;Breeder&gt;**](Breeder.md) | | [optional]
**ancestry** | **String** | Pedigree or other description of the ancestry of the PGRFA and how it was bred. | [optional]
# Collection
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**collectors** | [**List&lt;Collector&gt;**](Collector.md) | | [optional]
**sampleid** | **String** | | [optional]
**missid** | **String** | | [optional]
**site** | **String** | | [optional]
**lat** | **String** | | [optional]
**lon** | **String** | | [optional]
**uncert** | **String** | | [optional]
**datum** | **String** | | [optional]
**georef** | **String** | | [optional]
**elevation** | **Integer** | Elevation of collecting site in metres above sea level. | [optional]
**date** | **String** | Date on which the PGRFA was collected. Date fragments (YYYY-MM and YYYY) are also accepted. | [optional]
**source** | **String** | Code of the nature of the location where the PGRFA was collected. | [optional]
# Collector
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**wiews** | **String** | FAO/WIEWS Institute code | [optional]
**pid** | **String** | Easy-SMTA PID | [optional]
**name** | **String** | Name | [optional]
**address** | **String** | Address | [optional]
**country** | **String** | ISO-3166 apha-3 country code | [optional]
# GLISUpdate
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**username** | **String** | | [optional]
**password** | **String** | | [optional]
**location** | [**Location**](Location.md) | | [optional]
**sampledoi** | **String** | A Digital Object Identifier (DOI) obtained from a service other than GLIS and that is already assigned to the PGRFA. | [optional]
**sampleid** | **String** | A string that identifies the PGRFA that is being registered. This value will be returned by GLIS in the response message and is assumed to be used to associate the DOI to the corresponding material in the local database. You must provide &lt;sampleid&gt; even if &lt;sampledoi&gt; is provided. In case you use the DOI as unique identifier in your local database, you can repeat it in &lt;sampleid&gt;. Mandatory. Please read more details in the “HTTPS reply” chapter. | [optional]
**date** | **String** | Date in which PGRFA became part of the collection. Date fragments (YYYY-MM and YYYY) are also accepted. | [optional]
**method** | **String** | Method through which the PGRFA has been acquired. Mandatory. | [optional]
**genus** | **String** | The taxon of the genus for the PGRFA. At least one between &lt;genus&gt; and &lt;cropname&gt; must be provided. | [optional]
**cropnames** | **List&lt;String&gt;** | Common name of the crop. At least one between &lt;genus&gt; and one cropname must be provided. Multiple names are allowed. | [optional]
**targets** | [**List&lt;Target&gt;**](Target.md) | | [optional]
**progdoi** | **List&lt;String&gt;** | DOI of the progenitor PGRFA as registered in GLIS. Please note that the number of allowed DOIs depends on the method as follows * Acquisition - 1 DOI * In-house copy - 1 DOI * In-house variant - 1 DOI * Novel distinct PGRFA - 1 or more DOIs * Observation - Natural - 0 DOI * Observation – Inherited - 0 DOI | [optional]
**biostatus** | **Integer** | Biological status of the PGRFA. | [optional]
**species** | **String** | Specific epithet of the PGRFA scientific name. If not provided, \&quot;sp.\&quot; is assumed. | [optional]
**spauth** | **String** | Authority for the specific epithet. | [optional]
**subtaxa** | **String** | Any additional infra-specific taxon such as subspecies, variety, form, Group and so on. | [optional]
**stauth** | **String** | Authority for the subtaxon at the most detailed level provided. | [optional]
**names** | **List&lt;String&gt;** | Other name of the PGRFA. Any number of names can be provided. | [optional]
**ids** | **List&lt;String&gt;** | | [optional]
**mlsstatus** | **Integer** | Code that identifies the status of the PGRFA with regard to the MLS. | [optional]
**historical** | **String** | Indicates whether the PGRFA currently exists. Allowed value is y/n | [optional]
**acquisition** | [**Acquisition**](Acquisition.md) | | [optional]
**collection** | [**Collection**](Collection.md) | | [optional]
**breeding** | [**Breeding**](Breeding.md) | | [optional]
# ManagerApi
All URIs are relative to *https://glistest.planttreaty.org*
Method | HTTP request | Description
------------- | ------------- | -------------
[**registerPGRFA**](ManagerApi.md#registerPGRFA) | **POST** /glis/xml/register | Register PGRFA in GLIS and (potentially) obtain GLIS-minted DOI
[**updatePGRFA**](ManagerApi.md#updatePGRFA) | **POST** /glis/xml/update | Update PGRFA in GLIS
<a name="registerPGRFA"></a>
# **registerPGRFA**
> RegistrationResponse registerPGRFA(pgrfa)
Register PGRFA in GLIS and (potentially) obtain GLIS-minted DOI
The purpose of this transaction is to obtain a DOI associated to the PGRFA by providing a set of descriptors in the registration request. However, if a DOI obtained through a service other than GLIS is already associated to the PGRFA, it must be provided in the request so that GLIS will not assign a new DOI but just adopt the one provided.
### Example
```java
// Import classes:
//import org.genesys.glis.v1.invoker.ApiException;
//import org.genesys.glis.v1.api.ManagerApi;
ManagerApi apiInstance = new ManagerApi();
Registration pgrfa = new Registration(); // Registration | Register PGRFA in GLIS and obtain GLIS DOI.
try {
RegistrationResponse result = apiInstance.registerPGRFA(pgrfa);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ManagerApi#registerPGRFA");
e.printStackTrace();
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**pgrfa** | [**Registration**](Registration.md)| Register PGRFA in GLIS and obtain GLIS DOI. | [optional]
### Return type
[**RegistrationResponse**](RegistrationResponse.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/xml
- **Accept**: application/xml
<a name="updatePGRFA"></a>
# **updatePGRFA**
> RegistrationResponse updatePGRFA(pgrfa)
Update PGRFA in GLIS
Update information on PGRFA already registered in GLIS.
### Example
```java
// Import classes:
//import org.genesys.glis.v1.invoker.ApiException;
//import org.genesys.glis.v1.api.ManagerApi;
ManagerApi apiInstance = new ManagerApi();
GLISUpdate pgrfa = new GLISUpdate(); // GLISUpdate | Update PGRFA in GLIS by DOI.
try {
RegistrationResponse result = apiInstance.updatePGRFA(pgrfa);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ManagerApi#updatePGRFA");
e.printStackTrace();
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**pgrfa** | [**GLISUpdate**](GLISUpdate.md)| Update PGRFA in GLIS by DOI. | [optional]
### Return type
[**RegistrationResponse**](RegistrationResponse.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/xml
- **Accept**: application/xml
# Registration
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**username** | **String** | | [optional]
**password** | **String** | | [optional]
**location** | [**Location**](Location.md) | | [optional]
**sampledoi** | **String** | A Digital Object Identifier (DOI) obtained from a service other than GLIS and that is already assigned to the PGRFA. | [optional]
**sampleid** | **String** | A string that identifies the PGRFA that is being registered. This value will be returned by GLIS in the response message and is assumed to be used to associate the DOI to the corresponding material in the local database. You must provide &lt;sampleid&gt; even if &lt;sampledoi&gt; is provided. In case you use the DOI as unique identifier in your local database, you can repeat it in &lt;sampleid&gt;. Mandatory. Please read more details in the “HTTPS reply” chapter. | [optional]
**date** | **String** | Date in which PGRFA became part of the collection. Date fragments (YYYY-MM and YYYY) are also accepted. | [optional]
**method** | **String** | Method through which the PGRFA has been acquired. Mandatory. | [optional]
**genus** | **String** | The taxon of the genus for the PGRFA. At least one between &lt;genus&gt; and &lt;cropname&gt; must be provided. | [optional]
**cropnames** | **List&lt;String&gt;** | Common name of the crop. At least one between &lt;genus&gt; and one cropname must be provided. Multiple names are allowed. | [optional]
**targets** | [**List&lt;Target&gt;**](Target.md) | | [optional]
**progdoi** | **List&lt;String&gt;** | DOI of the progenitor PGRFA as registered in GLIS. Please note that the number of allowed DOIs depends on the method as follows * Acquisition - 1 DOI * In-house copy - 1 DOI * In-house variant - 1 DOI * Novel distinct PGRFA - 1 or more DOIs * Observation - Natural - 0 DOI * Observation – Inherited - 0 DOI | [optional]
**biostatus** | **Integer** | Biological status of the PGRFA. | [optional]
**species** | **String** | Specific epithet of the PGRFA scientific name. If not provided, \&quot;sp.\&quot; is assumed. | [optional]
**spauth** | **String** | Authority for the specific epithet. | [optional]
**subtaxa** | **String** | Any additional infra-specific taxon such as subspecies, variety, form, Group and so on. | [optional]
**stauth** | **String** | Authority for the subtaxon at the most detailed level provided. | [optional]
**names** | **List&lt;String&gt;** | Other name of the PGRFA. Any number of names can be provided. | [optional]
**ids** | **List&lt;String&gt;** | | [optional]
**mlsstatus** | **Integer** | Code that identifies the status of the PGRFA with regard to the MLS. | [optional]
**historical** | **String** | Indicates whether the PGRFA currently exists. Allowed value is y/n | [optional]
**acquisition** | [**Acquisition**](Acquisition.md) | | [optional]
**collection** | [**Collection**](Collection.md) | | [optional]
**breeding** | [**Breeding**](Breeding.md) | | [optional]
# RegistrationResponse
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**sampleid** | **String** | The local sample identifier sent in the request. |
**genus** | **String** | Genus of the PGRFA. | [optional]
**doi** | **String** | The DOI associated with the PGRFA upon registration. | [optional]
**error** | **List&lt;String&gt;** | | [optional]
......@@ -4,8 +4,8 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**modified** | [**DateTime**](DateTime.md) | The date of last change. | [optional]
**doiregistered** | [**DateTime**](DateTime.md) | The date of DOI registration to the DataCite registry. If this element is missing or null, the DOI has not been registered yet and should therefore not be used in publications | [optional]
**modified** | [**OffsetDateTime**](OffsetDateTime.md) | The date of last change. | [optional]
**doiregistered** | [**OffsetDateTime**](OffsetDateTime.md) | The date of DOI registration to the DataCite registry. If this element is missing or null, the DOI has not been registered yet and should therefore not be used in publications | [optional]
......@@ -15,8 +15,9 @@
<swagger-codegen.language>java</swagger-codegen.language>
<swagger-codegen.library>jersey2</swagger-codegen.library>
<jersey-version>2.22.2</jersey-version>
<jackson-version>2.7.5</jackson-version>
<org.slf4j.version>1.7.25</org.slf4j.version>
<jersey-version>2.25.1</jersey-version>
<jackson-version>2.6.4</jackson-version>
</properties>
<dependencies>
......@@ -27,55 +28,62 @@
</dependency>
<!-- HTTP client: jersey-client -->
<dependency>
<groupId>org.glassfish.jersey.core</groupId>
<artifactId>jersey-client</artifactId>
<version>${jersey-version}</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.media</groupId>
<artifactId>jersey-media-multipart</artifactId>
<version>${jersey-version}</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.media</groupId>
<artifactId>jersey-media-json-jackson</artifactId>
<version>${jersey-version}</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.core</groupId>
<artifactId>jersey-client</artifactId>
<version>${jersey-version}</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.media</groupId>
<artifactId>jersey-media-multipart</artifactId>
<version>${jersey-version}</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.media</groupId>
<artifactId>jersey-media-json-jackson</artifactId>
<version>${jersey-version}</version>
</dependency>
<!-- JSON processing: jackson -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>${jackson-version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>${jackson-version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>${jackson-version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-joda</artifactId>
<version>${jackson-version}</version>
</dependency>
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
<version>${jodatime-version}</version>
</dependency>
<!-- JSON processing: jackson -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>${jackson-version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>${jackson-version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>${jackson-version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jsr310</artifactId>
<version>${jackson-version}</version>
</dependency>
<dependency>
<groupId>com.github.joschi.jackson</groupId>
<artifactId>jackson-datatype-threetenbp</artifactId>
<version>${jackson-version}</version>
</dependency>
<!-- Base64 encoding that works in both JVM and Android -->
<dependency>
<groupId>com.brsanthu</groupId>
<artifactId>migbase64</artifactId>
<version>2.2</version>
</dependency>
<!-- XML processing: Jackson -->
<dependency>
<groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-xml</artifactId>
<version>${jackson-version}</version>
</dependency>
<!-- Base64 encoding that works in both JVM and Android -->
<dependency>
<groupId>com.brsanthu</groupId>
<artifactId>migbase64</artifactId>
<version>2.2</version>
</dependency>
<!-- test dependencies -->
<dependency>
<groupId>junit</groupId>
......@@ -89,6 +97,31 @@
<version>1.3</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.media</groupId>
<artifactId>jersey-media-jaxb</artifactId>
<version>${jersey-version}</version>
</dependency>
<!-- test logging -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${org.slf4j.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
<version>${org.slf4j.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>${org.slf4j.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
......
......@@ -22,13 +22,16 @@ import org.junit.BeforeClass;
public abstract class BaseApiTest {
public static final String THE_DOI = "10.0155/1";
public static final String GLIS_DOI_PATTERN = "^(doi:)?10\\.[0-9]+\\/[0123456789ABCDEFGHJKMNPQRSTVWXYZ]+[0123456789ABCDEFGHJKMNPQRSTVWXYZ~\\*\\$=U]$";
public static final String THE_DOI = "10.0155/AA";
protected static String GLIS_USERNAME = System.getenv("GLIS_USERNAME");
protected static String GLIS_PASSWORD = System.getenv("GLIS_PASSWORD");
protected static ApiClient defaultClient;
protected final QueryApi queryApi = new QueryApi(defaultClient);
@BeforeClass
public static void config() {
defaultClient = new ApiClient();
......@@ -41,4 +44,5 @@ public abstract class BaseApiTest {
System.out.println("Using GLIS username " + easySmtaAuth.getUsername());
easySmtaAuth.setPassword(GLIS_PASSWORD);
}
}
......@@ -35,8 +35,6 @@ import org.junit.Test;
*/
public class QueryApiTest extends BaseApiTest {
private final QueryApi api = new QueryApi(defaultClient);
/**
* Get PGRFA relationships
*
......@@ -48,10 +46,10 @@ public class QueryApiTest extends BaseApiTest {
public void listRelationshipsTest() throws ApiException {
String role = null;
String oper = null;
List<Relationship> response = api.listRelationships(THE_DOI, role, oper);
List<Relationship> response = queryApi.listRelationships(THE_DOI, role, oper);
// GLIS test environment is occasionally cleaned
// assertThat(response.size(), greaterThan(0));
// assertThat(response.size(), greaterThan(0));
}
/**
......@@ -65,7 +63,7 @@ public class QueryApiTest extends BaseApiTest {
@Test
public void listTermsTest() throws ApiException {
List<String> acceptLanguage = Arrays.asList("en");
List<Term> response = api.listTerms(acceptLanguage);
List<Term> response = queryApi.listTerms(acceptLanguage);
assertThat(response.size(), greaterThan(0));
}
......@@ -106,7 +104,7 @@ public class QueryApiTest extends BaseApiTest {
String biostatus = null;
String mlsstatus = null;
String targetkw = null;
List<PGRFA> response = api.search(page, perPage, null, THE_DOI, identifier, genus, species, name, holdwiews, holdpid, holdname, holdcountry, methodcode, provwiews, provpid, provname,
List<PGRFA> response = queryApi.search(page, perPage, null, THE_DOI, identifier, genus, species, name, holdwiews, holdpid, holdname, holdcountry, methodcode, provwiews, provpid, provname,
provcountry, provenance, collwiews, collpid, collname, collcountry, bredwiews, bredpid, bredname, bredcountry, biostatus, mlsstatus, targetkw);
// assertThat(response.size(), greaterThan(0));
......@@ -124,7 +122,7 @@ public class QueryApiTest extends BaseApiTest {
public void listDOIHolders() throws ApiException {
DOIArray dois=new DOIArray();
dois.addDoisItem(THE_DOI);
List<DOIHolder> response = api.listHolders(dois);
List<DOIHolder> response = queryApi.listHolders(dois);
// GLIS test environment is occasionally cleaned
// assertThat(response.size(), greaterThan(0));
......
/*
* Copyright 2017 Global Crop Diversity Trust
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.genesys.glis.v1.api;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.*;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import org.genesys.glis.v1.invoker.ApiException;
import org.genesys.glis.v1.model.Acquisition;
import org.genesys.glis.v1.model.Actor;
import org.genesys.glis.v1.model.Collection;
import org.genesys.glis.v1.model.Collector;
import org.genesys.glis.v1.model.Location;
import org.genesys.glis.v1.model.Registration;
import org.genesys.glis.v1.model.RegistrationResponse;
import org.genesys.glis.v1.model.Relationship;
import org.junit.Ignore;
import org.junit.Test;
/**
* API tests for ManagerApi
*/
@Ignore
public class RegistrationApiTest extends BaseApiTest {
private final ManagerApi api = new ManagerApi(defaultClient);
/**
* Register PGRFA in GLIS
*
* @throws ApiException if the Api call fails
*/
@Test