test: consolidate Java Optional receiver checks (#3784)

Co-authored-by: Gergo Magyar <gergomagyar0@gmail.com>
This commit is contained in:
Gergő Magyar 2026-10-31 04:39:21 +00:00 • committed by GitHub
parent 36fefca17e
commit ea0ee25908
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1134,28 +1134,6 @@ describe('Java Optional<User> receiver resolution via wrapper unwrapping', () =>
expect(saveMethods.length).toBe(2);
});
it('resolves user.save() to User#save with Optional<User> in scope', () => {
const calls = getRelationships(result, 'CALLS');
const userSave = calls.find(
(c) =>
c.target === 'save' &&
c.source === 'processEntities' &&
c.targetFilePath?.includes('User.java'),
);
expect(userSave).toBeDefined();
});
it('resolves repo.save() to Repo#save alongside Optional usage', () => {
const calls = getRelationships(result, 'CALLS');
const repoSave = calls.find(
(c) =>
c.target === 'save' &&
c.source === 'processEntities' &&
c.targetFilePath?.includes('Repo.java'),
);
expect(repoSave).toBeDefined();
});
it('disambiguates user.save() and repo.save() to different files', () => {
const calls = getRelationships(result, 'CALLS');
const userSave = calls.find(