If an interface contains and extends clause and the clause is on a different line from the interface name, the generated mock class is poorly formed.
Below are a couple examples. Given the different placement of the extends clause, the generated class should be well formed and logically identical.
Given the following interface, having the extends clause on the same line as the interface name.
public interface ICronTriggersSelector extends ISObjectSelector
{
List<CronTrigger> selectById(Set<Id> idSet);
}
The proper mock class is generated.
/* Generated by apex-mocks-generator version 4.0.1 */
@isTest
public class MockClasses
{
public class CronTriggersSelectorMock extends ISObjectSelector implements ICronTriggersSelector
{
private fflib_ApexMocks mocks;
public CronTriggersSelectorMock(fflib_ApexMocks mocks)
{
super(mocks);
this.mocks = mocks;
}
public List<CronTrigger> selectById(Set<Id> idSet)
{
return (List<CronTrigger>) mocks.mockNonVoidMethod(this, 'selectById', new List<Type> {System.Type.forName('Set<Id>')}, new List<Object> {idSet});
}
}
}
But when the interface's extends clause is moved to the following line.
public interface ICronTriggersSelector
extends ISObjectSelector
{
List<CronTrigger> selectById(Set<Id> idSet);
}
Notice the improper code that appears after the mock class's constructor.
/* Generated by apex-mocks-generator version 4.0.1 */
@isTest
public class MockClasses
{
public class CronTriggersSelectorMock extends ISObjectSelector implements ICronTriggersSelector
{
private fflib_ApexMocks mocks;
public CronTriggersSelectorMock(fflib_ApexMocks mocks)
{
super(mocks);
this.mocks = mocks;
}
public extends ISObjectSelector{ List<CronTrigger> selectById(Set<Id> idSet)
{
return (extends ISObjectSelector{ List<CronTrigger>) mocks.mockNonVoidMethod(this, 'selectById', new List<Type> {System.Type.forName('Set<Id>')}, new List<Object> {idSet});
}
}
}
If an interface contains and extends clause and the clause is on a different line from the interface name, the generated mock class is poorly formed.
Below are a couple examples. Given the different placement of the extends clause, the generated class should be well formed and logically identical.
Given the following interface, having the extends clause on the same line as the interface name.
The proper mock class is generated.
But when the interface's extends clause is moved to the following line.
Notice the improper code that appears after the mock class's constructor.