Commit b25e9d70 authored by Matija Obreza's avatar Matija Obreza

Merge branch '512-filter-accession-number' into 'master'

Resolve "Filter: Accession number"

Closes #512

See merge request genesys-pgr/genesys-server!539
parents 47bc3058 b6940a38
/*
* Copyright 2017 Global Crop Diversity Trust
* Copyright 2019 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.
......@@ -126,4 +126,13 @@ public class AccessionRefFilter {
genus.add(value);
return this;
}
/**
* Accession Number filter.
*
* @return the string filter
*/
public synchronized StringFilter acceNumb() {
return this.acceNumb == null ? this.acceNumb = new StringFilter() : this.acceNumb;
}
}
/*
* Copyright 2018 Global Crop Diversity Trust
* Copyright 2019 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.
......@@ -15,7 +15,10 @@
*/
package org.genesys.catalog.model.filters;
import com.querydsl.core.types.Predicate;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import org.apache.commons.collections4.CollectionUtils;
import org.genesys.blocks.model.filters.StringFilter;
import org.genesys.blocks.model.filters.UuidModelFilter;
......@@ -24,9 +27,7 @@ import org.genesys.catalog.model.dataset.QDataset;
import org.genesys2.server.model.PublishState;
import org.genesys2.server.service.filter.IFullTextFilter;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import com.querydsl.core.types.Predicate;
/**
* The Class DatasetFilter.
......@@ -176,4 +177,13 @@ public class DatasetFilter extends UuidModelFilter<DatasetFilter, Dataset> imple
}
return this.owner;
}
/**
* Title filter.
*
* @return the string filter
*/
public synchronized StringFilter title() {
return this.title == null ? this.title = new StringFilter() : this.title;
}
}
......@@ -205,4 +205,14 @@ public class DescriptorFilter extends UuidModelFilter<DescriptorFilter, Descript
public String get_text() {
return _text;
}
/**
* Title filter.
*
* @return the string filter
*/
public synchronized StringFilter title() {
return this.title == null ? this.title = new StringFilter() : this.title;
}
}
/*
* Copyright 2018 Global Crop Diversity Trust
* Copyright 2019 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.
......@@ -117,7 +117,7 @@ public class DescriptorListFilter extends UuidModelFilter<DescriptorListFilter,
return predicates;
}
public DescriptorListFilter state(PublishState... state) {
public synchronized DescriptorListFilter state(PublishState... state) {
if (this.state == null) {
this.state = new HashSet<>();
}
......@@ -132,10 +132,28 @@ public class DescriptorListFilter extends UuidModelFilter<DescriptorListFilter,
return _text;
}
public PartnerFilter owner() {
public synchronized PartnerFilter owner() {
if (this.owner == null) {
return this.owner = new PartnerFilter();
}
return this.owner;
}
/**
* Title filter.
*
* @return the string filter
*/
public synchronized StringFilter title() {
return this.title == null ? this.title = new StringFilter() : this.title;
}
/**
* Description filter.
*
* @return the string filter
*/
public synchronized StringFilter description() {
return this.description == null ? this.description = new StringFilter() : this.description;
}
}
/*
* Copyright 2017 Global Crop Diversity Trust
* Copyright 2019 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.
......@@ -15,20 +15,22 @@
*/
package org.genesys.catalog.model.filters;
import com.fasterxml.jackson.annotation.JsonGetter;
import com.querydsl.core.types.Predicate;
import org.apache.commons.collections4.CollectionUtils;
import org.genesys.blocks.model.filters.StringFilter;
import org.genesys.blocks.model.filters.UuidModelFilter;
import org.genesys.catalog.model.Partner;
import org.genesys.catalog.model.QPartner;
import static org.genesys.catalog.model.QPartner.*;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
import static org.genesys.catalog.model.QPartner.partner;
import org.apache.commons.collections4.CollectionUtils;
import org.genesys.blocks.model.filters.StringFilter;
import org.genesys.blocks.model.filters.UuidModelFilter;
import org.genesys.catalog.model.Partner;
import org.genesys.catalog.model.QPartner;
import com.fasterxml.jackson.annotation.JsonGetter;
import com.querydsl.core.types.Predicate;
/**
* The Class PartnerFilter.
......@@ -46,7 +48,7 @@ public class PartnerFilter extends UuidModelFilter<PartnerFilter, Partner> {
/** The name. */
public StringFilter description;
/** The wiews codes. */
/** The WIEWS codes. */
public Set<String> wiewsCodes;
/**
......@@ -58,6 +60,12 @@ public class PartnerFilter extends UuidModelFilter<PartnerFilter, Partner> {
return collectPredicates(partner);
}
/**
* Collect predicates.
*
* @param partnerPath the partner path
* @return the list
*/
public List<Predicate> collectPredicates(final QPartner partnerPath) {
final List<Predicate> predicates = super.collectPredicates(partnerPath, partnerPath._super);
......@@ -76,8 +84,31 @@ public class PartnerFilter extends UuidModelFilter<PartnerFilter, Partner> {
return predicates;
}
/**
* Wiews codes.
*
* @return the sets the
*/
@JsonGetter("wiewsCodes")
public Set<String> wiewsCodes() {
return wiewsCodes != null ? wiewsCodes.stream().map(String::toUpperCase).collect(Collectors.toSet()) : Collections.emptySet();
}
/**
* Name filter.
*
* @return the string filter
*/
public synchronized StringFilter name() {
return this.name == null ? this.name = new StringFilter() : this.name;
}
/**
* Short name filter.
*
* @return the sets the
*/
public synchronized Set<String> shortName() {
return this.shortName == null ? this.shortName = new HashSet<>() : this.shortName;
}
}
......@@ -101,7 +101,7 @@ public class BrAPIServiceImpl implements BrAPIService {
}
if (StringUtils.isNotBlank(germplasmName)) {
accessionFilter.acceNumb().eq = germplasmName;
accessionFilter.accessionNumbers().add(germplasmName);
}
......
......@@ -75,8 +75,12 @@ public class AccessionFilter extends UuidModelFilter<AccessionFilter, Accession>
public InstituteFilter institute;
/** The acce numb. */
@Deprecated
public StringFilter accessionNumber;
/** The accession numbers. */
public Set<String> accessionNumbers;
/** The doi. */
public Set<String> doi;
......@@ -203,6 +207,9 @@ public class AccessionFilter extends UuidModelFilter<AccessionFilter, Accession>
if (CollectionUtil.isNotEmpty(doi)) {
predicates.add(accession.doi.in(doi));
}
if (CollectionUtil.isNotEmpty(accessionNumbers)) {
predicates.add(accession.accessionNumber.in(accessionNumbers));
}
if (accessionNumber != null) {
predicates.add(accessionNumber.buildQuery(accession.accessionNumber));
}
......@@ -290,6 +297,9 @@ public class AccessionFilter extends UuidModelFilter<AccessionFilter, Accession>
if (CollectionUtil.isNotEmpty(doi)) {
predicates.add(accession.doi.isNotNull().and(accession.doi.in(doi)));
}
if (CollectionUtil.isNotEmpty(accessionNumbers)) {
predicates.add(accession.accessionNumber.in(accessionNumbers));
}
if (accessionNumber != null) {
predicates.add(accessionNumber.buildQuery(accession.accessionNumber));
}
......@@ -418,10 +428,7 @@ public class AccessionFilter extends UuidModelFilter<AccessionFilter, Accession>
* @return the accession geo filter
*/
public synchronized AccessionGeoFilter geo() {
if (this.geo == null) {
return this.geo = new AccessionGeoFilter();
}
return this.geo;
return this.geo == null ? this.geo = new AccessionGeoFilter() : this.geo;
}
/**
......@@ -430,10 +437,7 @@ public class AccessionFilter extends UuidModelFilter<AccessionFilter, Accession>
* @return the accession collect filter
*/
public synchronized AccessionCollectFilter coll() {
if (this.coll == null) {
return this.coll = new AccessionCollectFilter();
}
return this.coll;
return this.coll == null ? this.coll = new AccessionCollectFilter() : this.coll;
}
/**
......@@ -442,22 +446,26 @@ public class AccessionFilter extends UuidModelFilter<AccessionFilter, Accession>
* @return the taxonomy filter
*/
public synchronized TaxonomyFilter taxa() {
if (this.taxonomy == null) {
return this.taxonomy = new TaxonomyFilter();
}
return this.taxonomy;
return this.taxonomy == null ? this.taxonomy = new TaxonomyFilter() : this.taxonomy;
}
/**
* Acce numb.
* Accession Number filter.
*
* @deprecated Will be removed soon.
* @return the string filter
*/
public synchronized StringFilter acceNumb() {
if (accessionNumber == null) {
accessionNumber = new StringFilter();
}
return accessionNumber;
public synchronized StringFilter accessionNumber() {
return this.accessionNumber == null ? this.accessionNumber = new StringFilter() : this.accessionNumber;
}
/**
* Accession Number filter.
*
* @return the string filter
*/
public synchronized Set<String> accessionNumbers() {
return this.accessionNumbers == null ? this.accessionNumbers = new HashSet<>() : this.accessionNumbers;
}
public synchronized Set<String> doi() {
......@@ -470,4 +478,13 @@ public class AccessionFilter extends UuidModelFilter<AccessionFilter, Accession>
public String get_text() {
return _text;
}
/**
* Institute filter.
*
* @return the institute filter
*/
public synchronized InstituteFilter institute() {
return this.institute == null ? this.institute = new InstituteFilter() : this.institute;
}
}
/*
* Copyright 2018 Global Crop Diversity Trust
* Copyright 2019 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.
......@@ -16,13 +16,11 @@
package org.genesys2.server.service.filter;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.JsonDeserializer;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.hazelcast.util.CollectionUtil;
import com.querydsl.core.types.Predicate;
import java.io.IOException;
import java.util.Date;
import java.util.List;
import java.util.Set;
import org.genesys.blocks.model.filters.AuditedVersionedModelFilter;
import org.genesys.blocks.model.filters.DateFilter;
import org.genesys.blocks.model.filters.StringFilter;
......@@ -30,10 +28,13 @@ import org.genesys2.server.model.UserRole;
import org.genesys2.server.model.impl.QUser;
import org.genesys2.server.model.impl.User;
import java.io.IOException;
import java.util.Date;
import java.util.List;
import java.util.Set;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.JsonDeserializer;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.hazelcast.util.CollectionUtil;
import com.querydsl.core.types.Predicate;
/**
* Filters for {@link User}.
......@@ -114,11 +115,20 @@ public class UserFilter extends AuditedVersionedModelFilter<UserFilter, User> {
return predicates;
}
private static class UserRoleDeserializer extends JsonDeserializer {
private static class UserRoleDeserializer extends JsonDeserializer<UserRole> {
@Override
public Object deserialize(JsonParser p, DeserializationContext ctxt) throws IOException, JsonProcessingException {
public UserRole deserialize(JsonParser p, DeserializationContext ctxt) throws IOException, JsonProcessingException {
return UserRole.valueOf(p.getText());
}
}
/**
* Email filter.
*
* @return the string filter
*/
public synchronized StringFilter email() {
return this.email == null ? this.email = new StringFilter() : this.email;
}
}
......@@ -15,13 +15,15 @@
*/
package org.genesys.test.catalog.services;
import static org.hamcrest.Matchers.*;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import static org.hamcrest.Matchers.*;
import static org.hamcrest.Matchers.anyOf;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.not;
import static org.hamcrest.Matchers.notNullValue;
import static org.hamcrest.Matchers.nullValue;
import static org.junit.Assert.*;
import java.io.File;
import java.io.FileInputStream;
......@@ -35,7 +37,6 @@ import java.util.stream.Collectors;
import javax.validation.ConstraintViolationException;
import org.genesys.blocks.model.filters.StringFilter;
import org.genesys.catalog.model.dataset.Dataset;
import org.genesys.catalog.model.dataset.DatasetAccessionRef;
import org.genesys.catalog.model.dataset.DatasetCreator;
......@@ -709,17 +710,16 @@ public class DatasetServiceTest extends AbstractDatasetServiceTest {
assertThat(datasetService.listDatasets(filter, PageRequest.of(0, 3)).getContent(), hasSize(0));
filter.accessionRefs.genus.clear();
filter.accessionRefs.acceNumb = new StringFilter();
filter.accessionRefs.acceNumb().eq("A8"); // only in dataset1
filter.accessionRefs.acceNumb.eq = "A8"; // only in dataset1
assertThat(datasetService.listDatasets(filter, PageRequest.of(0, 3)).getContent(), hasSize(1));
assertThat(datasetService.listDatasets(filter, PageRequest.of(0, 3)).getContent().stream().map(d -> d.getUuid()).collect(Collectors.toSet()), contains(dataset1
.getUuid()));
filter.accessionRefs.acceNumb.eq = "A1"; // in both
filter.accessionRefs.acceNumb.eq = Sets.newHashSet("A1"); // in both
assertThat(datasetService.listDatasets(filter, PageRequest.of(0, 3)).getContent(), hasSize(2));
filter.accessionRefs.acceNumb.eq = "A8"; // only in dataset1
filter.accessionRefs.acceNumb.eq = Sets.newHashSet("A8"); // only in dataset1
filter.accessionRefs.genus("Musa");
assertThat(datasetService.listDatasets(filter, PageRequest.of(0, 3)).getContent(), hasSize(1));
assertThat(datasetService.listDatasets(filter, PageRequest.of(0, 3)).getContent().stream().map(d -> d.getUuid()).collect(Collectors.toSet()), contains(dataset1
......
......@@ -15,10 +15,9 @@
*/
package org.genesys.test.catalog.services;
import static org.hamcrest.Matchers.*;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.*;
import java.io.IOException;
import java.util.Arrays;
......@@ -27,7 +26,6 @@ import java.util.Set;
import java.util.stream.Collectors;
import org.apache.commons.lang3.RandomStringUtils;
import org.genesys.blocks.model.filters.StringFilter;
import org.genesys.catalog.model.ShortFilter;
import org.genesys.catalog.model.filters.DescriptorFilter;
import org.genesys.catalog.model.filters.DescriptorListFilter;
......@@ -68,12 +66,10 @@ public class ShortFilterServiceTest extends CatalogServiceTest {
@Test
public void testCreate() throws IOException {
final DescriptorListFilter filter = new DescriptorListFilter();
filter.title = new StringFilter();
filter.title.eq = "TEST";
filter.description = new StringFilter();
filter.title().eq("TEST");
final String[] cropValues = { "yam", "banana", "wheat", "rice", "barley", "apple" };
filter.description.eq = "THIS IS description";
filter.description.contains = "contains description";
filter.description().eq("THIS IS description");
filter.description().contains("contains description");
filter.crop = Arrays.stream(cropValues).collect(Collectors.toSet());
String shortName = shortFilterService.getCode(filter);
......
......@@ -58,7 +58,7 @@ public abstract class AbstractAccessionControllerTest extends AbstractApiTest {
protected static final int STORAGE_11 = 11;
protected static final String ACCENUMB_1 = "A-0001";
protected static final String ACCENUMB_2 = "A-0002";
protected static final String ACCENUMB_2 = "B-0002";
protected static final String GENUS_1 = "Hordeum";
protected static final String GENUS_2 = "Musa";
......
......@@ -25,6 +25,7 @@ import static org.hamcrest.Matchers.not;
import static org.hamcrest.Matchers.notNullValue;
import static org.hamcrest.Matchers.nullValue;
import static org.hamcrest.Matchers.startsWith;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
......@@ -280,6 +281,135 @@ public class AccessionControllerTest extends AbstractAccessionControllerTest {
/*@formatter:on*/
}
@Test
public void filterByAccessionNumberTestEquals() throws Exception {
accessionUploader.upsertAccessions(institute, upsertAccessions(institute.getCode(), ACCENUMB_1, GENUS_1, null));
accessionUploader.upsertAccessions(institute, upsertAccessions(institute.getCode(), ACCENUMB_2, GENUS_2, null));
// ensure we have 2 accessions in DB
assertEquals(2, accessionRepository.count());
/*@formatter:off*/
mockMvc
.perform(post(AccessionController.CONTROLLER_URL + "/list")
.contentType(MediaType.APPLICATION_JSON)
.content(String.format("{\"accessionNumber\":{\"eq\":\"%s\"}}", ACCENUMB_1)))
// .andDo(MockMvcResultHandlers.print())
.andExpect(status().isOk())
.andExpect(content().contentType(MediaType.APPLICATION_JSON_VALUE))
.andExpect(jsonPath("$", not(nullValue())))
.andExpect(jsonPath("$.totalElements", is(1)))
.andExpect(jsonPath("$.content").isArray())
.andExpect(jsonPath("$.content[0].accessionNumber", is(ACCENUMB_1)))
;
mockMvc
.perform(post(AccessionController.CONTROLLER_URL + "/list")
.contentType(MediaType.APPLICATION_JSON)
.content(String.format("{\"accessionNumber\":{\"eq\":[\"%1s\",\"%2s\"]}}", ACCENUMB_1, ACCENUMB_2)))
// .andDo(MockMvcResultHandlers.print())
.andExpect(status().isOk())
.andExpect(content().contentType(MediaType.APPLICATION_JSON_VALUE))
.andExpect(jsonPath("$", not(nullValue())))
.andExpect(jsonPath("$.totalElements", is(2)))
.andExpect(jsonPath("$.content").isArray())
.andExpect(jsonPath("$.content[0].accessionNumber", is(oneOf(ACCENUMB_1, ACCENUMB_2))))
.andExpect(jsonPath("$.content[1].accessionNumber", is(oneOf(ACCENUMB_1, ACCENUMB_2))))
;
// The new version
mockMvc
.perform(post(AccessionController.CONTROLLER_URL + "/list")
.contentType(MediaType.APPLICATION_JSON)
.content(String.format("{\"accessionNumbers\":[\"%1s\",\"%2s\"]}", ACCENUMB_1, ACCENUMB_2)))
// .andDo(MockMvcResultHandlers.print())
.andExpect(status().isOk())
.andExpect(content().contentType(MediaType.APPLICATION_JSON_VALUE))
.andExpect(jsonPath("$", not(nullValue())))
.andExpect(jsonPath("$.totalElements", is(2)))
.andExpect(jsonPath("$.content").isArray())
.andExpect(jsonPath("$.content[0].accessionNumber", is(oneOf(ACCENUMB_1, ACCENUMB_2))))
.andExpect(jsonPath("$.content[1].accessionNumber", is(oneOf(ACCENUMB_1, ACCENUMB_2))))
;
/*@formatter:on*/
}
@Test
public void filterByAccessionNumberTestStartsWith() throws Exception {
accessionUploader.upsertAccessions(institute, upsertAccessions(institute.getCode(), ACCENUMB_1, GENUS_1, null));
accessionUploader.upsertAccessions(institute, upsertAccessions(institute.getCode(), ACCENUMB_2, GENUS_2, null));
// ensure we have 2 accessions in DB
assertEquals(2, accessionRepository.count());
/*@formatter:off*/
mockMvc
.perform(post(AccessionController.CONTROLLER_URL + "/list")
.contentType(MediaType.APPLICATION_JSON)
.content(String.format("{\"accessionNumber\":{\"sw\":\"%s\"}}", ACCENUMB_1.substring(0, 3))))
// .andDo(MockMvcResultHandlers.print())
.andExpect(status().isOk())
.andExpect(content().contentType(MediaType.APPLICATION_JSON_VALUE))
.andExpect(jsonPath("$", not(nullValue())))
.andExpect(jsonPath("$.totalElements", is(1)))
.andExpect(jsonPath("$.content").isArray())
.andExpect(jsonPath("$.content[0].accessionNumber", is(ACCENUMB_1)))
;
mockMvc
.perform(post(AccessionController.CONTROLLER_URL + "/list")
.contentType(MediaType.APPLICATION_JSON)
.content(String.format("{\"accessionNumber\":{\"sw\":[\"%1s\",\"%2s\"]}}", ACCENUMB_1, ACCENUMB_2.substring(0, 3))))
// .andDo(MockMvcResultHandlers.print())
.andExpect(status().isOk())
.andExpect(content().contentType(MediaType.APPLICATION_JSON_VALUE))
.andExpect(jsonPath("$", not(nullValue())))
.andExpect(jsonPath("$.totalElements", is(2)))
.andExpect(jsonPath("$.content").isArray())
.andExpect(jsonPath("$.content[0].accessionNumber", is(oneOf(ACCENUMB_1, ACCENUMB_2))))
.andExpect(jsonPath("$.content[1].accessionNumber", is(oneOf(ACCENUMB_1, ACCENUMB_2))))
;
/*@formatter:on*/
}
@Test
public void filterByAccessionNumberTestContains() throws Exception {
accessionUploader.upsertAccessions(institute, upsertAccessions(institute.getCode(), ACCENUMB_1, GENUS_1, null));
accessionUploader.upsertAccessions(institute, upsertAccessions(institute.getCode(), ACCENUMB_2, GENUS_2, null));
// ensure we have 2 accessions in DB
assertEquals(2, accessionRepository.count());
/*@formatter:off*/
mockMvc
.perform(post(AccessionController.CONTROLLER_URL + "/list")
.contentType(MediaType.APPLICATION_JSON)
.content(String.format("{\"accessionNumber\":{\"contains\":\"%s\"}}", ACCENUMB_1)))
// .andDo(MockMvcResultHandlers.print())
.andExpect(status().isOk())
.andExpect(content().contentType(MediaType.APPLICATION_JSON_VALUE))
.andExpect(jsonPath("$", not(nullValue())))
.andExpect(jsonPath("$.totalElements", is(1)))
.andExpect(jsonPath("$.content").isArray())
.andExpect(jsonPath("$.content[0].accessionNumber", is(ACCENUMB_1)))
;
mockMvc
.perform(post(AccessionController.CONTROLLER_URL + "/list")
.contentType(MediaType.APPLICATION_JSON)
.content(String.format("{\"accessionNumber\":{\"contains\":[\"%1s\",\"%2s\"]}}", ACCENUMB_1, ACCENUMB_2)))
// .andDo(MockMvcResultHandlers.print())
.andExpect(status().isOk())
.andExpect(content().contentType(MediaType.APPLICATION_JSON_VALUE))
.andExpect(jsonPath("$", not(nullValue())))
.andExpect(jsonPath("$.totalElements", is(2)))
.andExpect(jsonPath("$.content").isArray())
.andExpect(jsonPath("$.content[0].accessionNumber", is(oneOf(ACCENUMB_1, ACCENUMB_2))))
.andExpect(jsonPath("$.content[1].accessionNumber", is(oneOf(ACCENUMB_1, ACCENUMB_2))))
;
/*@formatter:on*/
}
@Test
public void taxonomyFilterTest() throws Exception {
ObjectNode accessionJson = setUpAccession();
......
......@@ -15,11 +15,9 @@
*/
package org.genesys.test.server.api.v1;
import static org.hamcrest.Matchers.*;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.*;
import static org.springframework.restdocs.mockmvc.MockMvcRestDocumentation.*;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*;
......@@ -28,7 +26,6 @@ import java.util.HashSet;
import java.util.Set;
import java.util.UUID;
import org.genesys.blocks.model.filters.StringFilter;
import org.genesys.catalog.model.dataset.Dataset;
import org.genesys.catalog.model.dataset.DatasetAccessionRef;
import org.genesys.catalog.model.dataset.DatasetCreator;
......@@ -532,12 +529,9 @@ public class DatasetControllerTest extends AbstractDatasetControllerTest {
assertThat(datasetRepository.count(), is(2L));
final DatasetFilter datasetFilter = new DatasetFilter();
final StringFilter datasetTitle = new StringFilter();
datasetTitle.contains = "two";
datasetFilter.title = datasetTitle;
datasetFilter.title().contains