- boot/ (Java/Maven, JNPF 7.0) — 移除旧的 boot/.git,源码直接纳入仓库
- web/ (Vue 3 + Vite + Ant Design Vue, pnpm)
- docs/, scard/, nax/
- refs/INDEX.md + refs/国标/(其余 refs/* 开源子仓库不纳入)
- 已忽略: connector_data/, jweb/, log/, web/{dist,node_modules,.pnpm}, boot/*/target/, .DS_Store, .idea, .vscode
32 lines
1.5 KiB
JavaScript
32 lines
1.5 KiB
JavaScript
/**
|
|
* TC-CONTRACT-018 · 重复办理合约创建时不会重复处理
|
|
* REQ-012 [FL-5.2] 反向/错误推测 P1
|
|
*/
|
|
export const meta = { tc: 'TC-CONTRACT-018', req: 'REQ-012', title: '重复办理合约创建时不会重复处理', type: '反向/错误推测', priority: 'P1', route: '/tds/contracts', needs: ['fe','be'] }
|
|
export async function run(t) {
|
|
await t.login()
|
|
await t.goto('/tds/contracts')
|
|
await t.pickSpace()
|
|
const code = t.uid('CT-DUP')
|
|
const spaces = await t.apiList('/api/ssw/tds/Space')
|
|
const conns = await t.apiList('/api/ssw/tds/Connector')
|
|
const prods = await t.apiList('/api/ssw/tds/DataProduct')
|
|
if (!spaces.length || conns.length < 2 || !prods.length) t.skip('需要至少 1 空间 + 2 连接器 + 1 产品做幂等基线')
|
|
const payload = {
|
|
contractCode: code,
|
|
name: code + '-重复创建烟测',
|
|
spaceId: spaces[0].id,
|
|
productId: prods[0].id,
|
|
providerConnectorId: conns[0].id,
|
|
consumerConnectorId: conns[1].id,
|
|
providerOrgName: '尚数网-提供方',
|
|
consumerOrgName: '尚数网-使用方',
|
|
purpose: '幂等烟测',
|
|
deliveryType: 'API',
|
|
priceMode: 'FREE'
|
|
}
|
|
const r1 = await t.api('POST', '/api/ssw/tds/Contract', payload)
|
|
const r2 = await t.api('POST', '/api/ssw/tds/Contract', payload)
|
|
t.assert(r1.code === 200 || /存在|重复|唯一/.test(r1.msg || ''), `首次创建:code=${r1.code}`)
|
|
t.assert(r2.code !== 200 || /存在|重复|唯一/.test(r2.msg || ''), `重复创建应被拒:code=${r2.code} msg=${r2.msg || ''}`)
|
|
} |