update u;
} catch (System.DmlException e) {
System.assert(e.getDmlMessage(0).indexOf('unable to obtain exclusive access to this record') > -1); // Not sure what its suppose to do.
}
What does System.assert do in the above line?
When the records are updated a exception is thrown. I am not sure why.
2 answers
it will asserts the update process and check the error message
see here for example
https://www.salesforce.com/us/developer/docs/apexcode/Content/apex_testing_example.htm