Files
Bridge-and-Join-s/internal/lkgateway/lkclaim_live_test.go
T

33 lines
700 B
Go

//go:build live
package lkgateway
import (
"bytes"
"context"
"encoding/json"
"fmt"
"os"
"testing"
)
// Только чтение: заявка из ЛК ЕСИА Финанс как её получает bj. LK_ID=70038
func TestLKClaimLive(t *testing.T) {
rc, err := NewRuntimeConfig("/var/lib/bj/.bj/setup.json")
if err != nil {
t.Fatal(err)
}
ep, ok := lkActiveEndpoint(rc)
if !ok {
t.Fatal("ЛК не настроен")
}
code, body, err := lkGet(context.Background(), ep, "/claims/"+os.Getenv("LK_ID"))
fmt.Println("HTTP", code, err)
var out bytes.Buffer
if json.Indent(&out, body, "", " ") == nil {
fmt.Println(out.String())
} else {
fmt.Println(string(body))
}
}