github.com/hellofresh/janus@v0.0.0-20230925145208-ce8de8183c67/pkg/plugin/oauth2/file_repository_test.go (about) 1 package oauth2 2 3 import ( 4 "os" 5 "path/filepath" 6 "testing" 7 8 "github.com/stretchr/testify/assert" 9 "github.com/stretchr/testify/require" 10 ) 11 12 func TestNewFileSystemRepository(t *testing.T) { 13 wd, err := os.Getwd() 14 assert.NoError(t, err) 15 16 // ./../../assets/auth 17 exampleAPIsPath := filepath.Join(wd, "..", "..", "..", "assets", "stubs", "auth-service") 18 info, err := os.Stat(exampleAPIsPath) 19 require.NoError(t, err) 20 require.True(t, info.IsDir()) 21 22 fsRepo, err := NewFileSystemRepository(exampleAPIsPath) 23 require.NoError(t, err) 24 assert.NotNil(t, fsRepo) 25 }