-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add delta nnode header to responses (#4624)
Co-authored-by: Simon Dumas <[email protected]>
- Loading branch information
Showing
4 changed files
with
68 additions
and
17 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
28 changes: 28 additions & 0 deletions
28
.../src/test/scala/ch/epfl/bluebrain/nexus/delta/sourcing/config/ProjectionConfigSuite.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,28 @@ | ||
package ch.epfl.bluebrain.nexus.delta.sourcing.config | ||
|
||
import ch.epfl.bluebrain.nexus.delta.sourcing.config.ProjectionConfig.ClusterConfig | ||
import ch.epfl.bluebrain.nexus.testkit.mu.NexusSuite | ||
import pureconfig.ConfigSource | ||
|
||
class ProjectionConfigSuite extends NexusSuite { | ||
|
||
private def parseConfig(nodeIndex: Int, size: Int) = | ||
ConfigSource | ||
.string(s""" | ||
|cluster { | ||
| node-index = $nodeIndex | ||
| size = $size | ||
|} | ||
|""".stripMargin) | ||
.at("cluster") | ||
.load[ClusterConfig] | ||
|
||
test("Parse successfully when the node index is lower than the cluster size") { | ||
parseConfig(1, 2).assertRight(ClusterConfig(2, 1)) | ||
} | ||
|
||
test("Fail to parse when the node index is higher than the cluster size") { | ||
parseConfig(2, 1).assertLeft() | ||
} | ||
|
||
} |
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