Skip to content

Fix eager context

Fix eager context #204

GitHub Actions / test report succeeded Apr 10, 2024 in 1s

36 passed, 0 failed and 0 skipped

Tests passed successfully

Report Passed Failed Skipped Time
build/test-results/test/TEST-com.coditory.quark.context.BeanConditionsSpec.xml 5✅ 467ms
build/test-results/test/TEST-com.coditory.quark.context.BeanLifecycleSpec.xml 7✅ 194ms
build/test-results/test/TEST-com.coditory.quark.context.BeanResolutionSpec.xml 9✅ 117ms
build/test-results/test/TEST-com.coditory.quark.context.EventBusRegistrationSpec.xml 4✅ 62ms
build/test-results/test/TEST-com.coditory.quark.context.events.ConfigurationEventEmissionSpec.xml 4✅ 97ms
build/test-results/test/TEST-com.coditory.quark.context.events.ContextEventEmissionSpec.xml 4✅ 65ms
build/test-results/test/TEST-com.coditory.quark.context.PreconditionsSpec.xml 2✅ 10ms
build/test-results/test/TEST-com.coditory.quark.context.ThrowablesSpec.xml 1✅ 9ms

✅ build/test-results/test/TEST-com.coditory.quark.context.BeanConditionsSpec.xml

5 tests were completed in 467ms with 5 passed, 0 failed and 0 skipped.

Test suite Passed Failed Skipped Time
com.coditory.quark.context.BeanConditionsSpec 5✅ 467ms

✅ com.coditory.quark.context.BeanConditionsSpec

✅ should register bean with condition on a property
✅ should not register bean with condition on a missing property
✅ should register bean Foo when Bar -> Foo && Foo -> !Bar
✅ should register bean Foo, Bar, Baz when Bar -> Foo -> Baz -> prop(baz.enabled)
✅ should register Baz, Foo when Bar -> Foo -> Baz -> !Bar

✅ build/test-results/test/TEST-com.coditory.quark.context.BeanLifecycleSpec.xml

7 tests were completed in 194ms with 7 passed, 0 failed and 0 skipped.

Test suite Passed Failed Skipped Time
com.coditory.quark.context.BeanLifecycleSpec 7✅ 194ms

✅ com.coditory.quark.context.BeanLifecycleSpec

✅ should register beans and initialize them
✅ should finalize beans when closing the context
✅ should initialize eager beans after context is built
✅ should not initialize lazy beans that were not retrieved from the context
✅ should inject dependencies to lifecycle annotated methods
✅ should throw error when dependency for @Init annotated method is missing
✅ should throw error when dependency for @Close annotated method is missing

✅ build/test-results/test/TEST-com.coditory.quark.context.BeanResolutionSpec.xml

9 tests were completed in 117ms with 9 passed, 0 failed and 0 skipped.

Test suite Passed Failed Skipped Time
com.coditory.quark.context.BeanResolutionSpec 9✅ 117ms

✅ com.coditory.quark.context.BeanResolutionSpec

✅ should retrieve named bean by type
✅ should fail registering multiple beans with the same name
✅ should retrieve unnamed bean by type when multiple named beans are registered
✅ should fail to retrieve bean by type when multiple named beans are registered
✅ should fail to retrieve bean by type when multiple unnamed beans are registered
✅ should retrieve named bean by type and name
✅ should not retrieve unnamed bean by name
✅ should not retrieve named bean by a different name
✅ should retrieve all named beans by type

✅ build/test-results/test/TEST-com.coditory.quark.context.EventBusRegistrationSpec.xml

4 tests were completed in 62ms with 4 passed, 0 failed and 0 skipped.

Test suite Passed Failed Skipped Time
com.coditory.quark.context.EventBusRegistrationSpec 4✅ 62ms

✅ com.coditory.quark.context.EventBusRegistrationSpec

✅ should not register event bus by default
✅ should register event bus when requested
✅ should subscribe handler annotated with @ContextEventHandler
✅ should not subscribe any handler

✅ build/test-results/test/TEST-com.coditory.quark.context.events.ConfigurationEventEmissionSpec.xml

4 tests were completed in 97ms with 4 passed, 0 failed and 0 skipped.

Test suite Passed Failed Skipped Time
com.coditory.quark.context.events.ConfigurationEventEmissionSpec 4✅ 97ms

✅ com.coditory.quark.context.events.ConfigurationEventEmissionSpec

✅ should emit events when context is built
✅ should emit events when beans are resolved
✅ should emit events when context is closed
✅ should emit events for Configuration beans when context is closed

✅ build/test-results/test/TEST-com.coditory.quark.context.events.ContextEventEmissionSpec.xml

4 tests were completed in 65ms with 4 passed, 0 failed and 0 skipped.

Test suite Passed Failed Skipped Time
com.coditory.quark.context.events.ContextEventEmissionSpec 4✅ 65ms

✅ com.coditory.quark.context.events.ContextEventEmissionSpec

✅ should emit events when context is built
✅ should emit events when beans are resolved
✅ should emit events when context is closed
✅ should not emit context creation events to eventHandler registered as a bean

✅ build/test-results/test/TEST-com.coditory.quark.context.PreconditionsSpec.xml

2 tests were completed in 10ms with 2 passed, 0 failed and 0 skipped.

Test suite Passed Failed Skipped Time
com.coditory.quark.context.PreconditionsSpec 2✅ 10ms

✅ com.coditory.quark.context.PreconditionsSpec

✅ should fail non-null check
✅ should pass non-null check

✅ build/test-results/test/TEST-com.coditory.quark.context.ThrowablesSpec.xml

1 tests were completed in 9ms with 1 passed, 0 failed and 0 skipped.

Test suite Passed Failed Skipped Time
com.coditory.quark.context.ThrowablesSpec 1✅ 9ms

✅ com.coditory.quark.context.ThrowablesSpec

✅ should extract root cause of specific type or null