vcapServices builds a minimal VCAP_SERVICES JSON string for a named service with a uri credential.
(label, name string, tags []string)
| 28 | |
| 29 | // vcapServices builds a minimal VCAP_SERVICES JSON string for a named service with a uri credential. |
| 30 | func vcapServices(label, name string, tags []string) string { |
| 31 | tagJSON := "[]" |
| 32 | if len(tags) > 0 { |
| 33 | tagJSON = `["` |
| 34 | for i, t := range tags { |
| 35 | if i > 0 { |
| 36 | tagJSON += `","` |
| 37 | } |
| 38 | tagJSON += t |
| 39 | } |
| 40 | tagJSON += `"]` |
| 41 | } |
| 42 | return `{"` + label + `":[{"name":"` + name + `","label":"` + label + `","tags":` + tagJSON + `,"credentials":{"uri":"mysql://host/db"}}]}` |
| 43 | } |
| 44 | |
| 45 | var _ = Describe("MariaDBJDBC", func() { |
| 46 | var ( |