18
18
import org .web3j .utils .Numeric ;
19
19
20
20
import static org .hamcrest .CoreMatchers .is ;
21
+ import static org .hamcrest .core .IsEqual .equalTo ;
21
22
import static org .junit .Assert .assertThat ;
22
23
23
24
public class FunctionReturnDecoderTest {
@@ -89,7 +90,7 @@ public void testMultipleResultFunctionDecode() {
89
90
public void testDecodeMultipleStringValues () {
90
91
Function function = new Function ("function" ,
91
92
Collections .<Type >emptyList (),
92
- Arrays .asList (
93
+ Arrays .< TypeReference <?>> asList (
93
94
new TypeReference <Utf8String >() { }, new TypeReference <Utf8String >() { },
94
95
new TypeReference <Utf8String >() { }, new TypeReference <Utf8String >() { }));
95
96
@@ -107,15 +108,17 @@ public void testDecodeMultipleStringValues() {
107
108
"0000000000000000000000000000000000000000000000000000000000000004" +
108
109
"6d6e6f3200000000000000000000000000000000000000000000000000000000" ,
109
110
function .getOutputParameters ()),
110
- equalTo (Arrays .asList (
111
+ equalTo (Arrays .< Type > asList (
111
112
new Utf8String ("def1" ), new Utf8String ("ghi1" ),
112
113
new Utf8String ("jkl1" ), new Utf8String ("mno2" ))));
113
114
}
114
115
115
116
117
+
118
+
116
119
@ Test
117
120
public void testDecodeStaticArrayValue () {
118
- List <TypeReference <Type >> outputParameters = new ArrayList <>(1 );
121
+ List <TypeReference <Type >> outputParameters = new ArrayList <TypeReference < Type > >(1 );
119
122
outputParameters .add ((TypeReference )
120
123
new TypeReference .StaticArrayTypeReference <StaticArray <Uint256 >>(2 ) {});
121
124
outputParameters .add ((TypeReference ) new TypeReference <Uint256 >() {});
@@ -127,10 +130,12 @@ public void testDecodeStaticArrayValue() {
127
130
"000000000000000000000000000000000000000000000000000000000000000a" ,
128
131
outputParameters );
129
132
130
- List <Type > expected = Arrays .asList (
131
- new StaticArray <>(new Uint256 (BigInteger .valueOf (55 )), new Uint256 (BigInteger .ONE )),
133
+ List <Type > expected = Arrays .< Type > asList (
134
+ new StaticArray <Uint256 >(new Uint256 (BigInteger .valueOf (55 )), new Uint256 (BigInteger .ONE )),
132
135
new Uint256 (BigInteger .TEN ));
133
- assertThat (decoded , equalTo (expected ));
136
+
137
+
138
+ assertThat (decoded , is (expected ));
134
139
}
135
140
136
141
@ Test
0 commit comments