forked from deegree/deegree3
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
deegree#1760 - fixed date formatting
- Loading branch information
Showing
3 changed files
with
50 additions
and
3 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
40 changes: 40 additions & 0 deletions
40
...ee-tools-gml/src/test/java/org/deegree/tools/featurestoresql/loader/ReportWriterTest.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,40 @@ | ||
package org.deegree.tools.featurestoresql.loader; | ||
|
||
import static org.mockito.Mockito.mock; | ||
import static org.mockito.Mockito.when; | ||
|
||
import java.io.IOException; | ||
import java.time.LocalDateTime; | ||
import java.util.Collections; | ||
|
||
import org.junit.Rule; | ||
import org.junit.Test; | ||
import org.junit.rules.TemporaryFolder; | ||
import org.springframework.batch.core.ExitStatus; | ||
import org.springframework.batch.core.JobExecution; | ||
import org.springframework.batch.core.StepExecution; | ||
|
||
/** | ||
* @author <a href="mailto:[email protected]">Lyn Goltz </a> | ||
*/ | ||
public class ReportWriterTest { | ||
|
||
@Rule | ||
public TemporaryFolder tmpFolder = new TemporaryFolder(); | ||
|
||
@Test | ||
public void test() throws IOException { | ||
Summary summary = new Summary(); | ||
ReportWriter reportWriter = new ReportWriter(summary, tmpFolder.newFile().toPath()); | ||
|
||
JobExecution jobExecution = mock(JobExecution.class); | ||
StepExecution stepExecution = mock(StepExecution.class); | ||
when(jobExecution.getStepExecutions()).thenReturn(Collections.singletonList(stepExecution)); | ||
when(stepExecution.getStartTime()).thenReturn(LocalDateTime.now().minusDays(1)); | ||
when(stepExecution.getEndTime()).thenReturn(LocalDateTime.now().minusDays(1)); | ||
when(stepExecution.getExitStatus()).thenReturn(ExitStatus.COMPLETED); | ||
|
||
reportWriter.afterJob(jobExecution); | ||
} | ||
|
||
} |