No matches found
Try choosing different filters or resetting your filter selections.
Apex Code
The Apex stub API is now
generally available. We’ve added a page to help you monitor Apex batch jobs, and we’ve fixed
some bugs with the instanceOf keyword and test setup
methods.
Available in: Enterprise, Performance, Unlimited, Developer, and Database.com Editions |
For more information on these enhancements, refer to the Apex Developer Guide.
-
Apex Stub API Is Now Generally Available
Apex provides a stub API for implementing a mocking framework. A mocking framework has many benefits. It can streamline and improve testing and help you create faster, more reliable tests. You can use it to test classes in isolation, which is important for unit testing. Building your mocking framework with the stub API can also be beneficial because stub objects are generated at runtime. Because these objects are generated dynamically, you don’t have to package and deploy test classes. You can use the stub API to build your own mocking framework, or you can use one built by someone else. -
Monitor the Status of Apex Batch Jobs
Get more information about the status of Apex batch jobs. For a particular batch class, you can get information about parent jobs, such as submitted and completion dates and the number of batches processed or failed. This change applies to both Lightning Experience and Salesforce Classic. -
Only One Test Setup Method per Class is Allowed
You can now have only one test setup method per Apex test class. A test setup method is a method annotated with @testSetup. In previous versions, multiple test setup methods were allowed due to a bug, which has now been fixed. If you run Apex test classes that have more than one test setup method, you get a compile-time exception. Update your code and rerun the tests. -
Goodbye to instanceOf Keyword Bugs
The Apex instanceOf keyword works more consistently with managed base packages. In previous versions, it didn’t give the correct value if the expression on the left side was an Apex class that extended the target type specified in the expression on the right side, and the Apex class was declared in a different package from the target type. -
Make Web Service Callouts from Chained Queueable Jobs
Apex now allows web service callouts from chained queueable jobs. Previously, a queueable job could make a web service callout, but additional chained jobs that made callouts would throw exceptions. -
Maps of Populated SObject Fields Return Correct Values
The SObject.getPopulatedFieldsAsMap() method returns a map of populated field names and their corresponding values. The map contains only the fields that have been populated in memory for the SObject instance. Previously, the method didn’t return fields that were added to an SObject after it had been retrieved via a SOQL query. This bug has been fixed, and the method returns the correct fields. -
Apex Has New Transaction Security Policy Testing Requirements
If you’re using the policy condition interface in the org where the policy was implemented, test classes for the policy are not required. If you move the policy to another org, you must have test classes for the Apex policy in the new org. Testing is required whether the policy is moved from a sandbox to production, with a change set, or some other way. Why? If you’re making a policy available outside of its development environment, it needs testing to make sure it works correctly. -
Apex: New and Changed Classes and Interfaces
These classes and interfaces are new or have changed. -
ConnectApi (Chatter in Apex)
Create custom experiences in Salesforce using Chatter in Apex. In this release, you can access Files Connect with the new ConnectApi.ContentHub class, create and manage custom feeds with streams, send direct messages, share feed posts, and more.