// All resources already at their desired states.
// Nothing gets applied but everything considered valid.
All resources already at their desired states.
Nothing gets applied but everything considered valid.
// All resources already at their desired states . // Nothing gets applied but everything considered valid .
func TestStraightLinePlanApplyAllUpToDate(t *testing.T) {
	r := &testutils.MockRunner{Output: "", Err: nil}
	b := NewBuilder()
	b.AddResource("resource-1", &testResource{ID: "resource-1"})
	b.AddResource("resource-2", &testResource{ID: "resource-2"}, DependOn("resource-1"))
	b.AddResource("resource-3", &testResource{ID: "resource-3"}, DependOn("resource-2"))
	b.AddResource("resource-4", &testResource{ID: "resource-4"}, DependOn("resource-3"))
	assert.Equal(t, 0, len(b.Errors()))
	p, err := b.Plan()
	assert.NoError(t, err)
	diff := Diff{
		CurrentState:    EmptyState,
		InvalidatedDeps: []Resource{}}
	propagate, err := p.Apply(r, diff)
	assert.NoError(t, err)
	assert.False(t, propagate)
}
func TestStraightLinePlanApplyAllUpToDate ( t * testing . T ) { r := & testutils . MockRunner { Output : " " , Err : nil } b := NewBuilder ( ) b . AddResource ( " " , & testResource { ID : " " } ) b . AddResource ( " " , & testResource { ID : " " } , DependOn ( " " ) ) b . AddResource ( " " , & testResource { ID : " " } , DependOn ( " " ) ) b . AddResource ( " " , & testResource { ID : " " } , DependOn ( " " ) ) assert . Equal ( t , 0 , len ( b . Errors ( ) ) ) p , err := b . Plan ( ) assert . NoError ( t , err ) diff := Diff { CurrentState : EmptyState , InvalidatedDeps : [ ] Resource { } } propagate , err := p . Apply ( r , diff ) assert . NoError ( t , err ) assert . False ( t , propagate ) }
All resources already at their desired states.
All resources already at their desired states .