Skip to content

Unit tests are failing, when running user's language is not English #271

@derroman

Description

@derroman

Package Edition of Nebula Logger

Unlocked Package

Package Version of Nebula Logger

4.6.14

New Bug Summary

We are using NebulaLogger in several projects successfully. Unfortunately several unit tests are failing - all we the same root cause:

System.QueryException: List has no rows for assignment to SObject

The reason can be found here:

private static final Profile STANDARD_USER_PROFILE = [SELECT Id FROM Profile WHERE Name = 'Standard User' LIMIT 1];

This query - using a profile name as where clause - will fail, if the running user's language is not English. In our Orgs the user uses usually German as language, so the profile name will be "Standardbenutzer" instead of "Standard User". So this query fails.

Workaround:

  • Switch running user's language to English

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type: BugSomething isn't working

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions