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.
pull/19086/head
Martin Atkins 8 years ago
parent 5021e0e098
commit d446d32d96

@ -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{

Loading…
Cancel
Save