Skip to content

Commit

Permalink
Fix test after bump to MySQL client 8.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
kentdr committed Mar 11, 2024
1 parent cbb7f99 commit 2b622be
Showing 1 changed file with 46 additions and 46 deletions.
92 changes: 46 additions & 46 deletions src/SqlPersistence.Tests/Saga/SagaPersisterTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -699,55 +699,55 @@ public async Task UpdateWithTransitional()
public void TransitionalProcess()
{
var endpointName = nameof(TransitionalProcess);
using (var connection = dbConnection())
{
var definition1 = new SagaDefinition(
tableSuffix: "CorrAndTransitionalSaga",
name: "CorrAndTransitionalSaga",
correlationProperty: new CorrelationProperty
(
name: "Property1",
type: CorrelationPropertyType.String
)
);
connection.Open();
connection.ExecuteCommand(SagaScriptBuilder.BuildDropScript(definition1, sqlDialect), endpointName, schema: schema);
connection.ExecuteCommand(SagaScriptBuilder.BuildCreateScript(definition1, sqlDialect), endpointName, schema: schema);
Assert.IsTrue(PropertyExists(TestTableName("TransitionalProcess", "CorrAndTransitionalSaga"), CorrelationPropertyName("Property1")));

var definition2 = new SagaDefinition(
tableSuffix: "CorrAndTransitionalSaga",
name: "CorrAndTransitionalSaga",
correlationProperty: new CorrelationProperty
(
name: "Property1",
type: CorrelationPropertyType.String
),
transitionalCorrelationProperty: new CorrelationProperty
(
name: "Property2",
type: CorrelationPropertyType.String
)
);
var definition1 = new SagaDefinition(
tableSuffix: "CorrAndTransitionalSaga",
name: "CorrAndTransitionalSaga",
correlationProperty: new CorrelationProperty
(
name: "Property1",
type: CorrelationPropertyType.String
)
);

connection.ExecuteCommand(SagaScriptBuilder.BuildCreateScript(definition2, sqlDialect), endpointName, schema: schema);
Assert.IsTrue(PropertyExists(TestTableName("TransitionalProcess", "CorrAndTransitionalSaga"), CorrelationPropertyName("Property1")));
Assert.IsTrue(PropertyExists(TestTableName("TransitionalProcess", "CorrAndTransitionalSaga"), CorrelationPropertyName("Property2")));
DropAndCreate(definition1, endpointName, schema);

var definition3 = new SagaDefinition(
tableSuffix: "CorrAndTransitionalSaga",
name: "CorrAndTransitionalSaga",
correlationProperty: new CorrelationProperty
(
name: "Property2",
type: CorrelationPropertyType.String
)
);
var buildCreateScript = SagaScriptBuilder.BuildCreateScript(definition3, sqlDialect);
connection.ExecuteCommand(buildCreateScript, endpointName, schema: schema);
Assert.IsFalse(PropertyExists(TestTableName("TransitionalProcess", "CorrAndTransitionalSaga"), CorrelationPropertyName("Property1")));
Assert.IsTrue(PropertyExists(TestTableName("TransitionalProcess", "CorrAndTransitionalSaga"), CorrelationPropertyName("Property2")));
}
Assert.IsTrue(PropertyExists(TestTableName("TransitionalProcess", "CorrAndTransitionalSaga"), CorrelationPropertyName("Property1")));

var definition2 = new SagaDefinition(
tableSuffix: "CorrAndTransitionalSaga",
name: "CorrAndTransitionalSaga",
correlationProperty: new CorrelationProperty
(
name: "Property1",
type: CorrelationPropertyType.String
),
transitionalCorrelationProperty: new CorrelationProperty
(
name: "Property2",
type: CorrelationPropertyType.String
)
);

DropAndCreate(definition2, endpointName, schema);

Assert.IsTrue(PropertyExists(TestTableName("TransitionalProcess", "CorrAndTransitionalSaga"), CorrelationPropertyName("Property1")));
Assert.IsTrue(PropertyExists(TestTableName("TransitionalProcess", "CorrAndTransitionalSaga"), CorrelationPropertyName("Property2")));

var definition3 = new SagaDefinition(
tableSuffix: "CorrAndTransitionalSaga",
name: "CorrAndTransitionalSaga",
correlationProperty: new CorrelationProperty
(
name: "Property2",
type: CorrelationPropertyType.String
)
);

DropAndCreate(definition3, endpointName, schema);

Assert.IsFalse(PropertyExists(TestTableName("TransitionalProcess", "CorrAndTransitionalSaga"), CorrelationPropertyName("Property1")));
Assert.IsTrue(PropertyExists(TestTableName("TransitionalProcess", "CorrAndTransitionalSaga"), CorrelationPropertyName("Property2")));
}

protected virtual string CorrelationPropertyName(string propertyName) => $"Correlation_{propertyName}";
Expand Down

0 comments on commit 2b622be

Please sign in to comment.