How to open a level in plugin using cpp

How do I open a new level using cpp in a pluging which extends UE5 editor. UGameplayStatics::OpenLevel does not work.

FEditorFileUtils::LoadMap(pathToLevel);
Is the right answer