Skip to content

test: enhance DefaultBeanDependencyResolverTest coverage toward 100%#174

Merged
mercyblitz merged 3 commits intomainfrom
copilot/enhance-code-coverage-tests
Mar 20, 2026
Merged

test: enhance DefaultBeanDependencyResolverTest coverage toward 100%#174
mercyblitz merged 3 commits intomainfrom
copilot/enhance-code-coverage-tests

Conversation

Copy link
Contributor

Copilot AI commented Mar 20, 2026

  • Enhance ResourceInjectionPointDependencyResolverTest (+8 tests): @Resource(type=...), @Resource(name=...), no-annotation early return, non-setter method name derivation, setter name derivation, explicit parameter name
  • Create AnnotatedInjectionPointDependencyResolverTest (new, 7 tests): getAnnotationType() via type inference for Autowired and Resource; getAnnotation(Field) present/absent; getAnnotation(Parameter) present/absent
  • Enhance AnnotatedInjectionBeanPostProcessorTest (+4 tests): setter/getter round-trip for all flags, afterPropertiesSet+destroy, postProcessMergedBeanDefinition, determineCandidateConstructors returns null for unannotated class
  • Create TTLCacheResolverTest (new, 4 tests): BEAN_NAME constant, resolver bean in context, resolveCaches with MINUTES TTL, resolveCaches with SECONDS TTL
  • Enhance AbstractPageRenderContextHandlerInterceptorTest (+3 tests): empty view name not a page-render request, default preHandle returns true, default afterCompletion does not throw
  • Enhance ParallelPreInstantiationSingletonsBeanFactoryListenerTest (+2 tests): wrong-factory guard, threads=0 disables executor
  • Enhance DependencyAnalysisBeanFactoryListenerTest (+1 test): run analysis on fresh factory with bean dependencies
  • Enhance PropertySourcesUtilsTest (+9 tests): getDefaultProperties single-arg, getDefaultPropertiesPropertySource single-arg and with existing source, containsPropertySource, containsBootstrapPropertySource, getProperties on enumerable/non-enumerable, getPropertyNames on non-enumerable, findPropertyNames with predicate, findConfiguredPropertySource skips "configurationProperties" source
  • Run full module tests — 593 context + 159 webmvc = 752 tests, 0 failures

🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

…test cases

Co-authored-by: mercyblitz <533114+mercyblitz@users.noreply.github.com>
@codecov
Copy link

codecov bot commented Mar 20, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
see 8 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

…AnnotatedInjectionPointDependencyResolver, AnnotatedInjectionBeanPostProcessor, TTLCacheResolver, AbstractPageRenderContextHandlerInterceptor, ParallelPreInstantiationSingletonsBeanFactoryListener, DependencyAnalysisBeanFactoryListener, PropertySourcesUtils

Co-authored-by: mercyblitz <533114+mercyblitz@users.noreply.github.com>
Copilot AI requested a review from mercyblitz March 20, 2026 08:42
Update ResourceInjectionPointDependencyResolverTest to expect and use the default generated bean name (resourceInjectionPointDependencyResolverTest). Replaced explicit @resource names and corresponding assertions (previously "explicitBeanName" and "myParam") with the generated bean name to align tests with current bean naming behavior.
@sonarqubecloud
Copy link

@mercyblitz mercyblitz merged commit 9996eb7 into main Mar 20, 2026
17 checks 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