-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
52 additions
and
0 deletions.
There are no files selected for viewing
52 changes: 52 additions & 0 deletions
52
arc-core/src/test/java/fr/insee/arc/core/service/p1reception/provider/DirectoryPathTest.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,52 @@ | ||
package fr.insee.arc.core.service.p1reception.provider; | ||
|
||
import static org.junit.Assert.assertEquals; | ||
|
||
import java.io.File; | ||
import java.lang.reflect.InvocationTargetException; | ||
import java.time.Year; | ||
|
||
import org.junit.Test; | ||
|
||
import fr.insee.arc.utils.utils.PrivateConstructorTest; | ||
|
||
public class DirectoryPathTest { | ||
|
||
@Test | ||
public void testDirectoryPathIsUtilityClass() throws NoSuchMethodException, InvocationTargetException, InstantiationException, IllegalAccessException { | ||
PrivateConstructorTest.testConstructorIsPrivate(DirectoryPath.class); | ||
} | ||
|
||
@Test | ||
public void directoryReceptionRootTest() | ||
{ | ||
assertEquals(new File("/root/ARC_BAS1/RECEPTION").toPath(),new File(DirectoryPath.directoryReceptionRoot("/root","arc_bas1")).toPath()); | ||
} | ||
|
||
@Test | ||
public void s3ReceptionEntrepotArchiveTest() | ||
{ | ||
assertEquals(new File("/root/RECEPTION_ENTREPOT_ARCHIVE").toPath(),new File(DirectoryPath.s3ReceptionEntrepotArchive("root","ENTREPOT")).toPath()); | ||
} | ||
|
||
@Test | ||
public void s3ReceptionEntrepotKOTest() | ||
{ | ||
assertEquals(new File("/root/RECEPTION_ENTREPOT_KO").toPath(),new File(DirectoryPath.s3ReceptionEntrepotKO("root","ENTREPOT")).toPath()); | ||
} | ||
|
||
@Test | ||
public void directoryReceptionEntrepotArchiveOldTest() | ||
{ | ||
assertEquals(new File("/root/ARC_BAS1/RECEPTION_ENTREPOT_ARCHIVE/OLD").toPath(),new File(DirectoryPath.directoryReceptionEntrepotArchiveOld("/root","arc_bas1", "ENTREPOT")).toPath()); | ||
} | ||
|
||
@Test | ||
public void directoryReceptionEntrepotArchiveOldYearStampedTest() | ||
{ | ||
assertEquals(new File(("/root/ARC_BAS1/RECEPTION_ENTREPOT_ARCHIVE/OLD/"+Year.now().getValue())).toPath(),new File(DirectoryPath.directoryReceptionEntrepotArchiveOldYearStamped("/root","arc_bas1", "ENTREPOT")).toPath()); | ||
} | ||
|
||
|
||
|
||
} |