-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'kitodo:master' into master
- Loading branch information
Showing
3 changed files
with
63 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
Kitodo/src/test/java/org/kitodo/production/services/catalogimport/ImportServiceTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/* | ||
* (c) Kitodo. Key to digital objects e. V. <[email protected]> | ||
* | ||
* This file is part of the Kitodo project. | ||
* | ||
* It is licensed under GNU General Public License version 3 or later. | ||
* | ||
* For the full copyright and license information, please read the | ||
* GPL3-License.txt file that was distributed with this source code. | ||
*/ | ||
|
||
package org.kitodo.production.services.catalogimport; | ||
|
||
import org.junit.Assert; | ||
import org.junit.Test; | ||
import org.kitodo.api.externaldatamanagement.ImportConfigurationType; | ||
import org.kitodo.api.externaldatamanagement.SearchInterfaceType; | ||
import org.kitodo.data.database.beans.ImportConfiguration; | ||
import org.kitodo.production.services.data.ImportService; | ||
|
||
public class ImportServiceTest { | ||
|
||
/** | ||
* Test whether hit list is properly skipped for FTP type import configurations. | ||
*/ | ||
@Test | ||
public void shouldSkipHitListForFtpImportConfiguration() { | ||
ImportConfiguration ftpConfiguration = createFtpImportConfiguration(); | ||
Assert.assertTrue("'Skip hit list' should return 'true' for FTP configurations", | ||
ImportService.skipHitlist(ftpConfiguration, null)); | ||
} | ||
|
||
/** | ||
* Create and return an ImportConfiguration with configuration type `OPAC_SEARCH` and search interface type 'FTP'. | ||
*/ | ||
private ImportConfiguration createFtpImportConfiguration() { | ||
ImportConfiguration genericFtpConfiguration = new ImportConfiguration(); | ||
genericFtpConfiguration.setTitle("FTP example configuration"); | ||
genericFtpConfiguration.setConfigurationType(ImportConfigurationType.OPAC_SEARCH.name()); | ||
genericFtpConfiguration.setInterfaceType(SearchInterfaceType.FTP.name()); | ||
return genericFtpConfiguration; | ||
} | ||
} |