@@ -138,16 +138,27 @@ func TestAccStreamProcessor_withOptionsDLQAutoscaling(t *testing.T) {
138138 CheckDestroy : checkDestroyStreamProcessor ,
139139 Steps : []resource.TestStep {
140140 {
141- // Autoscaling is persisted by Create before the provider starts the
142- // processor. The subsequent :startWith request does not repeat it.
143141 Config : configWithOptionsDLQAutoscaling (t , projectID , workspaceName , clusterName , processorName , streamProcessorOptionsConfig {
144142 includeDLQ : true ,
145143 autoscalingMinTier : "SP10" ,
146144 autoscalingMaxTier : "SP50" ,
147- state : streamprocessor .StartedState ,
145+ state : streamprocessor .CreatedState ,
148146 }),
149147 Check : resource .ComposeAggregateTestCheckFunc (
150148 resource .TestCheckResourceAttrSet (resourceName , "id" ),
149+ resource .TestCheckResourceAttr (resourceName , "options.autoscaling.min_tier" , "SP10" ),
150+ resource .TestCheckResourceAttr (resourceName , "options.autoscaling.max_tier" , "SP50" ),
151+ resource .TestCheckResourceAttrSet (resourceName , "effective_tier" ),
152+ ),
153+ },
154+ {
155+ Config : configWithOptionsDLQAutoscaling (t , projectID , workspaceName , clusterName , processorName , streamProcessorOptionsConfig {
156+ includeDLQ : true ,
157+ autoscalingMinTier : "SP10" ,
158+ autoscalingMaxTier : "SP50" ,
159+ state : streamprocessor .StartedState ,
160+ }),
161+ Check : resource .ComposeAggregateTestCheckFunc (
151162 resource .TestCheckResourceAttr (resourceName , "state" , streamprocessor .StartedState ),
152163 resource .TestCheckResourceAttr (resourceName , "options.autoscaling.min_tier" , "SP10" ),
153164 resource .TestCheckResourceAttr (resourceName , "options.autoscaling.max_tier" , "SP50" ),
@@ -185,6 +196,38 @@ func TestAccStreamProcessor_withOptionsDLQAutoscaling(t *testing.T) {
185196 }})
186197}
187198
199+ func TestAccStreamProcessor_withOptionsDLQAutoscalingCreateStarted (t * testing.T ) {
200+ var (
201+ projectID , workspaceName = acc .ProjectIDExecutionWithStreamInstance (t )
202+ _ , clusterName = acc .ClusterNameExecution (t , false )
203+ randomSuffix = acctest .RandString (5 )
204+ processorName = "new-processor-autoscaling-started-" + randomSuffix
205+ )
206+
207+ resource .Test (t , resource.TestCase {
208+ PreCheck : func () { acc .PreCheckBasic (t ) },
209+ ProtoV6ProviderFactories : acc .TestAccProviderV6Factories ,
210+ CheckDestroy : checkDestroyStreamProcessor ,
211+ Steps : []resource.TestStep {
212+ {
213+ Config : configWithOptionsDLQAutoscaling (t , projectID , workspaceName , clusterName , processorName , streamProcessorOptionsConfig {
214+ includeDLQ : true ,
215+ autoscalingMinTier : "SP10" ,
216+ autoscalingMaxTier : "SP50" ,
217+ state : streamprocessor .StartedState ,
218+ }),
219+ Check : resource .ComposeAggregateTestCheckFunc (
220+ resource .TestCheckResourceAttrSet (resourceName , "id" ),
221+ resource .TestCheckResourceAttr (resourceName , "state" , streamprocessor .StartedState ),
222+ resource .TestCheckResourceAttr (resourceName , "options.autoscaling.min_tier" , "SP10" ),
223+ resource .TestCheckResourceAttr (resourceName , "options.autoscaling.max_tier" , "SP50" ),
224+ resource .TestCheckResourceAttrSet (resourceName , "effective_tier" ),
225+ ),
226+ },
227+ importStep (),
228+ }})
229+ }
230+
188231func basicTestCase (t * testing.T ) * resource.TestCase {
189232 t .Helper ()
190233 var (
0 commit comments