Skip to content

Commit

Permalink
Adjust tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dehort committed Jan 22, 2024
1 parent f8c5ce7 commit 14c14e7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion internal/api/connectors/sources/impl.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,9 @@ func (this *sourcesClientImpl) getRHCConnectionStatus(ctx context.Context, sourc

ID := ID(sourceId)

res, err := this.client.GetSourcesRhcConnectionWithResponse(ctx, ID, nil)
params := GetSourcesRhcConnectionParams{}

res, err := this.client.GetSourcesRhcConnectionWithResponse(ctx, ID, &params)

if err != nil {
return nil, err
Expand Down
4 changes: 2 additions & 2 deletions internal/api/connectors/sources/sources_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ var _ = Describe("Sources", func() {
It("interperates response correctly", func() {
responses := []test.MockHttpResponse{
{StatusCode: 200, Body: `{"data": [{"id": "1", "name": "test", "availability_status": "connected"}]}`},
{StatusCode: 200, Body: `{"id": "1", "rhc_id": "6f37c752ba1c48b1bcf74ef8f585d8ee", "availability_status": "connected"}`},
{StatusCode: 200, Body: `{"data": [{"id": "1", "rhc_id": "6f37c752ba1c48b1bcf74ef8f585d8ee", "availability_status": "connected"}]}`},
}

doer := test.MockMultiResponseHttpClient(responses...)
Expand All @@ -37,7 +37,7 @@ var _ = Describe("Sources", func() {
It("interperates response correctly if fields are missing", func() {
responses := []test.MockHttpResponse{
{StatusCode: 200, Body: `{"data": [{"id": "1", "name": "test"}]}`},
{StatusCode: 200, Body: `{"id": "1"}`},
{StatusCode: 200, Body: `{"data": [{"id": "1"}]}`},
}

doer := test.MockMultiResponseHttpClient(responses...)
Expand Down

0 comments on commit 14c14e7

Please sign in to comment.