Skip to content

Latest commit

 

History

History
122 lines (110 loc) · 8.16 KB

BindingTests.md

File metadata and controls

122 lines (110 loc) · 8.16 KB

Table of Contents

Binding Tests

This Test Class provisions every plan present in the service broker and if the service instance is bindable, it binds on it. Afterwards the binding and provision is deleted. During this process the checker verifies that the service brokers reacts according to spec. The checker also validates the behaviour of the service broker, when invalid binding requests are being send to it.

Test Procedure

The tests created in this class depends upon the catalog. This means that a valid catalog is required for this test to generate useful debugging information. It is highly recommended to ensure the Catalog Test Class runs successfully, before using this test class. Naturally all binding tests will fail, if the underlying service instances don't work, so it is recommended that the provision tests are succeeding too.

At the beginning of a test the catalog is fetched. The checker then runs the following tests based upon the provided information:

  • Valid Provision and Bindings
    • Create a valid provision.
      • If the Service broker creates service instances asynchronously, the checker will start polling and and verify the responses.
      • When configured to do so, the checker verifies if the dashboard URL works. are according to spec and finish successfully.
      • Test what happens when attempting to create a service instances with the same instance id and same parameters and with different parameters. Read here about the expected behaviour.
    • If the Service is bindable. Look here on how it should behave.
      • Binding Attempts with missing mandatory or malformed data.
      • Valid Bindings und un bindings.
    • Delete the provision

Version specific Tests

2.14

  • If the instances and binding are the checker tests they perform correctly.
  • Tests how the broker reacts with synchronous and asynchronous binding attempts. More information here

2.15

Example output

A Binding Test output with two services. 'base-sql-service-dev-managed' is bindable, instanceFetchable and bindingFetchable. 'base-sql-service-dev-unmanaged' is not. Note how tests run accordingly.

╷
└─ JUnit Jupiter ✔
   └─ Binding Tests ✔
      └─ Valid Provision and Binding Tests. ✔
         ├─ Running a valid provision and run binding tests. Delete both afterwards. In case of a asynchronous service broker polling after each operation. ✔
         │  ├─ Creating Service Instance, test dashboard URL, and try to fetch it. ✔
         │  │  ├─ Running valid PUT provision with instanceId 9eeea6a1-478a-4f47-abb4-eebd6d149c4d for service 'base-sql-service-dev-managed' and plan 's' ✔
         │  │  ├─ Running valid PUT provision with same attributes again. Expecting Status 200. ✔
         │  │  └─ Running valid PUT provision with different space_guid and organization_guid again. Expecting Status 409. ✔
         │  ├─ Service base-sql-service-dev-managed Plan s is bindable. Testing binding operation with bindingId 27285fe4-c124-4a22-85be-f6db91de8373 ✔
         │  │  ├─ Run sync and invalid bindings attempts ✔
         │  │  │  ├─ should return status code 4XX when tying to fetch a non existing binding ✔
         │  │  │  ├─ should handle sync requests correctly ✔
         │  │  │  │  ├─ Sync PUT binding request ✔
         │  │  │  │  └─ Sync DELETE binding request ✔
         │  │  │  ├─ PUT should reject if missing service_id ✔
         │  │  │  ├─ DELETE should reject if missing service_id ✔
         │  │  │  ├─ PUT should reject if missing plan_id ✔
         │  │  │  └─ DELETE should reject if missing plan_id ✔
         │  │  └─ Running PUT binding and DELETE binding afterwards ✔
         │  │     ├─ Running valid PUT binding with bindingId 27285fe4-c124-4a22-85be-f6db91de8373 ✔
         │  │     ├─ Running PUT binding with same attribute again. Expecting StatusCode 200. ✔
         │  │     ├─ Running PUT binding with different service or plan id, but same instance and binding id again. Expecting StatusCode 409. ✔
         │  │     ├─ Running GET for retrievable service binding and expecting StatusCode: 200 ✔
         │  │     └─ Deleting binding with bindingId 27285fe4-c124-4a22-85be-f6db91de8373 ✔
         │  └─ Deleting provision ✔
         │     ├─ DELETE provision and if the service broker is async polling afterwards ✔
         │     └─ Running valid DELETE provision with same parameters again. Expecting Status 410. ✔
         └─ Running a valid provision and if necessary polling. Deleting it afterwards. ✔
            ├─ Creating Service Instance, test dashboard URL. ✔
            │  ├─ Running valid PUT provision with instanceId a408b58d-aa4b-4c53-b851-f3d331cdfe43 for service 'base-sql-service-dev-unmanaged' and plan 's' ✔
            │  ├─ Running valid PUT provision with same attributes again. Expecting Status 200. ✔
            │  └─ Running valid PUT provision with different space_guid and organization_guid again. Expecting Status 409. ✔
            └─ Deleting provision ✔
               ├─ DELETE provision and if the service broker is async polling afterwards ✔
               └─ Running valid DELETE provision with same parameters again. Expecting Status 410. ✔

Test run finished after 8786 ms
[        13 containers found      ]
[         0 containers skipped    ]
[        13 containers started    ]
[         0 containers aborted    ]
[        13 containers successful ]
[         0 containers failed     ]
[        22 tests found           ]
[         0 tests skipped         ]
[        22 tests started         ]
[         0 tests aborted         ]
[        22 tests successful      ]
[         0 tests failed          ]