Skip to content

Commit

Permalink
Add more tests
Browse files Browse the repository at this point in the history
Signed-off-by: Pavol Loffay <p.loffay@gmail.com>
  • Loading branch information
pavolloffay committed Aug 10, 2021
1 parent 8085ba2 commit 03e9826
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion cmd/es-index-cleaner/app/index_client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ func TestClientDeleteIndices(t *testing.T) {
}
}

func TestClientBadESEndpoint(t *testing.T) {
func TestClientRequestError(t *testing.T) {
c := &IndicesClient{
Endpoint: "%",
}
Expand All @@ -200,3 +200,15 @@ func TestClientBadESEndpoint(t *testing.T) {
require.Error(t, err)
assert.Nil(t, indices)
}

func TestClientDoError(t *testing.T) {
c := &IndicesClient{
Endpoint: "localhost:1",
Client: &http.Client{},
}
err := c.DeleteIndices([]Index{})
require.Error(t, err)
indices, err := c.GetJaegerIndices("")
require.Error(t, err)
assert.Nil(t, indices)
}

0 comments on commit 03e9826

Please sign in to comment.