3030
3131import java .util .Map ;
3232
33+ import static org .hamcrest .CoreMatchers .is ;
3334import static org .junit .Assert .*;
3435import static uk .co .real_logic .sbe .generation .java .ReflectionUtil .get ;
3536import static uk .co .real_logic .sbe .generation .java .ReflectionUtil .set ;
@@ -87,7 +88,7 @@ public void testMessage1() throws Exception
8788 assertEquals (100 , get (decoderVersion0 , "tag1" ));
8889 assertEquals (Integer .MIN_VALUE , get (decoderVersion0 , "tag2" ));
8990 assertNull (get (decoderVersion0 , "tag3" ));
90- assertNull (get (decoderVersion0 , "tag4" ));
91+ assertThat (get (decoderVersion0 , "tag4" ). toString (), is ( "NULL_VAL " ));
9192 assertNull (get (decoderVersion0 , "tag5" ));
9293
9394 assertEquals (0 , decoderVersion0 .getClass ().getMethod ("tag1SinceVersion" ).invoke (null ));
@@ -102,7 +103,7 @@ public void testMessage1() throws Exception
102103 assertEquals (100 , get (decoderVersion1 , "tag1" ));
103104 assertEquals (200 , get (decoderVersion1 , "tag2" ));
104105 assertNull (get (decoderVersion1 , "tag3" ));
105- assertNull (get (decoderVersion1 , "tag4" ));
106+ assertThat (get (decoderVersion1 , "tag4" ). toString (), is ( "NULL_VAL " ));
106107 assertNull (get (decoderVersion1 , "tag5" ));
107108 }
108109
@@ -113,7 +114,7 @@ public void testMessage1() throws Exception
113114 final Object compositeDecoder2 = get (decoderVersion2 , "tag3" );
114115 assertNotNull (compositeDecoder2 );
115116 assertEquals (300 , get (compositeDecoder2 , "value" ));
116- assertNull (get (decoderVersion2 , "tag4" ));
117+ assertThat (get (decoderVersion2 , "tag4" ). toString (), is ( "NULL_VAL " ));
117118 assertNull (get (decoderVersion2 , "tag5" ));
118119 }
119120
@@ -172,7 +173,7 @@ public void testMessage2() throws Exception
172173 assertEquals (100 , get (decoderVersion0 , "tag1" ));
173174 assertEquals (Integer .MIN_VALUE , get (decoderVersion0 , "tag2" ));
174175 assertNull (get (decoderVersion0 , "tag3" ));
175- assertNull (get (decoderVersion0 , "tag4" ));
176+ assertThat (get (decoderVersion0 , "tag4" ). toString (), is ( "NULL_VAL " ));
176177 assertNull (get (decoderVersion0 , "tag5" ));
177178
178179 assertEquals (0 , decoderVersion0 .getClass ().getMethod ("tag1SinceVersion" ).invoke (null ));
@@ -189,7 +190,7 @@ public void testMessage2() throws Exception
189190 final Object compositeDecoder2 = get (decoderVersion1 , "tag3" );
190191 assertNotNull (compositeDecoder2 );
191192 assertEquals (300 , get (compositeDecoder2 , "value" ));
192- assertNull (get (decoderVersion1 , "tag4" ));
193+ assertThat (get (decoderVersion1 , "tag4" ). toString (), is ( "NULL_VAL " ));
193194 assertNull (get (decoderVersion1 , "tag5" ));
194195 }
195196
@@ -200,7 +201,7 @@ public void testMessage2() throws Exception
200201 final Object compositeDecoder2 = get (decoderVersion2 , "tag3" );
201202 assertNotNull (compositeDecoder2 );
202203 assertEquals (300 , get (compositeDecoder2 , "value" ));
203- assertNull (get (decoderVersion2 , "tag4" ));
204+ assertThat (get (decoderVersion2 , "tag4" ). toString (), is ( "NULL_VAL " ));
204205 assertNull (get (decoderVersion2 , "tag5" ));
205206 }
206207
@@ -211,7 +212,7 @@ public void testMessage2() throws Exception
211212 final Object compositeDecoder3 = get (decoderVersion3 , "tag3" );
212213 assertNotNull (compositeDecoder3 );
213214 assertEquals (300 , get (compositeDecoder3 , "value" ));
214- assertNull (get (decoderVersion3 , "tag4" ));
215+ assertThat (get (decoderVersion3 , "tag4" ). toString (), is ( "NULL_VAL " ));
215216 final Object setDecoder = get (decoderVersion3 , "tag5" );
216217 assertNotNull (setDecoder );
217218 assertEquals (false , get (setDecoder , "firstChoice" ));
0 commit comments