/** * TC-PRODUCT_API-018 · 条件不满足时不能办理数据产品传输 * REQ-016 [FL-4.4] 反向/等价类 P0 */ export const meta = { tc: 'TC-PRODUCT_API-018', req: 'REQ-016', title: '条件不满足时不能办理数据产品传输', type: '反向/等价类', priority: 'P0', needs: ['be'] } export async function run(t) { await t.login() // 不存在的产品 id const r1 = await t.api('POST', '/api/ssw/tdc/ApiGateway/Invoke', { productId: 'NOT-EXIST-' + Date.now(), payload: {} }) t.assert(r1.code !== 200 || /不存在|未找到/.test(r1.msg || ''), `不存在的产品被拒:code=${r1.code} msg=${r1.msg || ''}`) // 未上架的产品(取一个 OFFLINE 的) const off = await t.apiList('/api/ssw/tds/DataProduct', { status: 'OFFLINE' }) if (off.length) { const r2 = await t.api('POST', '/api/ssw/tdc/ApiGateway/Invoke', { productId: off[0].id, payload: {} }) t.assert(r2.code !== 200 || /下架|不可用|未上架/.test(r2.msg || ''), `OFFLINE 产品被拒:code=${r2.code} msg=${r2.msg || ''}`) } }