github.com/kyma-project/kyma-environment-broker@v0.0.1/internal/process/provisioning/create_cluster_configuration_step_test.go (about) 1 package provisioning 2 3 import ( 4 "testing" 5 6 "github.com/kyma-project/kyma-environment-broker/internal/fixture" 7 "github.com/kyma-project/kyma-environment-broker/internal/reconciler" 8 "github.com/kyma-project/kyma-environment-broker/internal/storage" 9 "github.com/sirupsen/logrus" 10 "github.com/stretchr/testify/assert" 11 "github.com/stretchr/testify/require" 12 ) 13 14 func TestCreateClusterConfigurationStep_Run(t *testing.T) { 15 // given 16 st := storage.NewMemoryStorage() 17 reconcilerClient := reconciler.NewFakeClient() 18 step := NewCreateClusterConfiguration(st.Operations(), st.RuntimeStates(), reconcilerClient) 19 operation := fixture.FixProvisioningOperation(operationID, instanceID) 20 operation.RuntimeID = runtimeID 21 st.Operations().InsertOperation(operation) 22 23 // when 24 _, d, err := step.Run(operation, logrus.New()) 25 26 // then 27 require.NoError(t, err) 28 assert.Zero(t, d) 29 assert.True(t, reconcilerClient.ClusterExists(runtimeID)) 30 }