Skip to content

Refactor AssetDirectoryReaderTest to use light fixture#2721

Merged
Haehnchen merged 1 commit intomasterfrom
feature/AssetDirectoryReaderTest-light
Apr 7, 2026
Merged

Refactor AssetDirectoryReaderTest to use light fixture#2721
Haehnchen merged 1 commit intomasterfrom
feature/AssetDirectoryReaderTest-light

Conversation

@Haehnchen
Copy link
Copy Markdown
Owner

No description provided.

Copy link
Copy Markdown

@utafrali utafrali left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clean refactoring that migrates the test to a lighter, faster fixture base class. The bundled fix of orElseGet(null) to orElse(null) is a real correctness improvement. The only minor issue is the use of the deprecated getBaseDir() API.


assertNotNull(new AssetDirectoryReader()
.resolveAssetFile(getProject(), "test.js").stream()
.filter(virtualFile -> "test.js".equals(virtualFile.getName()))
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Worth calling out: the switch from .orElseGet(null) to .orElse(null) is a correctness fix, not just a style cleanup. Passing null to orElseGet throws a NullPointerException at runtime because it expects a non-null Supplier<T>. This bug was silently masked by the old temp fixture approach if those code paths were never actually hit with a missing file.

@Haehnchen Haehnchen merged commit f6be1b3 into master Apr 7, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants