001/*
002 * Copyright 2015 DuraSpace, Inc.
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 *     http://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016package org.fcrepo.migration.foxml;
017
018import org.junit.Assert;
019import org.junit.Test;
020import org.slf4j.Logger;
021
022import java.io.File;
023import java.io.IOException;
024import static org.slf4j.LoggerFactory.getLogger;
025
026/**
027 * @author awoods
028 * @since 2020-01-27
029 */
030public class AkubraFSIDResolverIT {
031
032    final static Logger LOGGER = getLogger(AkubraFSIDResolverIT.class);
033
034    private static AkubraFSIDResolver resolver;
035
036    @Test
037    public void testWithEmptyIndexDir() throws IOException {
038
039        final File testDir = new File("target/test/akubra");
040        testDir.mkdirs();
041
042        // Create empty dir
043        final File indexDir = new File(testDir, "index");
044        indexDir.mkdirs();
045
046        final File dsRoot = new File("src/test/resources/akubraFS");
047
048        resolver = new AkubraFSIDResolver(indexDir, dsRoot);
049
050        final File[] files = indexDir.listFiles();
051        Assert.assertTrue("There should be index files in the previously empty dir", files.length > 0);
052    }
053
054}