Skip to content

Failing unit tests for Architecture required change #7454

@kamransaleem

Description

@kamransaleem

Description

Unit tests should NOT rely on identity insert

Tested against MS Sql Server with the following results:

org.jooq.exception.DataAccessException: SQL [insert into [architecture_required_change] (
  [id],
  [external_id],
  [title],
  [description],
  [status],
  [linked_entity_id],
  [linked_entity_kind],
  [external_parent_id],
  [created_at],
  [created_by],
  [updated_at],
  [updated_by],
  [provenance],
  [entity_lifecycle_status],
  [milestone_rag],
  [milestone_forecast_date]
)
values (
  ?, 
  ?, 
  ?, 
  ?, 
  ?, 
  ?, 
  ?, 
  ?, 
  ?, 
  ?, 
  ?, 
  ?, 
  ?, 
  ?, 
  ?, 
  ?
)]; Cannot insert explicit value for identity column in table 'architecture_required_change' when IDENTITY_INSERT is set to OFF.

	at org.jooq_3.18.29.SQLSERVER.debug(Unknown Source)
	at org.jooq.impl.Tools.translate(Tools.java:3555)
	at org.jooq.impl.Tools.translate(Tools.java:3543)
	at org.jooq.impl.DefaultExecuteContext.sqlException(DefaultExecuteContext.java:837)
	at org.jooq.impl.AbstractQuery.execute(AbstractQuery.java:360)
	at org.jooq.impl.AbstractDelegatingQuery.execute(AbstractDelegatingQuery.java:115)
	at org.finos.waltz.test_common.helpers.ArchitectureRequiredChangeHelper.createArchitectureRequiredChange(ArchitectureRequiredChangeHelper.java:40)
	at org.finos.waltz.integration_test.inmem.service.ArchitectureRequiredChangeServiceTest.createArc(ArchitectureRequiredChangeServiceTest.java:120)
	at org.finos.waltz.integration_test.inmem.service.ArchitectureRequiredChangeServiceTest.setup(ArchitectureRequiredChangeServiceTest.java:65)
	at java.base/java.lang.reflect.Method.invoke(Method.java:569)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: Cannot insert explicit value for identity column in table 'architecture_required_change' when IDENTITY_INSERT is set to OFF.
	at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:232)
	at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(SQLServerStatement.java:1672)
	at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.doExecutePreparedStatement(SQLServerPreparedStatement.java:460)
	at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement$PrepStmtExecCmd.doExecute(SQLServerPreparedStatement.java:405)
	at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:7535)
	at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:2438)
	at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(SQLServerStatement.java:208)
	at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(SQLServerStatement.java:183)
Image

Waltz Version

No response

Steps to Reproduce

...

Expected Result

No response

Actual Result

No response

Metadata

Metadata

Labels

QoLQuality of Lifegood first issueAn issue suitable for new project collaboratorsjavaPull requests that update Java code

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions