-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
JSON: allow port to be provided as int or string
Signed-off-by: Andreas Fleig <[email protected]>
- Loading branch information
Showing
7 changed files
with
71 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,17 +35,26 @@ var _ = Describe("Resources", func() { | |
err := json.Unmarshal(test_resources.LoadResource("../test_resources/service_bindings.json"), paginatedResources) | ||
|
||
Expect(err).To(BeNil()) | ||
Expect(paginatedResources.Resources).To(HaveLen(3)) | ||
Expect(paginatedResources.Resources).To(HaveLen(4)) | ||
|
||
Expect(paginatedResources.Resources[0].Entity.ServiceInstanceGUID).To(Equal("service-instance-guid-a")) | ||
Expect(paginatedResources.Resources[0].Entity.Credentials.Uri).To(Equal("mysql://username-a:[email protected]:3306/dbname-a?reconnect=true")) | ||
Expect(paginatedResources.Resources[0].Entity.Credentials.DbName).To(Equal("dbname-a")) | ||
Expect(paginatedResources.Resources[0].Entity.Credentials.Hostname).To(Equal("database-a.host")) | ||
Expect(paginatedResources.Resources[0].Entity.Credentials.Port).To(Equal("3306")) | ||
Expect(paginatedResources.Resources[0].Entity.Credentials.Username).To(Equal("username-a")) | ||
Expect(paginatedResources.Resources[0].Entity.Credentials.Password).To(Equal("password-a")) | ||
|
||
Expect(paginatedResources.Resources[1].Entity.ServiceInstanceGUID).To(Equal("service-instance-guid-b")) | ||
|
||
var portString string | ||
err = json.Unmarshal(paginatedResources.Resources[0].Entity.Credentials.RawPort, &portString) | ||
Expect(err).To(BeNil()) | ||
Expect(portString).To(Equal("3306")) | ||
|
||
var portInt int | ||
err = json.Unmarshal(paginatedResources.Resources[3].Entity.Credentials.RawPort, &portInt) | ||
Expect(err).To(BeNil()) | ||
Expect(portInt).To(Equal(54321)) | ||
}) | ||
}) | ||
}) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -83,7 +83,34 @@ | |
"app_url": "/v2/apps/app-guid-b", | ||
"service_instance_url": "/v2/service_instances/service-instance-guid-d" | ||
} | ||
}, | ||
{ | ||
"metadata": { | ||
"guid": "guid-service-binding-e", | ||
"url": "/v2/service_bindings/guid-service-binding-e", | ||
"created_at": "2016-11-15T09:22:15Z", | ||
"updated_at": null | ||
}, | ||
"entity": { | ||
"app_guid": "app-guid-e", | ||
"service_instance_guid": "service-instance-guid-e", | ||
"credentials": { | ||
"jdbcUrl": "jdbc:mysql://database-e.host/dbname-e?user=username-e&password=password-e", | ||
"uri": "mysql://username-e:[email protected]:3306/dbname-e?reconnect=true", | ||
"name": "dbname-e", | ||
"hostname": "database-e.host", | ||
"port": 54321, | ||
"username": "username-e", | ||
"password": "password-e" | ||
}, | ||
"binding_options": {}, | ||
"gateway_data": null, | ||
"gateway_name": "", | ||
"syslog_drain_url": null, | ||
"volume_mounts": [], | ||
"app_url": "/v2/apps/app-guid-e", | ||
"service_instance_url": "/v2/service_instances/service-instance-guid-b" | ||
} | ||
} | ||
|
||
] | ||
} |