mirror of
https://github.com/abhigyanpatwari/GitNexus.git
synced 2026-10-06 02:49:56 +00:00
test: cover unresolved Spring constant mappings
Add an explicit negative regression for unresolved Spring route constants so broken mappings do not emit Route, HANDLES_ROUTE, or framework CALLS links. Made-with: Cursor
This commit is contained in:
parent
70f39eabca
commit
f760dcd96e
1 changed files with 19 additions and 0 deletions
|
|
@ -94,6 +94,25 @@ describe('Spring route mapping', () => {
|
|||
expect(expectDefined(statusRoute).sourceFilePath).toContain('HealthController.java');
|
||||
});
|
||||
|
||||
it('skips unresolved explicit constant mappings without emitting route links', () => {
|
||||
const routes = getNodesByLabel(result, 'Route');
|
||||
const handlesRouteEdges = getRelationships(result, 'HANDLES_ROUTE');
|
||||
const callEdges = getRelationships(result, 'CALLS');
|
||||
|
||||
expect(routes).toHaveLength(7);
|
||||
expect(
|
||||
handlesRouteEdges.some(
|
||||
(edge) =>
|
||||
edge.sourceFilePath.includes('UserController.java') && edge.target.includes('broken'),
|
||||
),
|
||||
).toBe(false);
|
||||
expect(
|
||||
callEdges.some(
|
||||
(edge) => edge.source === 'UserController.java' && edge.target === 'brokenUsers',
|
||||
),
|
||||
).toBe(false);
|
||||
});
|
||||
|
||||
it('creates framework CALLS edges from controller files to handler methods', () => {
|
||||
const edges = getRelationships(result, 'CALLS');
|
||||
expect(
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue