U4-10625 - HealthCheckController non-empty constructor fails to initialize the correct variables

Created by Shannon Deminick 02 Nov 2017, 03:30:27 Updated by Warren Buckley 06 Nov 2017, 08:30:52

Tags: Unscheduled

Relates to: U4-9562

Subtask of: U4-9609

The HealthCheckController ctor overload specifying a IHealthCheckResolver doesn't initialize all required variables

Comments

Shannon Deminick 02 Nov 2017, 04:21:36

PR https://github.com/umbraco/Umbraco-CMS/pull/2280

Testing - only requires a code review


Warren Buckley 03 Nov 2017, 09:29:04

@Shandem I have merged it in as code seems fine.

However got a general dev question - why do we need this new signature & make the current one obsolete where it was loading the HealthCheck config in via UmbracoConfig & the new signature is using it from the parameter?


Shannon Deminick 06 Nov 2017, 08:22:13

@Wawarren.buckley because it should have been like that before - we should be injecting all dependencies into objects via constructors and not relying on any singletons, this makes things testable - it's the principles of dependency injection.


Warren Buckley 06 Nov 2017, 08:30:52

Thanks for the explanation @Shandem


Priority: Normal

Type: Bug

State: Fixed

Assignee:

Difficulty: Normal

Category:

Backwards Compatible: True

Fix Submitted:

Affected versions:

Due in version: 7.7.5

Sprint: Sprint 71

Story Points: 0.5

Cycle: 5