test-cli: refactor currencyservice smoke test
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
This commit is contained in:
parent
1c00f04e1e
commit
5b3530c021
1 changed files with 8 additions and 7 deletions
|
@ -270,17 +270,18 @@ func testCurrencyService() error {
|
||||||
log.Printf("--> %v", listResp.GetCurrencyCodes())
|
log.Printf("--> %v", listResp.GetCurrencyCodes())
|
||||||
|
|
||||||
log.Println("--- rpc Convert()")
|
log.Println("--- rpc Convert()")
|
||||||
convertResp, err := cl.Convert(context.TODO(), &pb.CurrencyConversionRequest{
|
in := &pb.Money{
|
||||||
From: &pb.Money{
|
|
||||||
CurrencyCode: "CAD",
|
CurrencyCode: "CAD",
|
||||||
Amount: &pb.MoneyAmount{
|
Amount: &pb.MoneyAmount{
|
||||||
Decimal: 12,
|
Decimal: 12,
|
||||||
Fractional: 25},
|
Fractional: 25},
|
||||||
},
|
}
|
||||||
|
convertResp, err := cl.Convert(context.TODO(), &pb.CurrencyConversionRequest{
|
||||||
|
From: in,
|
||||||
ToCode: "USD"})
|
ToCode: "USD"})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
log.Printf("--> result: %+v", convertResp)
|
log.Printf("--> in=%v result(USD): %+v", in, convertResp)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue