スキル一覧に戻る
navikt

melosys-eessi-debugger

by navikt

End-to-end tester for Melosys. Kjører opp hele systemet via Docker Compose og kjører Playwright-tester mot applikasjonene.

0🍴 0📅 2026年1月21日
GitHubで見るManusで実行

SKILL.md


name: melosys-eessi-debugger description: | Debug EUX/EESSI mock issues in melosys E2E tests. Use when:

  • E2E tests fail with 404 errors from /eux/... endpoints
  • melosys-api logs show "Kall mot eessi feilet" errors
  • melosys-eessi logs show NotFoundException for eux endpoints
  • Adding new EESSI/EUX functionality that requires mock support
  • Tracing data flow: melosys-api → melosys-eessi → melosys-mock

Melosys EESSI Debugger

Debug and fix mock endpoint issues for EUX/EESSI integration in E2E tests.

Architecture Overview

┌─────────────────┐     ┌─────────────────┐     ┌─────────────────┐
│  melosys-api    │────▶│  melosys-eessi  │────▶│  melosys-mock   │
│  (port 8080)    │     │  (port 8081)    │     │  (port 8083)    │
└─────────────────┘     └─────────────────┘     └─────────────────┘
                                                        │
                                                        ▼
                                               ┌─────────────────┐
                                               │  EuxRinaApi.kt  │
                                               │  /eux/...       │
                                               └─────────────────┘

Key insight: melosys-eessi adds /cpi/ prefix to most EUX calls, so endpoints need BOTH versions:

  • /eux/buc/{id} - direct calls
  • /eux/cpi/buc/{id} - calls via melosys-eessi

Repo Locations

RepoPathPurpose
melosys-e2e-testsCurrent projectE2E tests with Playwright
melosys-api~/source/nav/melosys-apiMain backend
melosys-web~/source/nav/melosys-webFrontend
melosys-eessi~/source/nav/melosys-eessiEESSI integration
melosys-mock~/source/nav/melosys-docker-compose/mockMock service
eux-rina-api~/source/nav/eux-rina-apiReference only

Debugging Workflow

1. Identify the Missing Endpoint

Look for 404 errors in logs:

# melosys-api error pattern:
"Kall mot eessi feilet 404 NOT_FOUND"

# melosys-eessi error pattern:
"404 fra eux: {...\"path\":\"/eux/cpi/...\"}"

Extract the path from the error, e.g., /eux/cpi/buc/{id}/sed/{sedId}/handlinger

2. Check eux-rina-api for Reference

Find the endpoint in eux-rina-api to understand expected behavior:

# Search for endpoint pattern
grep -r "handlinger" ~/source/nav/eux-rina-api/src --include="*.kt"

3. Add Endpoint to melosys-mock

Edit melosys-docker-compose/mock/src/main/kotlin/no/nav/melosys/melosysmock/eux/EuxRinaApi.kt

Pattern for CPI endpoints:

@GetMapping("/cpi/buc/{rinaSaksnummer}/sed/{dokumentId}/handlinger")
fun hentSedHandlingerCpi(
    @PathVariable rinaSaksnummer: String,
    @PathVariable dokumentId: String
): List<String> {
    log.info("CPI: Henter handlinger for SED $dokumentId på BUC $rinaSaksnummer")
    return listOf("Read", "Update", "Send", "Cancel")
}

4. Restart Mock and Test

cd ~/source/nav/melosys-docker-compose
docker compose restart melosys-mock

Common Endpoint Patterns

See references/cpi-endpoints.md for complete list of CPI endpoints.

BUC Operations

EndpointMethodReturns
/cpi/bucPOSTBUC ID string
/cpi/buc/{id}GETBUC JSON
/cpi/buc/{id}/mottakerePUTvoid
/cpi/buc/{id}/muligeaksjonerGETList

SED Operations

EndpointMethodReturns
/cpi/buc/{id}/sedPOSTSED ID string
/cpi/buc/{id}/sed/{sedId}GETSED JSON
/cpi/buc/{id}/sed/{sedId}/handlingerGETList
/cpi/buc/{id}/sed/{sedId}/sendPOSTvoid
/cpi/buc/{id}/sed/{sedId}/vedleggPOST (multipart)vedlegg ID

Utility

EndpointMethodReturns
/cpi/url/buc/{id}GETRINA URL string
/cpi/institusjonerGETInstitutions JSON
/cpi/sed/pdfPOSTPDF bytes

Tracing Request Flow

In melosys-api

Look for calls to EessiService or BucService:

grep -r "eessiService\|bucService" ~/source/nav/melosys-api/app/src --include="*.kt" --include="*.java"

In melosys-eessi

The EuxConsumer.java makes actual HTTP calls:

grep -r "exchange\|getForObject\|postForObject" ~/source/nav/melosys-eessi/src --include="*.java"

Key file: EuxConsumer.java - contains all REST client methods

In melosys-mock

All EUX endpoints: EuxRinaApi.kt

grep -r "@.*Mapping" ~/source/nav/melosys-docker-compose/mock/src/main/kotlin/no/nav/melosys/melosysmock/eux/

Quick Fixes

Missing CPI endpoint

Most CPI endpoints mirror non-CPI endpoints. Copy the existing endpoint and:

  1. Add /cpi to the path
  2. Add Cpi suffix to method name
  3. Add "CPI:" prefix to log message

Wrong response type

Check eux-rina-api for expected return type. Common issues:

  • Returning void when String expected
  • Returning object when List expected

Multipart upload issues

Vedlegg endpoints require:

@PostMapping("...", consumes = [MediaType.MULTIPART_FORM_DATA_VALUE])
fun method(@RequestParam("file") file: MultipartFile?)

スコア

総合スコア

55/100

リポジトリの品質指標に基づく評価

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

0/10
説明文

100文字以上の説明がある

+10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

0/5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

レビュー

💬

レビュー機能は近日公開予定です