Skip to content

Commit

Permalink
Merge pull request #264 from fisuda/release_0.13.0_next
Browse files Browse the repository at this point in the history
Bump: 0.13.0 -> 0.13.0-next
  • Loading branch information
fisuda committed Aug 19, 2023
2 parents 8aeaca4 + f3c81ee commit 54f97e7
Show file tree
Hide file tree
Showing 15 changed files with 41 additions and 38 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
## NGSI Go v0.13.0-next

## NGSI Go v0.13.0 - 19 August, 2023

- Improve: Add flags for Keyrock permission (#262)
Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ USAGE:
ngsi [global options] command [options] [arguments...]
VERSION:
ngsi version 0.12.0 (git_hash:06a13ec2347c05c9fae96106577c06371b7c6bf5)
ngsi version 0.13.0 (git_hash:8aeaca431eb3c46f160be043ab865f8c58b26389)
COMMANDS:
help, h Shows a list of commands or help for one command
Expand Down Expand Up @@ -228,20 +228,20 @@ The NGSI Go binary is installed in `/usr/local/bin`.
#### Installation on Linux

```console
curl -OL https://github.com/lets-fiware/ngsi-go/releases/download/v0.12.0/ngsi-v0.12.0-linux-amd64.tar.gz
sudo tar zxvf ngsi-v0.12.0-linux-amd64.tar.gz -C /usr/local/bin
curl -OL https://github.com/lets-fiware/ngsi-go/releases/download/v0.13.0/ngsi-v0.13.0-linux-amd64.tar.gz
sudo tar zxvf ngsi-v0.13.0-linux-amd64.tar.gz -C /usr/local/bin
```

`ngsi-v0.12.0-linux-arm.tar.gz` and `ngsi-v0.12.0-linux-arm64.tar.gz` binaries are also available.
`ngsi-v0.13.0-linux-arm.tar.gz` and `ngsi-v0.13.0-linux-arm64.tar.gz` binaries are also available.

#### Installation on Mac

```console
curl -OL https://github.com/lets-fiware/ngsi-go/releases/download/v0.12.0/ngsi-v0.12.0-darwin-amd64.tar.gz
sudo tar zxvf ngsi-v0.12.0-darwin-amd64.tar.gz -C /usr/local/bin
curl -OL https://github.com/lets-fiware/ngsi-go/releases/download/v0.13.0/ngsi-v0.13.0-darwin-amd64.tar.gz
sudo tar zxvf ngsi-v0.13.0-darwin-amd64.tar.gz -C /usr/local/bin
```

`ngsi-v0.12.0-darwin-arm64.tar.gz` binary is also available.
`ngsi-v0.13.0-darwin-arm64.tar.gz` binary is also available.

### Install bash autocomplete file for NGSI Go

Expand Down
1 change: 1 addition & 0 deletions VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
VERSION=0.13.0-next
2 changes: 1 addition & 1 deletion cmd/ngsi/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import (
"github.com/lets-fiware/ngsi-go/internal/ngsimain"
)

var version = "0.13.0"
var version = "0.13.0-next"
var revision = ""

func main() {
Expand Down
2 changes: 1 addition & 1 deletion docs/convenience/queryproxy.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ ngsi queryproxy health --host queryproxy
```
{
"ngsi-go": "queryproxy",
"version": "0.12.0 (git_hash:06a13ec2347c05c9fae96106577c06371b7c6bf5)",
"version": "0.13.0 (git_hash:8aeaca431eb3c46f160be043ab865f8c58b26389)",
"health": "OK",
"orion": "http://orion:1026/v2/entities",
"verbose": true,
Expand Down
2 changes: 1 addition & 1 deletion docs/convenience/regproxy.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ ngsi regproxy health --host regproxy --pretty
```
{
"ngsi-go": "regproxy",
"version": "0.12.0 (git_hash:06a13ec2347c05c9fae96106577c06371b7c6bf5)",
"version": "0.13.0 (git_hash:8aeaca431eb3c46f160be043ab865f8c58b26389)",
"health": "OK",
"csource": "https://orion.letfiware.jp",
"verbose": false,
Expand Down
2 changes: 1 addition & 1 deletion docs/convenience/tokenproxy.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ ngsi tokenproxy health --host tokenproxy --pretty
```
{
"ngsi-go": "tokenproxy",
"version": "0.12.0 (git_hash:06a13ec2347c05c9fae96106577c06371b7c6bf5)",
"version": "0.13.0 (git_hash:8aeaca431eb3c46f160be043ab865f8c58b26389)",
"health": "OK",
"idm": "http://keyrock:3000/oauth2/token",
"clientId": "a1a6048b-df1d-4d4f-9a08-5cf836041d14",
Expand Down
4 changes: 2 additions & 2 deletions docs/global.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ USAGE:
ngsi [global options] command [options] [arguments...]
VERSION:
ngsi version 0.12.0 (git_hash:06a13ec2347c05c9fae96106577c06371b7c6bf5)
ngsi version 0.13.0 (git_hash:8aeaca431eb3c46f160be043ab865f8c58b26389)
COMMANDS:
help, h Shows a list of commands or help for one command
Expand Down Expand Up @@ -124,5 +124,5 @@ ngsi --version
```

```text
ngsi version 0.12.0 (git_hash:06a13ec2347c05c9fae96106577c06371b7c6bf5)
ngsi version 0.13.0 (git_hash:8aeaca431eb3c46f160be043ab865f8c58b26389)
```
12 changes: 6 additions & 6 deletions docs/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,20 @@ The NGSI Go binary is installed in `/usr/local/bin`.
### Installation on Linux

```console
curl -OL https://github.com/lets-fiware/ngsi-go/releases/download/v0.12.0/ngsi-v0.12.0-linux-amd64.tar.gz
sudo tar zxvf ngsi-v0.12.0-linux-amd64.tar.gz -C /usr/local/bin
curl -OL https://github.com/lets-fiware/ngsi-go/releases/download/v0.13.0/ngsi-v0.13.0-linux-amd64.tar.gz
sudo tar zxvf ngsi-v0.13.0-linux-amd64.tar.gz -C /usr/local/bin
```

`ngsi-v0.12.0-linux-arm.tar.gz` and `ngsi-v0.12.0-linux-arm64.tar.gz` binaries are also available.
`ngsi-v0.13.0-linux-arm.tar.gz` and `ngsi-v0.13.0-linux-arm64.tar.gz` binaries are also available.

### Installation on Mac

```console
curl -OL https://github.com/lets-fiware/ngsi-go/releases/download/v0.12.0/ngsi-v0.12.0-darwin-amd64.tar.gz
sudo tar zxvf ngsi-v0.12.0-darwin-amd64.tar.gz -C /usr/local/bin
curl -OL https://github.com/lets-fiware/ngsi-go/releases/download/v0.13.0/ngsi-v0.13.0-darwin-amd64.tar.gz
sudo tar zxvf ngsi-v0.13.0-darwin-amd64.tar.gz -C /usr/local/bin
```

`ngsi-v0.12.0-darwin-arm64.tar.gz` binary is also available.
`ngsi-v0.13.0-darwin-arm64.tar.gz` binary is also available.

## Install bash autocomplete file for NGSI Go

Expand Down
2 changes: 1 addition & 1 deletion extras/queryproxy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ ngsi queryproxy health --host queryproxy
```
{
"ngsi-go": "queryproxy",
"version": "0.12.0 (git_hash:06a13ec2347c05c9fae96106577c06371b7c6bf5)",
"version": "0.13.0 (git_hash:8aeaca431eb3c46f160be043ab865f8c58b26389)",
"health": "OK",
"orion": "http://orion:1026/v2/entities",
"verbose": true,
Expand Down
4 changes: 2 additions & 2 deletions extras/registration_proxy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ ngsi regproxy health --host regproxy --pretty
```
{
"ngsi-go": "regproxy",
"version": "0.12.0 (git_hash:06a13ec2347c05c9fae96106577c06371b7c6bf5)",
"version": "0.13.0 (git_hash:8aeaca431eb3c46f160be043ab865f8c58b26389)",
"health": "OK",
"csource": "http://remote-orion:1026",
"verbose": true,
Expand Down Expand Up @@ -160,7 +160,7 @@ ngsi regproxy health --host regproxy --pretty
```
{
"ngsi-go": "regproxy",
"version": "0.12.0 (git_hash:06a13ec2347c05c9fae96106577c06371b7c6bf5)",
"version": "0.13.0 (git_hash:8aeaca431eb3c46f160be043ab865f8c58b26389)",
"health": "OK",
"csource": "http://remote-orion:1026",
"verbose": true,
Expand Down
2 changes: 1 addition & 1 deletion extras/tokenproxy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ ngsi tokenproxy health --host tokenproxy --pretty
```
{
"ngsi-go": "tokenproxy",
"version": "0.12.0 (git_hash:06a13ec2347c05c9fae96106577c06371b7c6bf5)",
"version": "0.13.0 (git_hash:8aeaca431eb3c46f160be043ab865f8c58b26389)",
"health": "OK",
"idm": "http://keyrock:3000/oauth2/token",
"clientId": "a1a6048b-df1d-4d4f-9a08-5cf836041d14",
Expand Down
10 changes: 5 additions & 5 deletions internal/convenience/queryproxy_server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -579,15 +579,15 @@ func TestQueryProxyHealthCmd(t *testing.T) {
reqRes := helper.MockHTTPReqRes{}
reqRes.Res.StatusCode = http.StatusOK
reqRes.Path = "/health"
reqRes.ResBody = []byte(`{"ngsi-go":"queryproxy","version":"0.12.0 (git_hash:06a13ec2347c05c9fae96106577c06371b7c6bf5)","health":"OK","orion":"http://orion:1026/v2/entities","verbose":true,"uptime":"0 d, 2 h, 49 m, 1 s","timesent":3,"success":3,"failure":0}`)
reqRes.ResBody = []byte(`{"ngsi-go":"queryproxy","version":"0.13.0 (git_hash:8aeaca431eb3c46f160be043ab865f8c58b26389)","health":"OK","orion":"http://orion:1026/v2/entities","verbose":true,"uptime":"0 d, 2 h, 49 m, 1 s","timesent":3,"success":3,"failure":0}`)

helper.SetClientHTTP(c, reqRes)

err := queryProxyHealthCmd(c, c.Ngsi, c.Client)

if assert.NoError(t, err) {
actual := helper.GetStdoutString(c)
expected := "{\"ngsi-go\":\"queryproxy\",\"version\":\"0.12.0 (git_hash:06a13ec2347c05c9fae96106577c06371b7c6bf5)\",\"health\":\"OK\",\"orion\":\"http://orion:1026/v2/entities\",\"verbose\":true,\"uptime\":\"0 d, 2 h, 49 m, 1 s\",\"timesent\":3,\"success\":3,\"failure\":0}"
expected := "{\"ngsi-go\":\"queryproxy\",\"version\":\"0.13.0 (git_hash:8aeaca431eb3c46f160be043ab865f8c58b26389)\",\"health\":\"OK\",\"orion\":\"http://orion:1026/v2/entities\",\"verbose\":true,\"uptime\":\"0 d, 2 h, 49 m, 1 s\",\"timesent\":3,\"success\":3,\"failure\":0}"
assert.Equal(t, expected, actual)
}
}
Expand All @@ -598,15 +598,15 @@ func TestQueryProxyHealthCmdPretty(t *testing.T) {
reqRes := helper.MockHTTPReqRes{}
reqRes.Res.StatusCode = http.StatusOK
reqRes.Path = "/health"
reqRes.ResBody = []byte(`{"ngsi-go":"queryproxy","version":"0.12.0 (git_hash:06a13ec2347c05c9fae96106577c06371b7c6bf5)","health":"OK","orion":"http://orion:1026/v2/entities","verbose":true,"uptime":"0 d, 2 h, 49 m, 1 s","timesent":3,"success":3,"failure":0}`)
reqRes.ResBody = []byte(`{"ngsi-go":"queryproxy","version":"0.13.0 (git_hash:8aeaca431eb3c46f160be043ab865f8c58b26389)","health":"OK","orion":"http://orion:1026/v2/entities","verbose":true,"uptime":"0 d, 2 h, 49 m, 1 s","timesent":3,"success":3,"failure":0}`)

helper.SetClientHTTP(c, reqRes)

err := queryProxyHealthCmd(c, c.Ngsi, c.Client)

if assert.NoError(t, err) {
actual := helper.GetStdoutString(c)
expected := "{\n \"ngsi-go\": \"queryproxy\",\n \"version\": \"0.12.0 (git_hash:06a13ec2347c05c9fae96106577c06371b7c6bf5)\",\n \"health\": \"OK\",\n \"orion\": \"http://orion:1026/v2/entities\",\n \"verbose\": true,\n \"uptime\": \"0 d, 2 h, 49 m, 1 s\",\n \"timesent\": 3,\n \"success\": 3,\n \"failure\": 0\n}\n"
expected := "{\n \"ngsi-go\": \"queryproxy\",\n \"version\": \"0.13.0 (git_hash:8aeaca431eb3c46f160be043ab865f8c58b26389)\",\n \"health\": \"OK\",\n \"orion\": \"http://orion:1026/v2/entities\",\n \"verbose\": true,\n \"uptime\": \"0 d, 2 h, 49 m, 1 s\",\n \"timesent\": 3,\n \"success\": 3,\n \"failure\": 0\n}\n"
assert.Equal(t, expected, actual)
}
}
Expand Down Expand Up @@ -655,7 +655,7 @@ func TestQueryProxyHealthCmdIotaErrorPretty(t *testing.T) {
reqRes := helper.MockHTTPReqRes{}
reqRes.Res.StatusCode = http.StatusOK
reqRes.Path = "/health"
reqRes.ResBody = []byte(`{"ngsi-go":"queryproxy","version":"0.12.0 (git_hash:06a13ec2347c05c9fae96106577c06371b7c6bf5)","health":"OK","orion":"http://orion:1026/v2/entities","verbose":true,"uptime":"0 d, 2 h, 49 m, 1 s","timesent":3,"success":3,"failure":0}`)
reqRes.ResBody = []byte(`{"ngsi-go":"queryproxy","version":"0.13.0 (git_hash:8aeaca431eb3c46f160be043ab865f8c58b26389)","health":"OK","orion":"http://orion:1026/v2/entities","verbose":true,"uptime":"0 d, 2 h, 49 m, 1 s","timesent":3,"success":3,"failure":0}`)
helper.SetClientHTTP(c, reqRes)

helper.SetJSONIndentError(c.Ngsi)
Expand Down
10 changes: 5 additions & 5 deletions internal/convenience/regproxy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -860,14 +860,14 @@ func TestRegProxyHealthCmd(t *testing.T) {
reqRes := helper.MockHTTPReqRes{}
reqRes.Res.StatusCode = http.StatusOK
reqRes.Path = "/health"
reqRes.ResBody = []byte(`{"ngsi-go": "regproxy", "version": "0.12.0 (git_hash:06a13ec2347c05c9fae96106577c06371b7c6bf5)", "health": "OK", "csource": "https://orion.letsfiware.jp", "verbose": false, "uptime": "0 d, 0 h, 51 m, 51 s", "timesent": 0, "success": 0, "failure": 0}`)
reqRes.ResBody = []byte(`{"ngsi-go": "regproxy", "version": "0.13.0 (git_hash:8aeaca431eb3c46f160be043ab865f8c58b26389)", "health": "OK", "csource": "https://orion.letsfiware.jp", "verbose": false, "uptime": "0 d, 0 h, 51 m, 51 s", "timesent": 0, "success": 0, "failure": 0}`)
helper.SetClientHTTP(c, reqRes)

err := regProxyHealthCmd(c, c.Ngsi, c.Client)

if assert.NoError(t, err) {
actual := helper.GetStdoutString(c)
expected := "{\"ngsi-go\": \"regproxy\", \"version\": \"0.12.0 (git_hash:06a13ec2347c05c9fae96106577c06371b7c6bf5)\", \"health\": \"OK\", \"csource\": \"https://orion.letsfiware.jp\", \"verbose\": false, \"uptime\": \"0 d, 0 h, 51 m, 51 s\", \"timesent\": 0, \"success\": 0, \"failure\": 0}"
expected := "{\"ngsi-go\": \"regproxy\", \"version\": \"0.13.0 (git_hash:8aeaca431eb3c46f160be043ab865f8c58b26389)\", \"health\": \"OK\", \"csource\": \"https://orion.letsfiware.jp\", \"verbose\": false, \"uptime\": \"0 d, 0 h, 51 m, 51 s\", \"timesent\": 0, \"success\": 0, \"failure\": 0}"
assert.Equal(t, expected, actual)
}
}
Expand All @@ -878,15 +878,15 @@ func TestRegProxyHealthCmdPretty(t *testing.T) {
reqRes := helper.MockHTTPReqRes{}
reqRes.Res.StatusCode = http.StatusOK
reqRes.Path = "/health"
reqRes.ResBody = []byte(`{"ngsi-go": "regproxy", "version": "0.12.0 (git_hash:06a13ec2347c05c9fae96106577c06371b7c6bf5)", "health": "OK", "csource": "https://orion.letsfiware.jp", "verbose": false, "uptime": "0 d, 0 h, 51 m, 51 s", "timesent": 0, "success": 0, "failure": 0}`)
reqRes.ResBody = []byte(`{"ngsi-go": "regproxy", "version": "0.13.0 (git_hash:8aeaca431eb3c46f160be043ab865f8c58b26389)", "health": "OK", "csource": "https://orion.letsfiware.jp", "verbose": false, "uptime": "0 d, 0 h, 51 m, 51 s", "timesent": 0, "success": 0, "failure": 0}`)

helper.SetClientHTTP(c, reqRes)

err := regProxyHealthCmd(c, c.Ngsi, c.Client)

if assert.NoError(t, err) {
actual := helper.GetStdoutString(c)
expected := "{\n \"ngsi-go\": \"regproxy\",\n \"version\": \"0.12.0 (git_hash:06a13ec2347c05c9fae96106577c06371b7c6bf5)\",\n \"health\": \"OK\",\n \"csource\": \"https://orion.letsfiware.jp\",\n \"verbose\": false,\n \"uptime\": \"0 d, 0 h, 51 m, 51 s\",\n \"timesent\": 0,\n \"success\": 0,\n \"failure\": 0\n}\n"
expected := "{\n \"ngsi-go\": \"regproxy\",\n \"version\": \"0.13.0 (git_hash:8aeaca431eb3c46f160be043ab865f8c58b26389)\",\n \"health\": \"OK\",\n \"csource\": \"https://orion.letsfiware.jp\",\n \"verbose\": false,\n \"uptime\": \"0 d, 0 h, 51 m, 51 s\",\n \"timesent\": 0,\n \"success\": 0,\n \"failure\": 0\n}\n"
assert.Equal(t, expected, actual)
}
}
Expand Down Expand Up @@ -935,7 +935,7 @@ func TestRegProxyHealthCmdErrorPretty(t *testing.T) {
reqRes := helper.MockHTTPReqRes{}
reqRes.Res.StatusCode = http.StatusOK
reqRes.Path = "/health"
reqRes.ResBody = []byte(`{"ngsi-go": "regproxy", "version": "0.12.0 (git_hash:06a13ec2347c05c9fae96106577c06371b7c6bf5)", "health": "OK", "csource": "https://orion.letsfiware.jp", "verbose": false, "uptime": "0 d, 0 h, 51 m, 51 s", "timesent": 0, "success": 0, "failure": 0}`)
reqRes.ResBody = []byte(`{"ngsi-go": "regproxy", "version": "0.13.0 (git_hash:8aeaca431eb3c46f160be043ab865f8c58b26389)", "health": "OK", "csource": "https://orion.letsfiware.jp", "verbose": false, "uptime": "0 d, 0 h, 51 m, 51 s", "timesent": 0, "success": 0, "failure": 0}`)

helper.SetClientHTTP(c, reqRes)

Expand Down
10 changes: 5 additions & 5 deletions internal/convenience/tokenproxy_server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1045,15 +1045,15 @@ func TestTokenProxyHealthCmd(t *testing.T) {
reqRes := helper.MockHTTPReqRes{}
reqRes.Res.StatusCode = http.StatusOK
reqRes.Path = "/health"
reqRes.ResBody = []byte(`{"ngsi-go":"tokenproxy","version":"0.12.0 (git_hash:06a13ec2347c05c9fae96106577c06371b7c6bf5)","health":"OK","idm":"http://keyrock:3000/oauth2/token","clientId":"a1a6048b-df1d-4d4f-9a08-5cf836041d14","clientSecret":"e4cc0147-e38f-4211-b8ad-8ae5e6a107f9","verbose":true,"uptime":"0 d, 1 h, 55 m, 39 s","timesent":3,"success":1,"revoke":1,"failure":1}`)
reqRes.ResBody = []byte(`{"ngsi-go":"tokenproxy","version":"0.13.0 (git_hash:8aeaca431eb3c46f160be043ab865f8c58b26389)","health":"OK","idm":"http://keyrock:3000/oauth2/token","clientId":"a1a6048b-df1d-4d4f-9a08-5cf836041d14","clientSecret":"e4cc0147-e38f-4211-b8ad-8ae5e6a107f9","verbose":true,"uptime":"0 d, 1 h, 55 m, 39 s","timesent":3,"success":1,"revoke":1,"failure":1}`)

helper.SetClientHTTP(c, reqRes)

err := tokenProxyHealthCmd(c, c.Ngsi, c.Client)

if assert.NoError(t, err) {
actual := helper.GetStdoutString(c)
expected := "{\"ngsi-go\":\"tokenproxy\",\"version\":\"0.12.0 (git_hash:06a13ec2347c05c9fae96106577c06371b7c6bf5)\",\"health\":\"OK\",\"idm\":\"http://keyrock:3000/oauth2/token\",\"clientId\":\"a1a6048b-df1d-4d4f-9a08-5cf836041d14\",\"clientSecret\":\"e4cc0147-e38f-4211-b8ad-8ae5e6a107f9\",\"verbose\":true,\"uptime\":\"0 d, 1 h, 55 m, 39 s\",\"timesent\":3,\"success\":1,\"revoke\":1,\"failure\":1}"
expected := "{\"ngsi-go\":\"tokenproxy\",\"version\":\"0.13.0 (git_hash:8aeaca431eb3c46f160be043ab865f8c58b26389)\",\"health\":\"OK\",\"idm\":\"http://keyrock:3000/oauth2/token\",\"clientId\":\"a1a6048b-df1d-4d4f-9a08-5cf836041d14\",\"clientSecret\":\"e4cc0147-e38f-4211-b8ad-8ae5e6a107f9\",\"verbose\":true,\"uptime\":\"0 d, 1 h, 55 m, 39 s\",\"timesent\":3,\"success\":1,\"revoke\":1,\"failure\":1}"
assert.Equal(t, expected, actual)
}
}
Expand All @@ -1064,15 +1064,15 @@ func TestTokenProxyHealthCmdPretty(t *testing.T) {
reqRes := helper.MockHTTPReqRes{}
reqRes.Res.StatusCode = http.StatusOK
reqRes.Path = "/health"
reqRes.ResBody = []byte(`{"ngsi-go":"tokenproxy","version":"0.12.0 (git_hash:06a13ec2347c05c9fae96106577c06371b7c6bf5)","health":"OK","idm":"http://keyrock:3000/oauth2/token","clientId":"a1a6048b-df1d-4d4f-9a08-5cf836041d14","clientSecret":"e4cc0147-e38f-4211-b8ad-8ae5e6a107f9","verbose":true,"uptime":"0 d, 1 h, 55 m, 39 s","timesent":3,"success":1,"revoke":1,"failure":1}`)
reqRes.ResBody = []byte(`{"ngsi-go":"tokenproxy","version":"0.13.0 (git_hash:8aeaca431eb3c46f160be043ab865f8c58b26389)","health":"OK","idm":"http://keyrock:3000/oauth2/token","clientId":"a1a6048b-df1d-4d4f-9a08-5cf836041d14","clientSecret":"e4cc0147-e38f-4211-b8ad-8ae5e6a107f9","verbose":true,"uptime":"0 d, 1 h, 55 m, 39 s","timesent":3,"success":1,"revoke":1,"failure":1}`)

helper.SetClientHTTP(c, reqRes)

err := tokenProxyHealthCmd(c, c.Ngsi, c.Client)

if assert.NoError(t, err) {
actual := helper.GetStdoutString(c)
expected := "{\n \"ngsi-go\": \"tokenproxy\",\n \"version\": \"0.12.0 (git_hash:06a13ec2347c05c9fae96106577c06371b7c6bf5)\",\n \"health\": \"OK\",\n \"idm\": \"http://keyrock:3000/oauth2/token\",\n \"clientId\": \"a1a6048b-df1d-4d4f-9a08-5cf836041d14\",\n \"clientSecret\": \"e4cc0147-e38f-4211-b8ad-8ae5e6a107f9\",\n \"verbose\": true,\n \"uptime\": \"0 d, 1 h, 55 m, 39 s\",\n \"timesent\": 3,\n \"success\": 1,\n \"revoke\": 1,\n \"failure\": 1\n}\n"
expected := "{\n \"ngsi-go\": \"tokenproxy\",\n \"version\": \"0.13.0 (git_hash:8aeaca431eb3c46f160be043ab865f8c58b26389)\",\n \"health\": \"OK\",\n \"idm\": \"http://keyrock:3000/oauth2/token\",\n \"clientId\": \"a1a6048b-df1d-4d4f-9a08-5cf836041d14\",\n \"clientSecret\": \"e4cc0147-e38f-4211-b8ad-8ae5e6a107f9\",\n \"verbose\": true,\n \"uptime\": \"0 d, 1 h, 55 m, 39 s\",\n \"timesent\": 3,\n \"success\": 1,\n \"revoke\": 1,\n \"failure\": 1\n}\n"
assert.Equal(t, expected, actual)
}
}
Expand Down Expand Up @@ -1121,7 +1121,7 @@ func TestTokenProxyHealthCmdIotaErrorPretty(t *testing.T) {
reqRes := helper.MockHTTPReqRes{}
reqRes.Res.StatusCode = http.StatusOK
reqRes.Path = "/health"
reqRes.ResBody = []byte(`{"ngsi-go":"tokenproxy","version":"0.12.0 (git_hash:06a13ec2347c05c9fae96106577c06371b7c6bf5)","health":"OK","idm":"http://keyrock:3000/oauth2/token","clientId":"a1a6048b-df1d-4d4f-9a08-5cf836041d14","clientSecret":"e4cc0147-e38f-4211-b8ad-8ae5e6a107f9","verbose":true,"uptime":"0 d, 1 h, 55 m, 39 s","timesent":3,"success":1,"revoke":1,"failure":1}`)
reqRes.ResBody = []byte(`{"ngsi-go":"tokenproxy","version":"0.13.0 (git_hash:8aeaca431eb3c46f160be043ab865f8c58b26389)","health":"OK","idm":"http://keyrock:3000/oauth2/token","clientId":"a1a6048b-df1d-4d4f-9a08-5cf836041d14","clientSecret":"e4cc0147-e38f-4211-b8ad-8ae5e6a107f9","verbose":true,"uptime":"0 d, 1 h, 55 m, 39 s","timesent":3,"success":1,"revoke":1,"failure":1}`)

helper.SetClientHTTP(c, reqRes)

Expand Down

0 comments on commit 54f97e7

Please sign in to comment.