Commit 158b9ef6 authored by Dimitrios Gogos's avatar Dimitrios Gogos
Browse files

feat: update OEG base URL to v0.1alpha1 in API configuration and tests

parent e39d2b1d
Loading
Loading
Loading
Loading
Loading
+1 −1
Changes for portal-gui/src/app/config/api.ts: 1 added line, 1 removed line.
Original line number Diff line number Diff line
// The portal backend forwards /api/oeg/* to OEG, with the user's token.
export const oeg = {
  baseUrl: '/api/oeg/edge-application-management/vwip',
  baseUrl: '/api/oeg/edge-application-management/v0.1alpha1',
  jsonUrl: '/api/oeg/openapi.json',
};

+3 −3
Changes for tests/unit/test_oeg_proxy.py: 3 added lines, 3 removed lines.
Original line number Diff line number Diff line
@@ -102,7 +102,7 @@ def _log_in(client: TestClient, sessions: FakeLoginSessionRepository) -> None:


def test_without_a_session_nothing_reaches_oeg(client: TestClient, oeg: FakeOEG) -> None:
    response = client.get("/api/oeg/edge-application-management/vwip/apps")
    response = client.get("/api/oeg/edge-application-management/v0.1alpha1/apps")

    assert response.status_code == 401
    assert oeg.requests == []
@@ -128,13 +128,13 @@ def test_forwards_method_path_query_and_body(
    oeg.answer = httpx.Response(201, json={"appId": "a1"}, headers={"x-correlator": "abc"})

    response = client.post(
        "/api/oeg/edge-application-management/vwip/apps?dryRun=true",
        "/api/oeg/edge-application-management/v0.1alpha1/apps?dryRun=true",
        json={"name": "demo"},
    )

    sent = oeg.requests[0]
    assert sent.method == "POST"
    assert str(sent.url) == f"{OEG}/edge-application-management/vwip/apps?dryRun=true"
    assert str(sent.url) == f"{OEG}/edge-application-management/v0.1alpha1/apps?dryRun=true"
    assert sent.content == b'{"name":"demo"}'
    assert sent.headers["content-type"] == "application/json"
    assert response.status_code == 201