diff --git a/oaipmh-core/src/main/java/info/textgrid/middleware/RecordDelivererDatacite.java b/oaipmh-core/src/main/java/info/textgrid/middleware/RecordDelivererDatacite.java index 851b89ddeb48b2ea1f275e5668fca6069fd1386f..aef498787294ca6d37a0140df95e67b101087cab 100644 --- a/oaipmh-core/src/main/java/info/textgrid/middleware/RecordDelivererDatacite.java +++ b/oaipmh-core/src/main/java/info/textgrid/middleware/RecordDelivererDatacite.java @@ -48,7 +48,7 @@ import info.textgrid.middleware.oaipmh.Resource.Titles.Title; /** * @author Maximilian Brodhun, SUB Göttingen * @author Stefan E. Funk, SUB Göttingen - * @version 2023-01-03 + * @version 2023-01-06 * @since 2020-06-13 */ @Component @@ -181,7 +181,7 @@ public class RecordDelivererDatacite extends RecordDelivererAbstract { Resource result = new Resource(); Titles titles = addTitles(); - if (titles != null && !titles.getTitle().isEmpty()) { + if (titles.getTitle() != null && !titles.getTitle().isEmpty()) { result.setTitles(titles); } String publisher = addPublisher(); @@ -193,11 +193,11 @@ public class RecordDelivererDatacite extends RecordDelivererAbstract { result.setPublicationYear(publicationYear); } Dates dates = this.addDates(); - if (dates != null && !dates.getDate().isEmpty()) { + if (dates.getDate() != null && !dates.getDate().isEmpty()) { result.setDates(dates); } Contributors contributors = addContributors(); - if (contributors != null && !contributors.getContributor().isEmpty()) { + if (contributors.getContributor() != null && !contributors.getContributor().isEmpty()) { result.setContributors(contributors); } String language = addLanguage(); @@ -205,40 +205,41 @@ public class RecordDelivererDatacite extends RecordDelivererAbstract { result.setLanguage(language); } AlternateIdentifiers alternateIdentifiers = addAlternateIdentifiers(); - if (alternateIdentifiers != null && !alternateIdentifiers.getAlternateIdentifier().isEmpty()) { + if (alternateIdentifiers.getAlternateIdentifier() != null + && !alternateIdentifiers.getAlternateIdentifier().isEmpty()) { result.setAlternateIdentifiers(alternateIdentifiers); } Formats formats = addFormats(); - if (formats != null && !formats.getFormat().isEmpty()) { + if (formats.getFormat() != null && !formats.getFormat().isEmpty()) { result.setFormats(formats); } RightsList rights = addRights(); - if (rights != null && !rights.getRights().isEmpty()) { + if (rights.getRights() != null && !rights.getRights().isEmpty()) { result.setRightsList(rights); } Descriptions descriptions = addDescriptions(); - if (descriptions != null && !descriptions.getDescription().isEmpty()) { + if (descriptions.getDescription() != null && !descriptions.getDescription().isEmpty()) { result.setDescriptions(descriptions); } RelatedIdentifiers relatedIdentifiers = addRelatedIdentifiers(); - if (relatedIdentifiers != null && !relatedIdentifiers.getRelatedIdentifier().isEmpty()) { + if (relatedIdentifiers.getRelatedIdentifier() != null + && !relatedIdentifiers.getRelatedIdentifier().isEmpty()) { result.setRelatedIdentifiers(relatedIdentifiers); } Identifier identifier = addIdentifier(); - if (identifier != null && !identifier.getValue().isEmpty() - && identifier.getIdentifierType() != null && !identifier.getIdentifierType().isEmpty()) { + if (identifier.getValue() != null && !identifier.getValue().isEmpty()) { result.setIdentifier(identifier); } Creators creators = addCreators(); - if (creators != null && !creators.getCreator().isEmpty()) { + if (creators.getCreator() != null && !creators.getCreator().isEmpty()) { result.setCreators(creators); } GeoLocations geoLocations = addGeoLocation(); - if (geoLocations != null && !geoLocations.getGeoLocation().isEmpty()) { + if (geoLocations.getGeoLocation() != null && !geoLocations.getGeoLocation().isEmpty()) { result.setGeoLocations(geoLocations); } ResourceType resourceType = addResourceType(); - if (resourceType != null && !resourceType.getValue().isEmpty()) { + if (resourceType.getValue() != null && !resourceType.getValue().isEmpty()) { result.setResourceType(resourceType); } String version = addVersion(); @@ -246,11 +247,11 @@ public class RecordDelivererDatacite extends RecordDelivererAbstract { result.setVersion(version); } Subjects subjects = addSubjects(); - if (subjects != null && !subjects.getSubject().isEmpty()) { + if (subjects.getSubject() != null && !subjects.getSubject().isEmpty()) { result.setSubjects(subjects); } Sizes sizes = addSizes(); - if (sizes != null && !sizes.getSize().isEmpty()) { + if (sizes.getSize() != null && !sizes.getSize().isEmpty()) { result.setSizes(sizes); } diff --git a/oaipmh-core/src/test/java/info/textgrid/middleware/test/online/OaipmhUtilitiesOnline.java b/oaipmh-core/src/test/java/info/textgrid/middleware/test/online/OaipmhUtilitiesOnline.java index cec44700696606c03705de0a6746f5f7e78f0d65..b569a91477f3b91c10416bf728c3ee242cf81c4e 100644 --- a/oaipmh-core/src/test/java/info/textgrid/middleware/test/online/OaipmhUtilitiesOnline.java +++ b/oaipmh-core/src/test/java/info/textgrid/middleware/test/online/OaipmhUtilitiesOnline.java @@ -51,8 +51,8 @@ public class OaipmhUtilitiesOnline { public static final String PROPERTIES_FILE = "oaipmh.test.textgridlab-org.properties"; // public static final String PROPERTIES_FILE = "oaipmh.test.dev-textgridlab-org.properties"; - public static final boolean TEST_ALL_PAGES = false; - // public static final boolean TEST_ALL_PAGES = true; + // public static final boolean TEST_ALL_PAGES = false; + public static final boolean TEST_ALL_PAGES = true; // ## CHANGE SETTINGS ABOVE FOR SETTING TEST SCOPE ---------------------------------------------