Closed MonicaisHer closed 1 year ago
The steps to be tested can be derived from the documentation: https://docs.edgexfoundry.org/3.0/getting-started/Ch-GettingStartedSnapUsers/#adding-api-gateway-users
The user creation and JWT request are already performed in:
https://github.com/canonical/edgex-snap-testing/blob/b08bb4d540470870707e2b4e0dd6316719fade34/test/utils/readings.go#L13-L20
Which better be moved to a new file named e.g. login.go
.
A new test under the edgexfoundry suite can be to perform the login and use the JWT to call an API. Some code to do so can be taken from those removed by https://github.com/canonical/edgex-snap-testing/pull/188
See also: https://github.com/canonical/edgex-snap-testing/issues/174
Call version 3 of API on behalf of example user