-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix formatting of instant into string (#62)
* Fix instant to string issue for S3 * Adds formatted instant test * Formatting, import optimizing, removal of misleading with clause
- Loading branch information
1 parent
1adfff0
commit 8fbed1b
Showing
2 changed files
with
26 additions
and
2 deletions.
There are no files selected for viewing
4 changes: 2 additions & 2 deletions
4
src/main/scala/io/epiphanous/flinkrunner/util/InstantUtils.scala
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
24 changes: 24 additions & 0 deletions
24
src/test/scala/io/epiphanous/flinkrunner/util/InstantUtilsTest.scala
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,24 @@ | ||
package io.epiphanous.flinkrunner.util | ||
|
||
import io.epiphanous.flinkrunner.PropSpec | ||
import io.epiphanous.flinkrunner.util.InstantUtils.RichInstant | ||
|
||
import java.time.Instant | ||
|
||
class InstantUtilsTest extends PropSpec { | ||
|
||
property("Adds Prefix") { | ||
val prefix = "prefix" | ||
val zero_time = RichInstant(Instant.ofEpochSecond(0)) | ||
val formatted_string = "prefix/1970/01/01/00" | ||
zero_time.prefixedTimePath(prefix) shouldEqual formatted_string | ||
} | ||
|
||
property("does not need a prefix") { | ||
val prefix = "" | ||
val zero_time = RichInstant(Instant.ofEpochSecond(0)) | ||
val formatted_string = "/1970/01/01/00" | ||
zero_time.prefixedTimePath(prefix) shouldEqual formatted_string | ||
} | ||
|
||
} |