File tree 2 files changed +9
-6
lines changed
main/java/dev/openfeature/sdk
test/java/dev/openfeature/sdk
2 files changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ public Set<String> keySet() {
50
50
@ Override
51
51
public Value getValue (String key ) {
52
52
Value value = this .attributes .get (key );
53
- return value .clone ();
53
+ return value != null ? value .clone () : null ;
54
54
}
55
55
56
56
/**
Original file line number Diff line number Diff line change 10
10
import java .util .Map ;
11
11
import java .util .Set ;
12
12
13
- import static org .junit .jupiter .api .Assertions .assertArrayEquals ;
14
- import static org .junit .jupiter .api .Assertions .assertEquals ;
15
- import static org .junit .jupiter .api .Assertions .assertNotEquals ;
16
- import static org .junit .jupiter .api .Assertions .assertNotSame ;
17
- import static org .junit .jupiter .api .Assertions .assertTrue ;
13
+ import static org .junit .jupiter .api .Assertions .*;
18
14
19
15
class ImmutableStructureTest {
20
16
@ Test void noArgShouldContainEmptyAttributes () {
@@ -108,4 +104,11 @@ void ModifyingTheValuesReturnByTheKeySetMethodShouldNotModifyTheUnderlyingImmuta
108
104
keys .remove ("key1" );
109
105
assertEquals (2 , structure .keySet ().size ());
110
106
}
107
+
108
+ @ Test
109
+ void GettingAMissingValueShouldReturnNull () {
110
+ ImmutableStructure structure = new ImmutableStructure ();
111
+ Object value = structure .getValue ("missing" );
112
+ assertNull (value );
113
+ }
111
114
}
You can’t perform that action at this time.
0 commit comments