Commit 5b83dcc9 authored by Maxym Borodenko's avatar Maxym Borodenko
Browse files

Descriptor list URL

parent 8ecd62f1
......@@ -85,6 +85,9 @@ public class DescriptorList extends UuidModel implements Publishable, SelfCleani
/** Not published by default. */
private boolean published = false;
/** Trait URL. */
private String url;
/**
* User-specified version tag. E.g. "1.0", "1.1"
*/
......@@ -188,6 +191,24 @@ public class DescriptorList extends UuidModel implements Publishable, SelfCleani
this.title = title;
}
/**
* Gets the url.
*
* @return the url
*/
public String getUrl() {
return url;
}
/**
* Sets the url.
*
* @param url the new url
*/
public void setUrl(final String url) {
this.url = url;
}
/**
* Gets the description.
*
......
......@@ -236,6 +236,7 @@ public class DescriptorListServiceImpl implements DescriptorListService {
target.setDescription(source.getDescription());
target.setPublished(source.isPublished());
target.setTitle(source.getTitle());
target.setUrl(source.getUrl());
target.setVersionTag(source.getVersionTag());
target.setUuid(source.getUuid());
target.setBibliographicCitation(source.getBibliographicCitation());
......
......@@ -3776,3 +3776,15 @@ databaseChangeLog:
columnDataType: int(10)
columnName: mask
tableName: acl_entry
- changeSet:
id: 1519894909581-1
author: mborodenko
comment: Add field `url` to DescriptorList
changes:
- addColumn:
columns:
- column:
name: url
type: VARCHAR(255)
tableName: descriptor_list
/*
* Copyright 2017 Global Crop Diversity Trust
* Copyright 2018 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.
......@@ -61,6 +61,8 @@ public class DescriptorListControllerTest extends AbstractRestTest {
private static final String PARTNER_NAME = "Partner Name";
private static final String URL = "https://my-test-url.net";
@Rule
public final JUnitRestDocumentation restDocumentation = new JUnitRestDocumentation("target/generated-snippets");
......@@ -120,6 +122,7 @@ public class DescriptorListControllerTest extends AbstractRestTest {
.andExpect(status().isOk())
.andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8))
.andExpect(jsonPath("$", not(nullValue())))
.andExpect(jsonPath("$.url", is(URL)))
.andExpect(jsonPath("$.crop", is(CROPNAME)));
/*@formatter:on*/
}
......@@ -132,6 +135,7 @@ public class DescriptorListControllerTest extends AbstractRestTest {
descriptorList.setTitle("Title 1");
descriptorList.setDescription("Updated description");
descriptorList.setUrl("https://new-test-url.net");
final String s = verboseMapper.writeValueAsString(descriptorList);
/*@formatter:off*/
......@@ -146,6 +150,7 @@ public class DescriptorListControllerTest extends AbstractRestTest {
.andExpect(jsonPath("$", not(nullValue())))
.andExpect(jsonPath("$.uuid", is(descriptorList.getUuid().toString())))
.andExpect(jsonPath("$.title", is(descriptorList.getTitle())))
.andExpect(jsonPath("$.url", is(descriptorList.getUrl())))
.andExpect(jsonPath("$.description", is(descriptorList.getDescription())))
.andExpect(jsonPath("$.versionTag", is(descriptorList.getVersionTag())));
/*@formatter:on */
......@@ -255,6 +260,7 @@ public class DescriptorListControllerTest extends AbstractRestTest {
o.setCrop(CROPNAME);
o.setPublished(published);
o.setTitle(title);
o.setUrl(URL);
o.setVersionTag(versionTag);
o.setUuid(uuid);
......
Supports Markdown
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