Use @IsTest instead of testMethod when creating new unit test classes
Issue #930
resolved
When creating a new unit test class, the empty test method has the testMethod
modifier. testMethod
is deprecated and @IsTest
should be used instead.
FWIW, the ApexUnitTest template used by sfdx uses @IsTest
.
Comments (2)
-
repo owner -
repo owner - changed status to resolved
I'm going to resolve this since it's already that way, but if you find that it's still showing
testMethod
instead of@IsTest
in yours and it's not coming up as modified, please let me know. - Log in to comment
Kevin, that's how it has been for a while. Here's the template that's bundled with IC1 and IC2:
Can you look in Settings>Editor>File and Code Templates and see if Apex Unit Test Class is blue? If so, select it and click the Reset to Default toolbar button. Or, if you've customized it yourself and want to retain those customizations, you can make that change.