Skip to content

Commit 29a6b2b

Browse files
author
dimitraz
committed
Export common functions
1 parent 45c8373 commit 29a6b2b

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

integration/service_integration_test.go

+9-9
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,12 @@ func TestIntegration(t *testing.T) {
3434
}
3535

3636
// create fh-sync-server service instance
37-
createInstance(t, fhSyncServer)
38-
fhSyncID := getInstanceID(t, fhSyncServer)
37+
CreateInstance(t, fhSyncServer)
38+
fhSyncID := GetInstanceID(t, fhSyncServer)
3939

4040
// create keycloak service instance
41-
createInstance(t, keycloak)
42-
keycloakID := getInstanceID(t, keycloak)
41+
CreateInstance(t, keycloak)
42+
keycloakID := GetInstanceID(t, keycloak)
4343

4444
tests := []struct {
4545
name string
@@ -59,7 +59,7 @@ func TestIntegration(t *testing.T) {
5959
expectedError: nil,
6060
args: []string{"create", "integration", fhSyncID, keycloakID, "--namespace=" + *namespace},
6161
validate: func(t *testing.T) {
62-
sb, err := getBinding()
62+
sb, err := GetBinding()
6363
if err != nil {
6464
t.Fatalf("error retrieving binding: %v\n", err)
6565
}
@@ -88,7 +88,7 @@ func TestIntegration(t *testing.T) {
8888
args: []string{"delete", "integration", fhSyncID, keycloakID, "--namespace=" + *namespace},
8989
validate: func(t *testing.T) {
9090
expectedError := "Could not find servicebindings"
91-
_, err := getBinding()
91+
_, err := GetBinding()
9292
if err == nil {
9393
t.Fatalf("expected: '%v', got nil", expectedError)
9494
} else if err.Error() != expectedError {
@@ -132,7 +132,7 @@ func TestIntegration(t *testing.T) {
132132
}
133133
}
134134

135-
func createInstance(t *testing.T, si *ProvisionServiceParams) {
135+
func CreateInstance(t *testing.T, si *ProvisionServiceParams) {
136136
args := []string{"create", "serviceinstance", si.ServiceName, si.Namespace}
137137
args = append(args, si.Params...)
138138
cmd := exec.Command(*executable, args...)
@@ -145,7 +145,7 @@ func createInstance(t *testing.T, si *ProvisionServiceParams) {
145145
fmt.Println(string(output))
146146
}
147147

148-
func getInstanceID(t *testing.T, si *ProvisionServiceParams) (id string) {
148+
func GetInstanceID(t *testing.T, si *ProvisionServiceParams) (id string) {
149149
args := []string{"get", "serviceinstances", si.ServiceName, si.Namespace, "-o=json"}
150150
cmd := exec.Command(*executable, args...)
151151

@@ -162,7 +162,7 @@ func getInstanceID(t *testing.T, si *ProvisionServiceParams) (id string) {
162162
return siList.Items[0].ObjectMeta.Name
163163
}
164164

165-
func getBinding() (*v1beta1.ServiceBinding, error) {
165+
func GetBinding() (*v1beta1.ServiceBinding, error) {
166166
args := []string{"get", "integrations", "--namespace=" + *namespace, "-o=json"}
167167
cmd := exec.Command(*executable, args...)
168168

0 commit comments

Comments
 (0)