Skip to content

adding a found WTF #13

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

evelyn-fyi
Copy link

When mocking an Id in Apex, such that:

    public static Id getMockId(SObjectType sObjType) {
        idsGenerated++;
        String keyPrefix = sObjType.getDescribe().getKeyPrefix();
        String idsGenStr = String.valueOf(idsGenerated);

        return Id.valueOf(keyPrefix + idsGenStr.leftPad(13-idsGenStr.length(), '0'));
    }

...the following Assert passes, although it should not:

Assert.areNotEqual(EmailMessages.getFormattedThreadingToken(mockId), EmailMessages.getFormattedThreadingToken(mockId), 'these should be the same, but they aren't');

One would expect this to remain constant. The documentation for getFormattedThreadingToken(recordId) states that the threading token should be the same for a given caseId so that all emails will be associated to that case, eg, "In this sample, we send an email with a threading token so that the email and any responses are associated with the related case."

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant