Skip to content

Commit

Permalink
make sure manual client correctly implements the sourceclient interface.
Browse files Browse the repository at this point in the history
  • Loading branch information
AnalogJ committed Sep 20, 2024
1 parent 0e8c57a commit 572b3c8
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 0 deletions.
14 changes: 14 additions & 0 deletions clients/internal/dynamic_client_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package internal

import (
"github.com/fastenhealth/fasten-sources/clients/models"
"github.com/stretchr/testify/require"
"testing"
)

func TestGetDynamicSourceClient_ImplementsInterface(t *testing.T) {
t.Parallel()

//assert
require.Implements(t, (*models.SourceClient)(nil), &dynamicSourceClient{}, "should implement the models.SourceClient interface")
}
14 changes: 14 additions & 0 deletions clients/internal/fasten/client_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package fasten

import (
"github.com/fastenhealth/fasten-sources/clients/models"
"github.com/stretchr/testify/require"
"testing"
)

func TestGetSourceClientFasten_ImplementsInterface(t *testing.T) {
t.Parallel()

//assert
require.Implements(t, (*models.SourceClient)(nil), &FastenClient{}, "should implement the models.SourceClient interface")
}
8 changes: 8 additions & 0 deletions clients/internal/manual/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,14 @@ func (m ManualClient) GetUsCoreResources() []string {
panic("implement me")
}

func (m ManualClient) GetResourceTypesUsCore() []string {
return []string{}

Check warning on line 49 in clients/internal/manual/client.go

View check run for this annotation

Codecov / codecov/patch

clients/internal/manual/client.go#L48-L49

Added lines #L48 - L49 were not covered by tests
}

func (m ManualClient) GetResourceTypesAllowList() []string {
return []string{}

Check warning on line 53 in clients/internal/manual/client.go

View check run for this annotation

Codecov / codecov/patch

clients/internal/manual/client.go#L52-L53

Added lines #L52 - L53 were not covered by tests
}

func (m ManualClient) SyncAllByResourceName(db models.DatabaseRepository, resourceNames []string) (models.UpsertSummary, error) {
//TODO implement me
panic("implement me")
Expand Down
8 changes: 8 additions & 0 deletions clients/internal/manual/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package manual

import (
"context"
"github.com/fastenhealth/fasten-sources/clients/models"
mock_models "github.com/fastenhealth/fasten-sources/clients/models/mock"
"github.com/fastenhealth/fasten-sources/pkg"
"github.com/golang/mock/gomock"
Expand All @@ -11,6 +12,13 @@ import (
"testing"
)

func TestGetSourceClientManual_ImplementsInterface(t *testing.T) {
t.Parallel()

//assert
require.Implements(t, (*models.SourceClient)(nil), &ManualClient{}, "should implement the models.SourceClient interface")
}

func TestGetSourceClientManual_ExtractPatientId_Bundle(t *testing.T) {
t.Parallel()
//setup
Expand Down

0 comments on commit 572b3c8

Please sign in to comment.