-
Notifications
You must be signed in to change notification settings - Fork 72
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
13 additions
and
15 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
package io.getunleash; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
import static org.assertj.core.data.MapEntry.entry; | ||
|
||
import io.getunleash.util.UnleashConfig; | ||
import org.junit.jupiter.api.Nested; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
import static org.assertj.core.data.MapEntry.entry; | ||
|
||
public class UnleashContextTest { | ||
|
||
@Test | ||
|
@@ -104,13 +104,14 @@ class BuilderTest { | |
|
||
@Test | ||
void should_set_special_properties() { | ||
final UnleashContext context = UnleashContext.builder() | ||
.addProperty("userId", "[email protected]") | ||
.addProperty("sessionId", "123") | ||
.addProperty("remoteAddress", "127.0.0.1") | ||
.addProperty("environment", "env") | ||
.addProperty("appName", "myApp") | ||
.build(); | ||
final UnleashContext context = | ||
UnleashContext.builder() | ||
.addProperty("userId", "[email protected]") | ||
.addProperty("sessionId", "123") | ||
.addProperty("remoteAddress", "127.0.0.1") | ||
.addProperty("environment", "env") | ||
.addProperty("appName", "myApp") | ||
.build(); | ||
|
||
assertThat(context.getUserId()).contains("[email protected]"); | ||
assertThat(context.getSessionId()).contains("123"); | ||
|
@@ -121,13 +122,10 @@ void should_set_special_properties() { | |
|
||
@Test | ||
void should_set_non_special_properties() { | ||
final UnleashContext context = UnleashContext.builder() | ||
.addProperty("foo", "bar") | ||
.build(); | ||
final UnleashContext context = | ||
UnleashContext.builder().addProperty("foo", "bar").build(); | ||
|
||
assertThat(context.getProperties()).containsExactly(entry("foo", "bar")); | ||
} | ||
|
||
} | ||
|
||
} |