diff --git a/process/context/command_test.go b/process/context/command_test.go
index <HASH>..<HASH> 100644
--- a/process/context/command_test.go
+++ b/process/context/command_test.go
@@ -10,8 +10,10 @@ import (
 	jc "github.com/juju/testing/checkers"
 	gc "gopkg.in/check.v1"
 
+	"github.com/juju/juju/process/context"
 	coretesting "github.com/juju/juju/testing"
 	"github.com/juju/juju/worker/uniter/runner/jujuc"
+	jujuctesting "github.com/juju/juju/worker/uniter/runner/jujuc/testing"
 )
 
 type commandSuite struct {
@@ -50,6 +52,8 @@ func (s *commandSuite) checkHelp(c *gc.C, expected string) {
 }
 
 func (s *commandSuite) checkRun(c *gc.C, expectedOut, expectedErr string) {
+	context.SetComponent(s.cmd, jujuctesting.ContextComponent{s.Stub})
+
 	err := s.cmd.Run(s.cmdCtx)
 	c.Assert(err, jc.ErrorIsNil)
Set the component to a test double in checkRun.