From d446d32d96b71e078ad76fc15abd8697bfaf1524 Mon Sep 17 00:00:00 2001 From: Martin Atkins Date: Sun, 30 Sep 2018 08:59:10 -0700 Subject: [PATCH] command: Fix TestApply for new mock provider interface It must now provide a basic implementation of plan and apply for its mock provider, which in this case can just pass through the proposed value generated by core because there are no computed attributes in this schema. --- command/apply_test.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/command/apply_test.go b/command/apply_test.go index b371555f72..25a57ce8b6 100644 --- a/command/apply_test.go +++ b/command/apply_test.go @@ -34,6 +34,16 @@ func TestApply(t *testing.T) { p := testProvider() p.GetSchemaReturn = applyFixtureSchema() + p.PlanResourceChangeFn = func (req providers.PlanResourceChangeRequest) providers.PlanResourceChangeResponse { + return providers.PlanResourceChangeResponse{ + PlannedState: req.ProposedNewState, + } + } + p.ApplyResourceChangeFn = func (req providers.ApplyResourceChangeRequest) providers.ApplyResourceChangeResponse { + return providers.ApplyResourceChangeResponse{ + NewState: req.PlannedState, + } + } ui := new(cli.MockUi) c := &ApplyCommand{