Skip to content

Commit

Permalink
fixed pmd
Browse files Browse the repository at this point in the history
  • Loading branch information
StigNorland committed Nov 14, 2023
1 parent 2163aed commit 4bcdc4d
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,43 +54,43 @@ public enum ResourceParameterKey implements ParameterKey {
+ PIPE + Constants.ENTITY_DESCRIPTION_CONTRIBUTORS_IDENTITY_NAME),
CONTRIBUTOR_NOT(KEYWORD, MUST_NOT, Constants.ENTITY_DESCRIPTION_CONTRIBUTORS_IDENTITY_ID
+ PIPE + Constants.ENTITY_DESCRIPTION_CONTRIBUTORS_IDENTITY_NAME),
CONTRIBUTOR_SHOULD(KEYWORD, SHOULD, Constants.ENTITY_DESCRIPTION_CONTRIBUTORS_IDENTITY_ID
CONTRIBUTOR_SHOULD(TEXT, SHOULD, Constants.ENTITY_DESCRIPTION_CONTRIBUTORS_IDENTITY_ID
+ PIPE + Constants.ENTITY_DESCRIPTION_CONTRIBUTORS_IDENTITY_NAME),
CREATED_BEFORE(DATE, LESS_THAN, Constants.CREATED_DATE),
CREATED_SINCE(DATE, GREATER_THAN_OR_EQUAL_TO, Constants.CREATED_DATE),
DOI(TEXT, Constants.ENTITY_DESCRIPTION_REFERENCE_DOI),
DOI(KEYWORD, Constants.ENTITY_DESCRIPTION_REFERENCE_DOI),
DOI_NOT(TEXT, MUST_NOT, Constants.ENTITY_DESCRIPTION_REFERENCE_DOI),
DOI_SHOULD(TEXT, SHOULD, Constants.ENTITY_DESCRIPTION_REFERENCE_DOI),
FUNDING(KEYWORD, MUST, Constants.FUNDINGS_IDENTIFIER_FUNDINGS_SOURCE_IDENTIFIER,
null, PATTERN_IS_FUNDING, null),
FUNDING_SOURCE(TEXT, Constants.FUNDINGS_SOURCE_IDENTIFIER_FUNDINGS_SOURCE_LABELS),
FUNDING_SOURCE_NOT(TEXT, MUST_NOT, Constants.FUNDINGS_SOURCE_IDENTIFIER_FUNDINGS_SOURCE_LABELS),
FUNDING_SOURCE_SHOULD(KEYWORD, SHOULD, Constants.FUNDINGS_SOURCE_IDENTIFIER_FUNDINGS_SOURCE_LABELS),
ID(TEXT, Constants.IDENTIFIER),
ID_NOT(TEXT, MUST_NOT, Constants.IDENTIFIER),
FUNDING_SOURCE(KEYWORD, Constants.FUNDINGS_SOURCE_IDENTIFIER_FUNDINGS_SOURCE_LABELS),
FUNDING_SOURCE_NOT(KEYWORD, MUST_NOT, Constants.FUNDINGS_SOURCE_IDENTIFIER_FUNDINGS_SOURCE_LABELS),
FUNDING_SOURCE_SHOULD(TEXT, SHOULD, Constants.FUNDINGS_SOURCE_IDENTIFIER_FUNDINGS_SOURCE_LABELS),
ID(KEYWORD, Constants.IDENTIFIER),
ID_NOT(KEYWORD, MUST_NOT, Constants.IDENTIFIER),
ID_SHOULD(TEXT, SHOULD, Constants.IDENTIFIER),
INSTITUTION(TEXT, Constants.ENTITY_DESCRIPTION_CONTRIBUTORS_AFFILIATION_ID + PIPE
INSTITUTION(KEYWORD, Constants.ENTITY_DESCRIPTION_CONTRIBUTORS_AFFILIATION_ID + PIPE
+ Constants.ENTITY_DESCRIPTION_CONTRIBUTORS_AFFILIATION_NAME),
INSTITUTION_NOT(TEXT, MUST_NOT, Constants.ENTITY_DESCRIPTION_CONTRIBUTORS_AFFILIATION_ID + PIPE
INSTITUTION_NOT(KEYWORD, MUST_NOT, Constants.ENTITY_DESCRIPTION_CONTRIBUTORS_AFFILIATION_ID + PIPE
+ Constants.ENTITY_DESCRIPTION_CONTRIBUTORS_AFFILIATION_NAME),
INSTITUTION_SHOULD(TEXT, SHOULD, Constants.ENTITY_DESCRIPTION_CONTRIBUTORS_AFFILIATION_ID + PIPE
+ Constants.ENTITY_DESCRIPTION_CONTRIBUTORS_AFFILIATION_NAME),
ISBN(TEXT, Constants.ENTITY_DESCRIPTION_REFERENCE_PUBLICATION_CONTEXT_ISBN_LIST),
ISBN_NOT(TEXT, MUST_NOT, Constants.ENTITY_DESCRIPTION_REFERENCE_PUBLICATION_CONTEXT_ISBN_LIST),
ISBN(KEYWORD, Constants.ENTITY_DESCRIPTION_REFERENCE_PUBLICATION_CONTEXT_ISBN_LIST),
ISBN_NOT(KEYWORD, MUST_NOT, Constants.ENTITY_DESCRIPTION_REFERENCE_PUBLICATION_CONTEXT_ISBN_LIST),
ISBN_SHOULD(TEXT, SHOULD, Constants.ENTITY_DESCRIPTION_REFERENCE_PUBLICATION_CONTEXT_ISBN_LIST),
ISSN(TEXT, Constants.ENTITY_DESCRIPTION_REFERENCE_PUBLICATION_CONTEXT_ONLINE_ISSN
ISSN(KEYWORD, Constants.ENTITY_DESCRIPTION_REFERENCE_PUBLICATION_CONTEXT_ONLINE_ISSN
+ PIPE + Constants.ENTITY_DESCRIPTION_REFERENCE_PUBLICATION_CONTEXT_PRINT_ISSN),
ISSN_NOT(TEXT, MUST_NOT, Constants.ENTITY_DESCRIPTION_REFERENCE_PUBLICATION_CONTEXT_ONLINE_ISSN
ISSN_NOT(KEYWORD, MUST_NOT, Constants.ENTITY_DESCRIPTION_REFERENCE_PUBLICATION_CONTEXT_ONLINE_ISSN
+ PIPE + Constants.ENTITY_DESCRIPTION_REFERENCE_PUBLICATION_CONTEXT_PRINT_ISSN),
ISSN_SHOULD(TEXT, SHOULD, Constants.ENTITY_DESCRIPTION_REFERENCE_PUBLICATION_CONTEXT_ONLINE_ISSN
+ PIPE + Constants.ENTITY_DESCRIPTION_REFERENCE_PUBLICATION_CONTEXT_PRINT_ISSN),
ORCID(TEXT, Constants.ENTITY_DESCRIPTION_CONTRIBUTORS_IDENTITY_ORC_ID),
ORCID_NOT(TEXT, MUST_NOT, Constants.ENTITY_DESCRIPTION_CONTRIBUTORS_IDENTITY_ORC_ID),
ORCID(KEYWORD, Constants.ENTITY_DESCRIPTION_CONTRIBUTORS_IDENTITY_ORC_ID),
ORCID_NOT(KEYWORD, MUST_NOT, Constants.ENTITY_DESCRIPTION_CONTRIBUTORS_IDENTITY_ORC_ID),
ORCID_SHOULD(TEXT, SHOULD, Constants.ENTITY_DESCRIPTION_CONTRIBUTORS_IDENTITY_ORC_ID),
MODIFIED_BEFORE(DATE, LESS_THAN, Constants.MODIFIED_DATE),
MODIFIED_SINCE(DATE, GREATER_THAN_OR_EQUAL_TO, Constants.MODIFIED_DATE),
PROJECT(TEXT, Constants.PROJECTS_ID),
PROJECT_NOT(TEXT, MUST_NOT, Constants.PROJECTS_ID),
PROJECT(KEYWORD, Constants.PROJECTS_ID),
PROJECT_NOT(KEYWORD, MUST_NOT, Constants.PROJECTS_ID),
PROJECT_SHOULD(TEXT, SHOULD, Constants.PROJECTS_ID),
PUBLISHED_BEFORE(DATE, LESS_THAN, Constants.PUBLISHED_DATE),
PUBLISHED_SINCE(DATE, GREATER_THAN_OR_EQUAL_TO, Constants.PUBLISHED_DATE),
Expand All @@ -99,9 +99,9 @@ public enum ResourceParameterKey implements ParameterKey {
TITLE_SHOULD(TEXT, SHOULD, Constants.MAIN_TITLE),
UNIT(KEYWORD, Constants.ENTITY_DESCRIPTION_CONTRIBUTORS_AFFILIATION_ID),
UNIT_NOT(KEYWORD, MUST_NOT, Constants.ENTITY_DESCRIPTION_CONTRIBUTORS_AFFILIATION_ID),
UNIT_SHOULD(KEYWORD, SHOULD, Constants.ENTITY_DESCRIPTION_CONTRIBUTORS_AFFILIATION_ID),
USER(TEXT, Constants.RESOURCE_OWNER),
USER_NOT(TEXT, MUST_NOT, Constants.RESOURCE_OWNER),
UNIT_SHOULD(TEXT, SHOULD, Constants.ENTITY_DESCRIPTION_CONTRIBUTORS_AFFILIATION_ID),
USER(KEYWORD, Constants.RESOURCE_OWNER),
USER_NOT(KEYWORD, MUST_NOT, Constants.RESOURCE_OWNER),
USER_SHOULD(TEXT, SHOULD, Constants.RESOURCE_OWNER),
PUBLICATION_YEAR(NUMBER, MUST, Constants.ENTITY_DESCRIPTION_PUBLICATION_DATE_YEAR,
"(?i)year.?reported|publication.?year", null, null),
Expand Down Expand Up @@ -290,7 +290,9 @@ private static class Constants {
public static final String ENTITY_DESCRIPTION_CONTRIBUTORS_AFFILIATION_ID =
"entityDescription.contributors.affiliations.id.keyword";
public static final String ENTITY_DESCRIPTION_CONTRIBUTORS_AFFILIATION_NAME =
"entityDescription.contributors.affiliations.labels.*.keyword";
"entityDescription.contributors.affiliations.labels.nb.keyword"
+ "|entityDescription.contributors.affiliations.labels.n n.keyword"
+ "|entityDescription.contributors.affiliations.labels.en.keyword";
public static final String ENTITY_DESCRIPTION_CONTRIBUTORS_IDENTITY_ID =
"entityDescription.contributors.identity.id";
public static final String ENTITY_DESCRIPTION_CONTRIBUTORS_IDENTITY_NAME =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ void searchWithUriReturnsOpenSearchAwsResponse(URI uri) throws ApiGatewayExcepti
var pagedSearchResourceDto = query.toPagedResponse(response);

assertNotNull(pagedSearchResourceDto);
logger.info(pagedSearchResourceDto.toJsonString());
assertThat(pagedSearchResourceDto.totalHits(), is(equalTo(pagedSearchResourceDto.hits().size())));
}

Expand All @@ -121,7 +122,7 @@ static Stream<URI> uriProvider() {
URI.create("https://x.org/?CONTRIBUTOR_NOT=https://api.dev.nva.aws.unit.no/cristin/person/1136254,"
+ "https://api.dev.nva.aws.unit.no/cristin/person/1136918&size=18"),
URI.create("https://x.org/?CONTRIBUTOR_SHOULD=https://api.dev.nva.aws.unit.no/cristin/person/1136254,"
+ "https://api.dev.nva.aws.unit.no/cristin/person/1136918&size=10"),
+ "person/1136918&size=10"),
URI.create("https://x.org/?INSTITUTION="
+ "https://api.dev.nva.aws.unit.no/cristin/organization/1627.0.0.0&size=2"),
URI.create("https://x.org//?INSTITUTION_NOT="
Expand All @@ -143,9 +144,9 @@ static Stream<URI> uriProvider() {
URI.create("https://x.org/?funding=AFR:296896&size=2"),
URI.create("https://x.org/?funding=NFR:1296896&size=2"),
URI.create("https://x.org/?funding=NFR:296896&size=2"),
URI.create("https://x.org/?funding_source_should=Norges+forskningsråd&size=2"),
URI.create("https://x.org/?funding_source_not=Norges&size=19"),
URI.create("https://x.org/?funding_source=Norges&size=2"),
URI.create("https://x.org/?funding_source=Norges+forskningsråd&size=2"),
URI.create("https://x.org/?funding_source_not=Norges+forskningsråd&size=19"),
URI.create("https://x.org/?funding_source_SHOULD=Norges+epler&size=2"),
URI.create("https://x.org/?funding_source=Research+Council+of+Norway+(RCN)&size=2"),
URI.create("https://x.org/?published_before=2020-01-01&size=2"),
URI.create("https://x.org/?published_since=2023-11-05&size=2"),
Expand Down

0 comments on commit 4bcdc4d

Please sign in to comment.