Skip to content

Configure HTTP Manager Client host and port via CPS #2607

Description

@jadecarino

Story

As a Galasa user, I want to be able to configure the host and port of an HTTP Client provisioned by the HTTP Manager via CPS properties, so that I could run the same Galasa test against different endpoints without having to hard code this into the test and recompile every time.

Background

The HTTP Manager currently has a method setURI which allows the user to set the URI for the HTTP Client in the test. However this requires the value to be hardcoded in the test. If a tester wanted to run the same Galasa test that runs HTTP requests but against multiple endpoints, they'd have to change this in the code and recompile each time. This also means that if the same test ran locally, was pushed up to be run in a pipeline, its not possible to run the pipeline's version of the test against a different endpoint either.

A workaround currently is to use @TestProperty to pass the host and port in and construct as below but it makes more sense to allow the HTTP Manager to be configurable.

@TestProperty(prefix = "microservice", suffix = "host", infixes = "endpoint")
String host;
@TestProperty(prefix = "microservice", suffix = "port", infixes = "endpoint")
String host;
...
httpClient.setURI(host+port);

Tasks

  • Create HTTP Manager CPS properties files
  • Implement logic to look for CPS properties and use when setting up the client if set
  • There should be multiple hostTags accepted
  • setURI still works if called, should it override the CPS values?
  • Test with HttpManagerIVT

Metadata

Metadata

Assignees

No one assigned

    Labels

    4-customer-enhancementEnhancements requested by a customerManager: HTTPHTTP ManagerNeeds ReviewThis work item needs reviewing by a member of the dev team

    Type

    No type

    Projects

    Status
    📋 5 Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions