Skip to content

Commit

Permalink
fixed hard coded url which was breaking acceptance
Browse files Browse the repository at this point in the history
  • Loading branch information
mevansam committed Apr 29, 2018
1 parent e0ab42e commit 2de0b3e
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions cloudfoundry/resource_cf_route_service_binding_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,13 @@ resource "cf_route" "php-app-other" {
}
`

const routeServiceBrokerCfgYml = `---
basic_auth_service_broker:
route_service_url: "https://basic-auth-router.{{ .Domain }}"
broker_username: "admin"
broker_password: "letmein"
`

func TestAccRouteServiceBinding_normal(t *testing.T) {
dir, err := ioutil.TempDir("", "git-clone")
if err != nil {
Expand All @@ -153,9 +160,16 @@ func TestAccRouteServiceBinding_normal(t *testing.T) {
t.Fatalf("unable to clone repository '%s'", url)
}

ref := "cf_route_service_binding.route-bind"
tpl, _ := template.New("sql").Parse(routeBindingResourceCommon)
tpl, _ := template.New("sql").Parse(routeServiceBrokerCfgYml)
buf := &bytes.Buffer{}
tpl.Execute(buf, map[string]interface{}{
"Domain": defaultAppDomain(),
})
err = ioutil.WriteFile(dir+"/servicebroker/config.yml", buf.Bytes(), 0666)

ref := "cf_route_service_binding.route-bind"
tpl, _ = template.New("sql").Parse(routeBindingResourceCommon)
buf = &bytes.Buffer{}
tpl.Execute(buf, map[string]interface{}{
"Domain": defaultAppDomain(),
"BaseDir": defaultBaseDir(),
Expand Down

0 comments on commit 2de0b3e

Please sign in to comment.