@@ -14,6 +14,7 @@ import org.springframework.http.ResponseEntity
14
14
import org.springframework.web.client.RestTemplate
15
15
import java.math.BigDecimal
16
16
import java.time.LocalDateTime
17
+ import java.util.*
17
18
18
19
class DefaultStateApiTests : UnitTest () {
19
20
@@ -29,27 +30,16 @@ class DefaultStateApiTests : UnitTest() {
29
30
30
31
@Test
31
32
fun createWalletTest () {
32
- val request = CreateStateWalletRequestMetadata (
33
+ val request = CreateStateWalletRequest (
34
+ " address" ,
33
35
" webhook" ,
34
- " applicationId" ,
35
- listOf (KeyWalletDto (" address" , Blockchain .Ethereum .getValue(), " CUSTODIAL" )),
36
- WalletMetaData (
37
- " 0" ,
38
- " op_UxQr1LLdREboF" ,
39
- " USD" ,
40
- " open" ,
41
- false ,
42
- false
43
- )
44
- )
45
- val response = CreateStateWalletResponse (
46
- " webhook" ,
47
- " op_UxQr1LLdREboF" ,
48
- BigDecimal .ZERO ,
49
- listOf (WalletCreateResponse (Blockchain .Ethereum .getValue()," address" , BigDecimal .ZERO ))
36
+ Blockchain .Ethereum .getValue(),
37
+ " applicationId"
50
38
)
39
+ val response = StateWalletDto (
40
+ UUID .randomUUID().toString(), " address" , " webhook" , Blockchain .Ethereum , LocalDateTime .now())
51
41
52
- given(restTemplate.postForEntity(" /wallets" , request, CreateStateWalletResponse ::class .java)).willReturn(ResponseEntity (response, HttpStatus .OK ))
42
+ given(restTemplate.postForEntity(" /wallets/single " , request, StateWalletDto ::class .java)).willReturn(ResponseEntity (response, HttpStatus .OK ))
53
43
54
44
val result = stateApi.createWallet(" address" , " webhook" , Blockchain .Ethereum , " applicationId" )
55
45
0 commit comments