3030
3131import static org .junit .Assert .assertEquals ;
3232import static org .junit .Assert .assertTrue ;
33+ import static org .spine3 .base .Mismatch .getActualString ;
34+ import static org .spine3 .base .Mismatch .getExpectedString ;
3335import static org .spine3 .protobuf .AnyPacker .unpack ;
3436import static org .spine3 .protobuf .Values .newStringValue ;
3537import static org .spine3 .test .Tests .hasPrivateUtilityConstructor ;
@@ -83,7 +85,6 @@ public void return_mismatch_object_with_string_values() {
8385 public void return_mismatch_object_with_int32_values () {
8486 final int expected = 0 ;
8587 final int actual = 1 ;
86- final int requested = 2 ;
8788 final ValueMismatch mismatch = Mismatch .of (expected , actual , VERSION );
8889 final Int32Value expectedWrapper = unpack (mismatch .getExpected ());
8990 final Int32Value actualWrapper = unpack (mismatch .getActual ());
@@ -96,7 +97,6 @@ public void return_mismatch_object_with_int32_values() {
9697 public void return_mismatch_object_with_int64_values () {
9798 final long expected = 0L ;
9899 final long actual = 1L ;
99- final long requested = 2L ;
100100 final ValueMismatch mismatch = Mismatch .of (expected , actual , VERSION );
101101 final Int64Value expectedWrapped = unpack (mismatch .getExpected ());
102102 final Int64Value actualWrapped = unpack (mismatch .getActual ());
@@ -109,7 +109,6 @@ public void return_mismatch_object_with_int64_values() {
109109 public void return_mismatch_object_with_float_values () {
110110 final float expected = 0.0F ;
111111 final float actual = 1.0F ;
112- final float requested = 2.0F ;
113112 final ValueMismatch mismatch = Mismatch .of (expected , actual , VERSION );
114113 final FloatValue expectedWrapped = unpack (mismatch .getExpected ());
115114 final FloatValue actualWrapped = unpack (mismatch .getActual ());
@@ -122,7 +121,6 @@ public void return_mismatch_object_with_float_values() {
122121 public void return_mismatch_object_with_double_values () {
123122 final double expected = 0.1 ;
124123 final double actual = 0.2 ;
125- final double requested = 0.3 ;
126124 final ValueMismatch mismatch = Mismatch .of (expected , actual , VERSION );
127125 final DoubleValue expectedWrapped = unpack (mismatch .getExpected ());
128126 final DoubleValue actualWrapped = unpack (mismatch .getActual ());
@@ -135,7 +133,6 @@ public void return_mismatch_object_with_double_values() {
135133 public void return_mismatch_object_with_boolean_values () {
136134 final boolean expected = true ;
137135 final boolean actual = false ;
138- final boolean requested = true ;
139136 final ValueMismatch mismatch = Mismatch .of (expected , actual , VERSION );
140137 final BoolValue expectedWrapped = unpack (mismatch .getExpected ());
141138 final BoolValue actualWrapped = unpack (mismatch .getActual ());
@@ -171,4 +168,16 @@ public void return_mismatch_object_with_message_values() {
171168 assertEquals (EXPECTED , expected .getValue ());
172169 assertEquals (ACTUAL , actual .getValue ());
173170 }
171+
172+ @ Test
173+ public void return_expected_string () {
174+ final ValueMismatch mismatch = Mismatch .of (newStringValue (EXPECTED ), newStringValue (ACTUAL ), VERSION );
175+ assertEquals (EXPECTED , getExpectedString (mismatch ));
176+ }
177+
178+ @ Test
179+ public void return_actual_string () {
180+ final ValueMismatch mismatch = Mismatch .of (newStringValue (EXPECTED ), newStringValue (ACTUAL ), VERSION );
181+ assertEquals (ACTUAL , getActualString (mismatch ));
182+ }
174183}
0 commit comments