49f08f001d
P5-W2 원천세·부가세 분기신고 미커밋분 + P5-W3 메뉴/권한 보강(V74) + P5-W3 본론(V75~V78)을 일괄 정리. - V75 accounting_close / account_balance_snapshot (회계 결산) - V76 retention_anomaly_alert / forecast_kpi_monthly (이상치·예측 KPI) - V77 year_end_statement (연말 지급명세서) - V78 P5-W3 본론 메뉴 4 + 권한 + 공통코드 7그룹 + 테스트데이터 - api: AccountingClose/YearEndStatement/ForecastKpi/RetentionAnomaly Service+Controller - batch: BatchConfig Step 11/12 (원천세·부가세 분기) 연결 - frontend: 4화면(AccountingClose/YearEndStatement/RetentionAnomaly/ForecastKpi) + API 모듈 4 + 라우트 - frontend: usePermission/PermissionButton EXECUTE 권한 누락 보강 - fix: YearEndStatementMapper.xml 미존재 컬럼 a.agent_code 참조 제거 통합검증: Flyway V74~V78 운영DB 적용(v78), 4모듈 compileJava + 프론트 build PASS, 스모크 GET 8/8 + 쓰기 4/4 PASS, verify_v74.py 20/20 PASS. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
56 lines
1.8 KiB
Python
56 lines
1.8 KiB
Python
# -*- coding: utf-8 -*-
|
|
"""P5-W3 본론(V75~V78) 스모크 테스트 — 로그인 후 신규 엔드포인트 검증"""
|
|
import json
|
|
import urllib.request
|
|
|
|
BASE = "http://localhost:8082"
|
|
|
|
|
|
def call(method, path, token=None, body=None):
|
|
data = json.dumps(body).encode() if body is not None else None
|
|
req = urllib.request.Request(BASE + path, data=data, method=method)
|
|
req.add_header("Content-Type", "application/json")
|
|
if token:
|
|
req.add_header("Authorization", "Bearer " + token)
|
|
try:
|
|
with urllib.request.urlopen(req, timeout=15) as r:
|
|
return r.status, json.loads(r.read().decode())
|
|
except urllib.error.HTTPError as e:
|
|
return e.code, json.loads(e.read().decode() or "{}")
|
|
|
|
|
|
# 1. 로그인
|
|
for pw in ["admin1234!", "admin1234", "admin"]:
|
|
st, bd = call("POST", "/api/auth/login", body={"loginId": "admin", "password": pw})
|
|
if st == 200 and bd.get("success"):
|
|
token = bd["data"]["accessToken"]
|
|
print("[LOGIN] OK (pw=%s) roles=%s" % (pw, bd["data"].get("roles")))
|
|
break
|
|
else:
|
|
print("[LOGIN] FAIL: %s %s" % (st, bd))
|
|
raise SystemExit(1)
|
|
|
|
# 2. 신규 + 회귀 엔드포인트 GET 검증
|
|
endpoints = [
|
|
"/api/accounting-closes",
|
|
"/api/year-end-statements",
|
|
"/api/forecast-kpi",
|
|
"/api/retention-anomalies",
|
|
"/api/agent-annual-incomes",
|
|
"/api/accounting-entries",
|
|
"/api/withholding-tax-reports",
|
|
"/api/vat-reports",
|
|
]
|
|
ok = 0
|
|
for ep in endpoints:
|
|
st, bd = call("GET", ep, token)
|
|
success = st == 200 and bd.get("success")
|
|
cnt = ""
|
|
if success and isinstance(bd.get("data"), dict) and "list" in bd["data"]:
|
|
cnt = " (list=%d)" % len(bd["data"]["list"])
|
|
print(" [%s] GET %s -> %s%s" % ("PASS" if success else "FAIL", ep, st, cnt))
|
|
if success:
|
|
ok += 1
|
|
|
|
print("\n[RESULT] %d/%d endpoints PASS" % (ok, len(endpoints)))
|