(t *testing.T)
| 464 | } |
| 465 | |
| 466 | func TestOrderedParamsFromUri(t *testing.T) { |
| 467 | result := OrderedParamsFromUri("/path/{param1}/{.param2}/{;param3*}/foo") |
| 468 | assert.EqualValues(t, []string{"param1", "param2", "param3"}, result) |
| 469 | |
| 470 | result = OrderedParamsFromUri("/path/foo") |
| 471 | assert.EqualValues(t, []string{}, result) |
| 472 | |
| 473 | // A parameter can appear more than once in the URI (e.g. Keycloak API). |
| 474 | // OrderedParamsFromUri faithfully returns all occurrences. |
| 475 | result = OrderedParamsFromUri("/admin/realms/{realm}/clients/{client-uuid}/roles/{role-name}/composites/clients/{client-uuid}") |
| 476 | assert.EqualValues(t, []string{"realm", "client-uuid", "role-name", "client-uuid"}, result) |
| 477 | } |
| 478 | |
| 479 | func TestSortParamsByPath(t *testing.T) { |
| 480 | strSchema := &openapi3.Schema{Type: &openapi3.Types{"string"}} |
nothing calls this directly
no test coverage detected