From 36e7f9c29641aff3ace776123622d02e3d697362 Mon Sep 17 00:00:00 2001 From: Christian Volk Date: Thu, 18 Jul 2024 16:26:05 +0200 Subject: [PATCH] test broker update --- .../resource_subaccount_service_broker.yaml | 562 ++++++++++++++++-- ...resource_subaccount_service_broker_test.go | 14 + 2 files changed, 535 insertions(+), 41 deletions(-) diff --git a/internal/provider/fixtures/resource_subaccount_service_broker.yaml b/internal/provider/fixtures/resource_subaccount_service_broker.yaml index c72392a5..4ba7a430 100644 --- a/internal/provider/fixtures/resource_subaccount_service_broker.yaml +++ b/internal/provider/fixtures/resource_subaccount_service_broker.yaml @@ -21,7 +21,7 @@ interactions: User-Agent: - Terraform/1.5.7 terraform-provider-btp/dev X-Correlationid: - - 82a71efa-f35f-3d90-cbe1-2ddc8c2afb58 + - cf8b48ff-09fd-5087-3d4b-d7c7d16e5900 X-Cpcli-Format: - json url: https://canary.cli.btp.int.sap/login/v2.64.0 @@ -45,7 +45,7 @@ interactions: Content-Type: - application/json Date: - - Thu, 18 Jul 2024 13:40:20 GMT + - Thu, 18 Jul 2024 14:23:35 GMT Expires: - "0" Pragma: @@ -61,12 +61,12 @@ interactions: X-Frame-Options: - DENY X-Vcap-Request-Id: - - c9316762-3689-48d0-4705-f852782925ae + - f0aa17e2-dea7-4cc3-75a6-678ed64946c1 X-Xss-Protection: - "1" status: 200 OK code: 200 - duration: 669.866083ms + duration: 3.461844833s - id: 1 request: proto: HTTP/1.1 @@ -87,7 +87,7 @@ interactions: User-Agent: - Terraform/1.5.7 terraform-provider-btp/dev X-Correlationid: - - 94e14602-da84-87ad-1c08-98303986515e + - bef2cd5a-2f25-4743-82fc-2beda937fdc9 X-Cpcli-Format: - json url: https://canary.cli.btp.int.sap/login/v2.64.0 @@ -111,7 +111,7 @@ interactions: Content-Type: - application/json Date: - - Thu, 18 Jul 2024 13:40:20 GMT + - Thu, 18 Jul 2024 14:23:35 GMT Expires: - "0" Pragma: @@ -127,12 +127,12 @@ interactions: X-Frame-Options: - DENY X-Vcap-Request-Id: - - d63288a0-8fa3-43a8-5005-ba307aa67638 + - 02ad63b0-7a55-441f-614a-6ed98a2bbdbe X-Xss-Protection: - "1" status: 200 OK code: 200 - duration: 272.058291ms + duration: 308.325791ms - id: 2 request: proto: HTTP/1.1 @@ -153,7 +153,7 @@ interactions: User-Agent: - Terraform/1.5.7 terraform-provider-btp/dev X-Correlationid: - - 24dc651e-1c6c-33c8-2db5-e31538274b94 + - 71944d64-a577-b815-9d27-7f79a893039f X-Cpcli-Customidp: - identityProvider X-Cpcli-Format: @@ -172,7 +172,7 @@ interactions: trailer: {} content_length: -1 uncompressed: true - body: '{"id":"eca003f6-711d-4424-9d5c-3e1d80160568","ready":true,"last_operation":{"id":"5a85aac5-3e87-49c9-8564-d8f6c55c39da","ready":true,"type":"create","state":"succeeded","resource_id":"eca003f6-711d-4424-9d5c-3e1d80160568","resource_type":"/v1/service_brokers","platform_id":"service-manager","correlation_id":"24dc651e-1c6c-33c8-2db5-e31538274b94","reschedule":false,"reschedule_timestamp":"0001-01-01T00:00:00Z","deletion_scheduled":"0001-01-01T00:00:00Z","created_at":"2024-07-18T13:40:21.43754Z","updated_at":"2024-07-18T13:40:22.583499Z"},"name":"my-broker-59cd458e-e66e-4b60-b6d8-8f219379f9a5","description":"a description","broker_url":"https://my.broker.test","created_at":"2024-07-18T13:40:21.437538Z","updated_at":"2024-07-18T13:40:22.394951558Z","labels":"cred_revision = 0; subaccount_id = 59cd458e-e66e-4b60-b6d8-8f219379f9a5","username":"redacted","password":"redacted"}' + body: '{"id":"68747360-749c-4e14-afe0-341fe39ec1e8","ready":true,"last_operation":{"id":"a3752500-0940-4df1-b3c6-81041115d938","ready":true,"type":"create","state":"succeeded","resource_id":"68747360-749c-4e14-afe0-341fe39ec1e8","resource_type":"/v1/service_brokers","platform_id":"service-manager","correlation_id":"71944d64-a577-b815-9d27-7f79a893039f","reschedule":false,"reschedule_timestamp":"0001-01-01T00:00:00Z","deletion_scheduled":"0001-01-01T00:00:00Z","created_at":"2024-07-18T14:23:36.079998Z","updated_at":"2024-07-18T14:23:36.704087Z"},"name":"my-broker-59cd458e-e66e-4b60-b6d8-8f219379f9a5","description":"a description","broker_url":"https://my.broker.test","created_at":"2024-07-18T14:23:36.079997Z","updated_at":"2024-07-18T14:23:36.576430508Z","labels":"cred_revision = 0; subaccount_id = 59cd458e-e66e-4b60-b6d8-8f219379f9a5","username":"redacted","password":"redacted"}' headers: Cache-Control: - no-cache, no-store, max-age=0, must-revalidate @@ -181,7 +181,7 @@ interactions: Content-Type: - application/json Date: - - Thu, 18 Jul 2024 13:40:22 GMT + - Thu, 18 Jul 2024 14:23:36 GMT Expires: - "0" Pragma: @@ -199,12 +199,12 @@ interactions: X-Frame-Options: - DENY X-Vcap-Request-Id: - - e5e4882b-01ee-4bae-404b-541a116c8115 + - e4482598-a990-4235-4e10-34cea00e2231 X-Xss-Protection: - "1" status: 200 OK code: 200 - duration: 1.981504917s + duration: 1.221428417s - id: 3 request: proto: HTTP/1.1 @@ -225,7 +225,7 @@ interactions: User-Agent: - Terraform/1.5.7 terraform-provider-btp/dev X-Correlationid: - - be8840c1-7421-7326-ec15-d7bc149c7bce + - 0a38336f-9662-a61f-c729-13562fe3228c X-Cpcli-Format: - json url: https://canary.cli.btp.int.sap/login/v2.64.0 @@ -249,7 +249,7 @@ interactions: Content-Type: - application/json Date: - - Thu, 18 Jul 2024 13:40:24 GMT + - Thu, 18 Jul 2024 14:23:39 GMT Expires: - "0" Pragma: @@ -265,12 +265,12 @@ interactions: X-Frame-Options: - DENY X-Vcap-Request-Id: - - 0bc8d567-b72d-44a2-625a-8ec1cec07f6b + - a2bbb1dc-ab05-460a-6f31-c01fa8eb9596 X-Xss-Protection: - "1" status: 200 OK code: 200 - duration: 2.294792084s + duration: 3.061636708s - id: 4 request: proto: HTTP/1.1 @@ -291,7 +291,7 @@ interactions: User-Agent: - Terraform/1.5.7 terraform-provider-btp/dev X-Correlationid: - - ab0df516-e0d6-4ba8-0dc9-0b7029738f0d + - f7be8652-9be2-72de-94db-ac739be720fb X-Cpcli-Format: - json url: https://canary.cli.btp.int.sap/login/v2.64.0 @@ -315,7 +315,7 @@ interactions: Content-Type: - application/json Date: - - Thu, 18 Jul 2024 13:40:25 GMT + - Thu, 18 Jul 2024 14:23:40 GMT Expires: - "0" Pragma: @@ -331,12 +331,12 @@ interactions: X-Frame-Options: - DENY X-Vcap-Request-Id: - - db3ac04f-8afa-4dfc-5422-d99fff613c07 + - 9bfb3471-b3ad-44a9-6bf6-5e5d4a68ac3a X-Xss-Protection: - "1" status: 200 OK code: 200 - duration: 231.233916ms + duration: 336.362583ms - id: 5 request: proto: HTTP/1.1 @@ -349,7 +349,7 @@ interactions: remote_addr: "" request_uri: "" body: | - {"paramValues":{"id":"eca003f6-711d-4424-9d5c-3e1d80160568","subaccount":"59cd458e-e66e-4b60-b6d8-8f219379f9a5"}} + {"paramValues":{"id":"68747360-749c-4e14-afe0-341fe39ec1e8","subaccount":"59cd458e-e66e-4b60-b6d8-8f219379f9a5"}} form: {} headers: Content-Type: @@ -357,7 +357,7 @@ interactions: User-Agent: - Terraform/1.5.7 terraform-provider-btp/dev X-Correlationid: - - c3dcca69-9d0f-6f09-4328-830f154f44cc + - c04c69f3-653e-bd4f-4386-f70bda065488 X-Cpcli-Customidp: - identityProvider X-Cpcli-Format: @@ -376,7 +376,7 @@ interactions: trailer: {} content_length: -1 uncompressed: true - body: '{"id":"eca003f6-711d-4424-9d5c-3e1d80160568","ready":true,"last_operation":{"id":"5a85aac5-3e87-49c9-8564-d8f6c55c39da","ready":true,"type":"create","state":"succeeded","resource_id":"eca003f6-711d-4424-9d5c-3e1d80160568","resource_type":"/v1/service_brokers","platform_id":"service-manager","correlation_id":"24dc651e-1c6c-33c8-2db5-e31538274b94","reschedule":false,"reschedule_timestamp":"0001-01-01T00:00:00Z","deletion_scheduled":"0001-01-01T00:00:00Z","created_at":"2024-07-18T13:40:21.43754Z","updated_at":"2024-07-18T13:40:22.583499Z"},"name":"my-broker-59cd458e-e66e-4b60-b6d8-8f219379f9a5","description":"a description","broker_url":"https://my.broker.test","created_at":"2024-07-18T13:40:21.437538Z","updated_at":"2024-07-18T13:40:22.394952Z","labels":"cred_revision = 0; subaccount_id = 59cd458e-e66e-4b60-b6d8-8f219379f9a5"}' + body: '{"id":"68747360-749c-4e14-afe0-341fe39ec1e8","ready":true,"last_operation":{"id":"a3752500-0940-4df1-b3c6-81041115d938","ready":true,"type":"create","state":"succeeded","resource_id":"68747360-749c-4e14-afe0-341fe39ec1e8","resource_type":"/v1/service_brokers","platform_id":"service-manager","correlation_id":"71944d64-a577-b815-9d27-7f79a893039f","reschedule":false,"reschedule_timestamp":"0001-01-01T00:00:00Z","deletion_scheduled":"0001-01-01T00:00:00Z","created_at":"2024-07-18T14:23:36.079998Z","updated_at":"2024-07-18T14:23:36.704087Z"},"name":"my-broker-59cd458e-e66e-4b60-b6d8-8f219379f9a5","description":"a description","broker_url":"https://my.broker.test","created_at":"2024-07-18T14:23:36.079997Z","updated_at":"2024-07-18T14:23:36.576431Z","labels":"cred_revision = 0; subaccount_id = 59cd458e-e66e-4b60-b6d8-8f219379f9a5"}' headers: Cache-Control: - no-cache, no-store, max-age=0, must-revalidate @@ -385,7 +385,7 @@ interactions: Content-Type: - application/json Date: - - Thu, 18 Jul 2024 13:40:25 GMT + - Thu, 18 Jul 2024 14:23:40 GMT Expires: - "0" Pragma: @@ -403,12 +403,12 @@ interactions: X-Frame-Options: - DENY X-Vcap-Request-Id: - - c6a1b901-a85d-4343-67a9-d5bc27719814 + - dca890a7-6b60-4ef2-693d-0de85d873fce X-Xss-Protection: - "1" status: 200 OK code: 200 - duration: 541.119583ms + duration: 406.033834ms - id: 6 request: proto: HTTP/1.1 @@ -429,7 +429,7 @@ interactions: User-Agent: - Terraform/1.5.7 terraform-provider-btp/dev X-Correlationid: - - ee7b311a-82c1-db02-aae3-a95baed676aa + - d4aa27d0-1ea2-1ae1-b170-d0b2f491ba02 X-Cpcli-Format: - json url: https://canary.cli.btp.int.sap/login/v2.64.0 @@ -453,7 +453,7 @@ interactions: Content-Type: - application/json Date: - - Thu, 18 Jul 2024 13:40:30 GMT + - Thu, 18 Jul 2024 14:23:44 GMT Expires: - "0" Pragma: @@ -469,13 +469,85 @@ interactions: X-Frame-Options: - DENY X-Vcap-Request-Id: - - 0397ba45-9774-4288-7a0d-a1ae2d1b8195 + - e145ad39-74ea-4e2d-724a-65b6b61b9e24 X-Xss-Protection: - "1" status: 200 OK code: 200 - duration: 4.332645875s + duration: 4.092337375s - id: 7 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 114 + transfer_encoding: [] + trailer: {} + host: canary.cli.btp.int.sap + remote_addr: "" + request_uri: "" + body: | + {"paramValues":{"id":"68747360-749c-4e14-afe0-341fe39ec1e8","subaccount":"59cd458e-e66e-4b60-b6d8-8f219379f9a5"}} + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Terraform/1.5.7 terraform-provider-btp/dev + X-Correlationid: + - a66a0c78-7aba-f92d-937a-654b59191e8b + X-Cpcli-Customidp: + - identityProvider + X-Cpcli-Format: + - json + X-Cpcli-Sessionid: + - redacted + X-Cpcli-Subdomain: + - terraformintcanary + url: https://canary.cli.btp.int.sap/command/v2.64.0/services/broker?get + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: -1 + uncompressed: true + body: '{"id":"68747360-749c-4e14-afe0-341fe39ec1e8","ready":true,"last_operation":{"id":"a3752500-0940-4df1-b3c6-81041115d938","ready":true,"type":"create","state":"succeeded","resource_id":"68747360-749c-4e14-afe0-341fe39ec1e8","resource_type":"/v1/service_brokers","platform_id":"service-manager","correlation_id":"71944d64-a577-b815-9d27-7f79a893039f","reschedule":false,"reschedule_timestamp":"0001-01-01T00:00:00Z","deletion_scheduled":"0001-01-01T00:00:00Z","created_at":"2024-07-18T14:23:36.079998Z","updated_at":"2024-07-18T14:23:36.704087Z"},"name":"my-broker-59cd458e-e66e-4b60-b6d8-8f219379f9a5","description":"a description","broker_url":"https://my.broker.test","created_at":"2024-07-18T14:23:36.079997Z","updated_at":"2024-07-18T14:23:36.576431Z","labels":"cred_revision = 0; subaccount_id = 59cd458e-e66e-4b60-b6d8-8f219379f9a5"}' + headers: + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Content-Security-Policy: + - default-src 'self' + Content-Type: + - application/json + Date: + - Thu, 18 Jul 2024 14:23:45 GMT + Expires: + - "0" + Pragma: + - no-cache + Referrer-Policy: + - no-referrer + Strict-Transport-Security: + - max-age=31536000; includeSubDomains; preload; + X-Content-Type-Options: + - nosniff + X-Cpcli-Backend-Mediatype: + - application/json + X-Cpcli-Backend-Status: + - "200" + X-Frame-Options: + - DENY + X-Vcap-Request-Id: + - 2d5e0b28-00c0-4efb-4e79-8c5d7e4b5097 + X-Xss-Protection: + - "1" + status: 200 OK + code: 200 + duration: 349.991084ms + - id: 8 request: proto: HTTP/1.1 proto_major: 1 @@ -495,7 +567,7 @@ interactions: User-Agent: - Terraform/1.5.7 terraform-provider-btp/dev X-Correlationid: - - d0d23ac8-c998-2feb-a395-eb0ef3b4646c + - 49e0fdb0-668a-8c01-c54a-58bdd54e8925 X-Cpcli-Format: - json url: https://canary.cli.btp.int.sap/login/v2.64.0 @@ -519,7 +591,7 @@ interactions: Content-Type: - application/json Date: - - Thu, 18 Jul 2024 13:40:30 GMT + - Thu, 18 Jul 2024 14:23:45 GMT Expires: - "0" Pragma: @@ -535,13 +607,421 @@ interactions: X-Frame-Options: - DENY X-Vcap-Request-Id: - - bbade333-562d-489a-61d5-d0fd746ef265 + - 00bb6877-23f8-48dd-640c-0dc2c669711d X-Xss-Protection: - "1" status: 200 OK code: 200 - duration: 211.810083ms - - id: 8 + duration: 393.391959ms + - id: 9 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 354 + transfer_encoding: [] + trailer: {} + host: canary.cli.btp.int.sap + remote_addr: "" + request_uri: "" + body: | + {"paramValues":{"description":"another description","id":"68747360-749c-4e14-afe0-341fe39ec1e8","newName":"my-broker-with-a-new-name","password":"a-secure-password","subaccount":"59cd458e-e66e-4b60-b6d8-8f219379f9a5","url":"https://my.broker.test","user":"platform"}} + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Terraform/1.5.7 terraform-provider-btp/dev + X-Correlationid: + - 9baee2bd-f8da-b4de-b2be-d3ab4b86326d + X-Cpcli-Customidp: + - identityProvider + X-Cpcli-Format: + - json + X-Cpcli-Sessionid: + - redacted + X-Cpcli-Subdomain: + - terraformintcanary + url: https://canary.cli.btp.int.sap/command/v2.64.0/services/broker?update + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: -1 + uncompressed: true + body: '{"id":"68747360-749c-4e14-afe0-341fe39ec1e8","ready":true,"last_operation":{"id":"a339b6e5-0130-46a4-89ca-56480c39afb5","ready":true,"type":"update","state":"succeeded","resource_id":"68747360-749c-4e14-afe0-341fe39ec1e8","resource_type":"/v1/service_brokers","platform_id":"service-manager","correlation_id":"9baee2bd-f8da-b4de-b2be-d3ab4b86326d","reschedule":false,"reschedule_timestamp":"0001-01-01T00:00:00Z","deletion_scheduled":"0001-01-01T00:00:00Z","created_at":"2024-07-18T14:23:46.371192Z","updated_at":"2024-07-18T14:23:46.920698Z"},"name":"my-broker-with-a-new-name-59cd458e-e66e-4b60-b6d8-8f219379f9a5","description":"another description","broker_url":"https://my.broker.test","created_at":"2024-07-18T14:23:36.079997Z","updated_at":"2024-07-18T14:23:46.651953211Z","labels":"cred_revision = 0; subaccount_id = 59cd458e-e66e-4b60-b6d8-8f219379f9a5"}' + headers: + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Content-Security-Policy: + - default-src 'self' + Content-Type: + - application/json + Date: + - Thu, 18 Jul 2024 14:23:46 GMT + Expires: + - "0" + Pragma: + - no-cache + Referrer-Policy: + - no-referrer + Strict-Transport-Security: + - max-age=31536000; includeSubDomains; preload; + X-Content-Type-Options: + - nosniff + X-Cpcli-Backend-Mediatype: + - application/json + X-Cpcli-Backend-Status: + - "200" + X-Frame-Options: + - DENY + X-Vcap-Request-Id: + - 91a4e9ad-868a-4f2d-5c01-56277eb92bbd + X-Xss-Protection: + - "1" + status: 200 OK + code: 200 + duration: 1.108298791s + - id: 10 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 116 + transfer_encoding: [] + trailer: {} + host: canary.cli.btp.int.sap + remote_addr: "" + request_uri: "" + body: | + {"customIdp":"identityProvider","subdomain":"terraformintcanary","userName":"john.doe@int.test","password":"testUserPassword"} + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Terraform/1.5.7 terraform-provider-btp/dev + X-Correlationid: + - 76c6e953-43a5-a165-4d36-c88bb6aa20b8 + X-Cpcli-Format: + - json + url: https://canary.cli.btp.int.sap/login/v2.64.0 + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 147 + uncompressed: false + body: '{"issuer":"identity.provider.test","refreshToken":"redacted","user":"john.doe@int.test","mail":"john.doe@int.test"}' + headers: + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Content-Length: + - "147" + Content-Security-Policy: + - default-src 'self' + Content-Type: + - application/json + Date: + - Thu, 18 Jul 2024 14:23:49 GMT + Expires: + - "0" + Pragma: + - no-cache + Referrer-Policy: + - no-referrer + Strict-Transport-Security: + - max-age=31536000; includeSubDomains; preload; + X-Content-Type-Options: + - nosniff + X-Cpcli-Sessionid: + - redacted + X-Frame-Options: + - DENY + X-Vcap-Request-Id: + - 012bcd68-6e35-4743-59ba-5b0a1d08cc3f + X-Xss-Protection: + - "1" + status: 200 OK + code: 200 + duration: 2.836723459s + - id: 11 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 116 + transfer_encoding: [] + trailer: {} + host: canary.cli.btp.int.sap + remote_addr: "" + request_uri: "" + body: | + {"customIdp":"identityProvider","subdomain":"terraformintcanary","userName":"john.doe@int.test","password":"testUserPassword"} + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Terraform/1.5.7 terraform-provider-btp/dev + X-Correlationid: + - 22a578e3-e0c5-a599-a34f-4eabefe01483 + X-Cpcli-Format: + - json + url: https://canary.cli.btp.int.sap/login/v2.64.0 + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 147 + uncompressed: false + body: '{"issuer":"identity.provider.test","refreshToken":"redacted","user":"john.doe@int.test","mail":"john.doe@int.test"}' + headers: + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Content-Length: + - "147" + Content-Security-Policy: + - default-src 'self' + Content-Type: + - application/json + Date: + - Thu, 18 Jul 2024 14:23:50 GMT + Expires: + - "0" + Pragma: + - no-cache + Referrer-Policy: + - no-referrer + Strict-Transport-Security: + - max-age=31536000; includeSubDomains; preload; + X-Content-Type-Options: + - nosniff + X-Cpcli-Sessionid: + - redacted + X-Frame-Options: + - DENY + X-Vcap-Request-Id: + - 0b4def8a-6f23-4386-6ce0-59a7a35e45d1 + X-Xss-Protection: + - "1" + status: 200 OK + code: 200 + duration: 297.875667ms + - id: 12 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 114 + transfer_encoding: [] + trailer: {} + host: canary.cli.btp.int.sap + remote_addr: "" + request_uri: "" + body: | + {"paramValues":{"id":"68747360-749c-4e14-afe0-341fe39ec1e8","subaccount":"59cd458e-e66e-4b60-b6d8-8f219379f9a5"}} + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Terraform/1.5.7 terraform-provider-btp/dev + X-Correlationid: + - 68ee4253-df8b-f087-7abd-bb312bf033dc + X-Cpcli-Customidp: + - identityProvider + X-Cpcli-Format: + - json + X-Cpcli-Sessionid: + - redacted + X-Cpcli-Subdomain: + - terraformintcanary + url: https://canary.cli.btp.int.sap/command/v2.64.0/services/broker?get + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: -1 + uncompressed: true + body: '{"id":"68747360-749c-4e14-afe0-341fe39ec1e8","ready":true,"last_operation":{"id":"a339b6e5-0130-46a4-89ca-56480c39afb5","ready":true,"type":"update","state":"succeeded","resource_id":"68747360-749c-4e14-afe0-341fe39ec1e8","resource_type":"/v1/service_brokers","platform_id":"service-manager","correlation_id":"9baee2bd-f8da-b4de-b2be-d3ab4b86326d","reschedule":false,"reschedule_timestamp":"0001-01-01T00:00:00Z","deletion_scheduled":"0001-01-01T00:00:00Z","created_at":"2024-07-18T14:23:46.371192Z","updated_at":"2024-07-18T14:23:46.920698Z"},"name":"my-broker-with-a-new-name-59cd458e-e66e-4b60-b6d8-8f219379f9a5","description":"another description","broker_url":"https://my.broker.test","created_at":"2024-07-18T14:23:36.079997Z","updated_at":"2024-07-18T14:23:46.651953Z","labels":"cred_revision = 0; subaccount_id = 59cd458e-e66e-4b60-b6d8-8f219379f9a5"}' + headers: + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Content-Security-Policy: + - default-src 'self' + Content-Type: + - application/json + Date: + - Thu, 18 Jul 2024 14:23:50 GMT + Expires: + - "0" + Pragma: + - no-cache + Referrer-Policy: + - no-referrer + Strict-Transport-Security: + - max-age=31536000; includeSubDomains; preload; + X-Content-Type-Options: + - nosniff + X-Cpcli-Backend-Mediatype: + - application/json + X-Cpcli-Backend-Status: + - "200" + X-Frame-Options: + - DENY + X-Vcap-Request-Id: + - 483a7eca-e94b-4b93-5716-054ef76bcb0a + X-Xss-Protection: + - "1" + status: 200 OK + code: 200 + duration: 404.87575ms + - id: 13 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 116 + transfer_encoding: [] + trailer: {} + host: canary.cli.btp.int.sap + remote_addr: "" + request_uri: "" + body: | + {"customIdp":"identityProvider","subdomain":"terraformintcanary","userName":"john.doe@int.test","password":"testUserPassword"} + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Terraform/1.5.7 terraform-provider-btp/dev + X-Correlationid: + - 48d8bb50-e0ec-6043-b25c-68b2ed46b883 + X-Cpcli-Format: + - json + url: https://canary.cli.btp.int.sap/login/v2.64.0 + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 147 + uncompressed: false + body: '{"issuer":"identity.provider.test","refreshToken":"redacted","user":"john.doe@int.test","mail":"john.doe@int.test"}' + headers: + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Content-Length: + - "147" + Content-Security-Policy: + - default-src 'self' + Content-Type: + - application/json + Date: + - Thu, 18 Jul 2024 14:23:54 GMT + Expires: + - "0" + Pragma: + - no-cache + Referrer-Policy: + - no-referrer + Strict-Transport-Security: + - max-age=31536000; includeSubDomains; preload; + X-Content-Type-Options: + - nosniff + X-Cpcli-Sessionid: + - redacted + X-Frame-Options: + - DENY + X-Vcap-Request-Id: + - bd8d7af8-e934-4758-63f2-a5aa89ca99d9 + X-Xss-Protection: + - "1" + status: 200 OK + code: 200 + duration: 3.987737s + - id: 14 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 116 + transfer_encoding: [] + trailer: {} + host: canary.cli.btp.int.sap + remote_addr: "" + request_uri: "" + body: | + {"customIdp":"identityProvider","subdomain":"terraformintcanary","userName":"john.doe@int.test","password":"testUserPassword"} + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Terraform/1.5.7 terraform-provider-btp/dev + X-Correlationid: + - 259fba0b-6e6a-377f-fc79-ffcb0ef067ce + X-Cpcli-Format: + - json + url: https://canary.cli.btp.int.sap/login/v2.64.0 + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 147 + uncompressed: false + body: '{"issuer":"identity.provider.test","refreshToken":"redacted","user":"john.doe@int.test","mail":"john.doe@int.test"}' + headers: + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Content-Length: + - "147" + Content-Security-Policy: + - default-src 'self' + Content-Type: + - application/json + Date: + - Thu, 18 Jul 2024 14:23:55 GMT + Expires: + - "0" + Pragma: + - no-cache + Referrer-Policy: + - no-referrer + Strict-Transport-Security: + - max-age=31536000; includeSubDomains; preload; + X-Content-Type-Options: + - nosniff + X-Cpcli-Sessionid: + - redacted + X-Frame-Options: + - DENY + X-Vcap-Request-Id: + - 84f18480-fd66-42a2-6ca5-544b5e156205 + X-Xss-Protection: + - "1" + status: 200 OK + code: 200 + duration: 317.487083ms + - id: 15 request: proto: HTTP/1.1 proto_major: 1 @@ -553,7 +1033,7 @@ interactions: remote_addr: "" request_uri: "" body: | - {"paramValues":{"confirm":"true","id":"eca003f6-711d-4424-9d5c-3e1d80160568","subaccount":"59cd458e-e66e-4b60-b6d8-8f219379f9a5"}} + {"paramValues":{"confirm":"true","id":"68747360-749c-4e14-afe0-341fe39ec1e8","subaccount":"59cd458e-e66e-4b60-b6d8-8f219379f9a5"}} form: {} headers: Content-Type: @@ -561,7 +1041,7 @@ interactions: User-Agent: - Terraform/1.5.7 terraform-provider-btp/dev X-Correlationid: - - 15d0ed81-d2aa-d39b-2846-6fef8777ef60 + - 29b33048-6197-aec0-777c-f014d5e5e570 X-Cpcli-Customidp: - identityProvider X-Cpcli-Format: @@ -589,7 +1069,7 @@ interactions: Content-Type: - application/json Date: - - Thu, 18 Jul 2024 13:40:31 GMT + - Thu, 18 Jul 2024 14:23:55 GMT Expires: - "0" Pragma: @@ -607,9 +1087,9 @@ interactions: X-Frame-Options: - DENY X-Vcap-Request-Id: - - 3770b412-54b0-4882-4655-ee986628bf09 + - ddd492dd-635c-4531-77d7-a8a8636c4346 X-Xss-Protection: - "1" status: 200 OK code: 200 - duration: 693.686583ms + duration: 537.822666ms diff --git a/internal/provider/resource_subaccount_service_broker_test.go b/internal/provider/resource_subaccount_service_broker_test.go index 703b818c..ed705bab 100644 --- a/internal/provider/resource_subaccount_service_broker_test.go +++ b/internal/provider/resource_subaccount_service_broker_test.go @@ -30,6 +30,20 @@ func TestResourceSubaccountServiceBroker(t *testing.T) { resource.TestMatchResourceAttr("btp_subaccount_service_broker.uut", "last_modified", regexpValidRFC3999Format), ), }, + { // rename and update the description + Config: hclProviderFor(user) + hclResourceSubaccountServiceBroker("uut", "59cd458e-e66e-4b60-b6d8-8f219379f9a5", "my-broker-with-a-new-name", "another description", "https://my.broker.test", "platform", "a-secure-password"), + Check: resource.ComposeAggregateTestCheckFunc( + resource.TestMatchResourceAttr("btp_subaccount_service_broker.uut", "id", regexpValidUUID), + resource.TestMatchResourceAttr("btp_subaccount_service_broker.uut", "subaccount_id", regexpValidUUID), + resource.TestCheckResourceAttr("btp_subaccount_service_broker.uut", "name", "my-broker-with-a-new-name"), + resource.TestCheckResourceAttr("btp_subaccount_service_broker.uut", "description", "another description"), + resource.TestCheckResourceAttr("btp_subaccount_service_broker.uut", "url", "https://my.broker.test"), + resource.TestCheckResourceAttr("btp_subaccount_service_broker.uut", "username", "platform"), + resource.TestCheckResourceAttr("btp_subaccount_service_broker.uut", "password", "a-secure-password"), + resource.TestMatchResourceAttr("btp_subaccount_service_broker.uut", "created_date", regexpValidRFC3999Format), + resource.TestMatchResourceAttr("btp_subaccount_service_broker.uut", "last_modified", regexpValidRFC3999Format), + ), + }, }, }) })