|
11 | 11 | import org.junit.jupiter.params.ParameterizedTest; |
12 | 12 | import org.junit.jupiter.params.provider.MethodSource; |
13 | 13 | import org.mockito.Mock; |
14 | | -import org.mockito.MockedStatic; |
15 | | -import org.mockito.Mockito; |
16 | 14 | import org.mockito.MockitoAnnotations; |
17 | 15 | import org.springframework.test.util.ReflectionTestUtils; |
18 | 16 | import org.web3j.crypto.Credentials; |
19 | 17 | import org.web3j.crypto.Keys; |
20 | | -import org.web3j.protocol.core.RemoteFunctionCall; |
21 | 18 | import org.web3j.protocol.core.methods.response.Log; |
22 | | -import org.web3j.tx.TransactionManager; |
23 | 19 |
|
24 | | -import java.math.BigInteger; |
25 | 20 | import java.util.Optional; |
26 | 21 | import java.util.function.BiFunction; |
27 | 22 | import java.util.stream.Stream; |
@@ -57,15 +52,7 @@ void init() throws Exception { |
57 | 52 | when(web3jService.hasEnoughGas(any())).thenReturn(true); |
58 | 53 | when(chainConfig.getHubAddress()).thenReturn("0x748e091bf16048cb5103E0E10F9D5a8b7fBDd860"); |
59 | 54 |
|
60 | | - try (MockedStatic<IexecHubContract> iexecHubContract = Mockito.mockStatic(IexecHubContract.class)) { |
61 | | - final IexecHubContract mockIexecContract = mock(IexecHubContract.class); |
62 | | - final RemoteFunctionCall<BigInteger> mockRemoteFunctionCall = mock(RemoteFunctionCall.class); |
63 | | - iexecHubContract.when(() -> IexecHubContract.load(any(), any(), (TransactionManager) any(), any())) |
64 | | - .thenReturn(mockIexecContract); |
65 | | - when(mockIexecContract.contribution_deadline_ratio()).thenReturn(mockRemoteFunctionCall); |
66 | | - when(mockRemoteFunctionCall.send()).thenReturn(BigInteger.ONE); |
67 | | - iexecHubService = spy(new IexecHubService(credentialsService, web3jService, chainConfig)); |
68 | | - } |
| 55 | + iexecHubService = spy(new IexecHubService(credentialsService, web3jService, chainConfig)); |
69 | 56 | } |
70 | 57 |
|
71 | 58 |
|
|
0 commit comments