apex-enterprise-patterns / fflib-apex-common

Common Apex Library supporting Apex Enterprise Patterns and much more!
BSD 3-Clause "New" or "Revised" License
903 stars 514 forks source link

Deploying to production is failing #425

Closed MattHCarrier closed 1 year ago

MattHCarrier commented 1 year ago

Describe the bug When deploying fflib_common to production a test is failing and I am receiving the following error:

method: fflib_SObjectUnitOfWorkTest.testDerivedUnitOfWork_CommitDMLFail -- System.AssertException: Assertion Failed: Exception message was stack Class.fflib_SObjectUnitOfWorkTest.testDerivedUnitOfWork_CommitDMLFail: line 339, column 1

seems like System.DMLException is throwing a stack trace instead of the expected "REQUIRED_FIELD_MISSING" error.

apex mocks installed no problem and I have installed both mocks and commons in multiple scratch/sandbox environments no problem.

MattHCarrier commented 1 year ago

Issue had to do with most of the test scenarios revolve around inserting opportunities. I had custom validation included on the opportunity which was throwing a different message than what was expected in the assertion.

ImJohnMDaniel commented 1 year ago

G'day @MattHCarrier. I am glad to hear that you were able to determine the root cause on this issue. Cheers!