@@ -15,8 +15,6 @@ import (
1515)
1616
1717func TestCreateFlowDefinitionUnauthenticated (t * testing.T ) {
18- t .Parallel ()
19-
2018 userSchema := "https://some-tenant.com/schemas/unknown-user-schema.yaml"
2119 userSchemaURI , err := url .Parse (userSchema )
2220 require .NoError (t , err )
@@ -49,12 +47,11 @@ func TestCreateFlowDefinitionUnauthenticated(t *testing.T) {
4947}
5048
5149func TestCreateFlowDefinition (t * testing.T ) {
52- t .Parallel ()
5350 project , err := harness .EnsureProjectService (t ).Create (t .Context (), nil )
5451 require .NoError (t , err )
55- harness .CreateUserSchema (t , project .ID , harness .TestData .Schemas .CreateSchemaRequestUserSchema )
5652
57- u := "https://raw.githubusercontent.com/zitadel/nextgen/refs/heads/main/api/openapi/endpoints/schemas/examples/user-schema-example.yaml"
53+ u := flowDefinitionSchemaURL (t )
54+ harness .EnsureUserSchemaWithID (t , project .ID , harness .TestData .Schemas .CreateSchemaRequestUserSchema , u )
5855 userSchemaURI , err := url .Parse (u )
5956 require .NoError (t , err )
6057
@@ -290,7 +287,6 @@ func TestCreateFlowDefinition(t *testing.T) {
290287 }
291288 for _ , tt := range tests {
292289 t .Run (tt .name , func (t * testing.T ) {
293- t .Parallel ()
294290 client := harness .EnsureAPIClient (t , project .ID )
295291 resp , err := client .CreateFlowDefinition (t .Context (), tt .req )
296292 assert .NoError (t , err )
@@ -365,8 +361,12 @@ func validSteps() []api.FlowDefinitionStep {
365361 }
366362}
367363
364+ func flowDefinitionSchemaURL (t * testing.T ) string {
365+ t .Helper ()
366+ return "https://test.example.schemas.com/integration/" + url .PathEscape (t .Name ()) + ".json"
367+ }
368+
368369func TestGetFlowDefinitionUnauthenticated (t * testing.T ) {
369- t .Parallel ()
370370 client := harness .EnsureAnonymousAPIClient (t )
371371 getResp , err := client .GetFlowDefinition (t .Context (), api.GetFlowDefinitionParams {
372372 ID : "flowDef_1234" ,
@@ -385,11 +385,10 @@ func TestGetFlowDefinitionUnauthenticated(t *testing.T) {
385385}
386386
387387func TestGetFlowDefinition (t * testing.T ) {
388- t .Parallel ()
389388 project , err := harness .EnsureProjectService (t ).Create (t .Context (), nil )
390389 require .NoError (t , err )
391- harness . CreateUserSchema ( t , project . ID , harness . TestData . Schemas . CreateSchemaRequestUserSchema )
392- u := "https://raw.githubusercontent.com/zitadel/nextgen/refs/heads/main/api/openapi/endpoints/schemas/examples/user-schema-example.yaml"
390+ u := flowDefinitionSchemaURL ( t )
391+ harness . EnsureUserSchemaWithID ( t , project . ID , harness . TestData . Schemas . CreateSchemaRequestUserSchema , u )
393392 userSchemaURI , err := url .Parse (u )
394393 require .NoError (t , err )
395394
@@ -442,7 +441,6 @@ func TestGetFlowDefinition(t *testing.T) {
442441 }
443442 for _ , tt := range tests {
444443 t .Run (tt .name , func (t * testing.T ) {
445- t .Parallel ()
446444 client := harness .EnsureAPIClient (t , project .ID )
447445 resp , err := client .GetFlowDefinition (t .Context (), tt .req )
448446 assert .NoError (t , err )
@@ -452,8 +450,6 @@ func TestGetFlowDefinition(t *testing.T) {
452450}
453451
454452func TestListFlowDefinitionsUnauthenticated (t * testing.T ) {
455- t .Parallel ()
456-
457453 client := harness .EnsureAnonymousAPIClient (t )
458454 getResp , err := client .ListFlowDefinitions (t .Context (), api.ListFlowDefinitionsParams {
459455 ProjectID : "proj_1234" ,
@@ -471,19 +467,18 @@ func TestListFlowDefinitionsUnauthenticated(t *testing.T) {
471467}
472468
473469func TestListFlowDefinitions (t * testing.T ) {
474- t .Parallel ()
475470 project1 , err := harness .EnsureProjectService (t ).Create (t .Context (), nil )
476471 require .NoError (t , err )
477- harness .CreateUserSchema (t , project1 .ID , harness .TestData .Schemas .CreateSchemaRequestUserSchema )
478472
479473 project2 , err := harness .EnsureProjectService (t ).Create (t .Context (), nil )
480474 require .NoError (t , err )
481- harness .CreateUserSchema (t , project2 .ID , harness .TestData .Schemas .CreateSchemaRequestUserSchema )
482475
483476 project3 , err := harness .EnsureProjectService (t ).Create (t .Context (), nil )
484477 require .NoError (t , err )
485478
486- u := "https://raw.githubusercontent.com/zitadel/nextgen/refs/heads/main/api/openapi/endpoints/schemas/examples/user-schema-example.yaml"
479+ u := flowDefinitionSchemaURL (t )
480+ harness .EnsureUserSchemaWithID (t , project1 .ID , harness .TestData .Schemas .CreateSchemaRequestUserSchema , u )
481+ harness .EnsureUserSchemaWithID (t , project2 .ID , harness .TestData .Schemas .CreateSchemaRequestUserSchema , u )
487482 userSchemaURI , err := url .Parse (u )
488483 require .NoError (t , err )
489484
@@ -666,7 +661,6 @@ func TestListFlowDefinitions(t *testing.T) {
666661 }
667662 for _ , tt := range tests {
668663 t .Run (tt .name , func (t * testing.T ) {
669- t .Parallel ()
670664 client := harness .EnsureAPIClient (t , project1 .ID )
671665 resp , err := client .ListFlowDefinitions (t .Context (), tt .req )
672666 assert .NoError (t , err )
@@ -699,7 +693,6 @@ func TestListFlowDefinitions(t *testing.T) {
699693}
700694
701695func TestDeleteFlowDefinitionUnauthenticated (t * testing.T ) {
702- t .Parallel ()
703696 client := harness .EnsureAnonymousAPIClient (t )
704697 resp , err := client .DeleteFlowDefinition (t .Context (), api.DeleteFlowDefinitionParams {
705698 ID : "flowDef_1234" ,
@@ -717,11 +710,10 @@ func TestDeleteFlowDefinitionUnauthenticated(t *testing.T) {
717710}
718711
719712func TestDeleteFlowDefinition (t * testing.T ) {
720- t .Parallel ()
721713 project , err := harness .EnsureProjectService (t ).Create (t .Context (), nil )
722714 require .NoError (t , err )
723- harness . CreateUserSchema ( t , project . ID , harness . TestData . Schemas . CreateSchemaRequestUserSchema )
724- u := "https://raw.githubusercontent.com/zitadel/nextgen/refs/heads/main/api/openapi/endpoints/schemas/examples/user-schema-example.yaml"
715+ u := flowDefinitionSchemaURL ( t )
716+ harness . EnsureUserSchemaWithID ( t , project . ID , harness . TestData . Schemas . CreateSchemaRequestUserSchema , u )
725717 userSchemaURI , err := url .Parse (u )
726718 require .NoError (t , err )
727719
@@ -776,7 +768,6 @@ func TestDeleteFlowDefinition(t *testing.T) {
776768 }
777769 for _ , tt := range tests {
778770 t .Run (tt .name , func (t * testing.T ) {
779- t .Parallel ()
780771 client := harness .EnsureAPIClient (t , project .ID )
781772 resp , err := client .DeleteFlowDefinition (t .Context (), tt .req )
782773 assert .NoError (t , err )
0 commit comments