Skip to content

Commit c26666b

Browse files
Merge pull request #159 from daveerickson/change-order-to-opportunity
Changed Order to Opportunity for compatibility with orgs without Orders Enabled
2 parents b028978 + 927a844 commit c26666b

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

sfdx-source/apex-mocks/test/classes/fflib_ApexMocksUtilsTest.cls

+9-9
Original file line numberDiff line numberDiff line change
@@ -229,23 +229,23 @@ public class fflib_ApexMocksUtilsTest
229229
StockKeepingUnit = 'P2'
230230
);
231231

232-
OrderItem oi1 = new OrderItem(
233-
Id = fflib_IDGenerator.generate(OrderItem.SObjectType),
232+
OpportunityLineItem oli1 = new OpportunityLineItem(
233+
Id = fflib_IDGenerator.generate(OpportunityLineItem.SObjectType),
234234
Product2Id = prod1.Id,
235235
Product2 = prod1,
236236
UnitPrice = 10,
237237
Quantity = 1
238238
);
239239

240-
OrderItem oi2 = new OrderItem(
241-
Id = fflib_IDGenerator.generate(OrderItem.SObjectType),
240+
OpportunityLineItem oli2 = new OpportunityLineItem(
241+
Id = fflib_IDGenerator.generate(OpportunityLineItem.SObjectType),
242242
Product2Id = prod2.Id,
243243
Product2 = prod2,
244244
UnitPrice = 10,
245245
Quantity = 1
246246
);
247247

248-
Order order = new Order();
248+
Opportunity opportunity = new Opportunity();
249249

250250
Exception exceptionThatWasCalled = null;
251251

@@ -254,10 +254,10 @@ public class fflib_ApexMocksUtilsTest
254254

255255
try {
256256
fflib_ApexMocksUtils.makeRelationship(
257-
List<Order>.class,
258-
new List<Order>{ order },
259-
OrderItem.OrderId,
260-
new List<List<OrderItem>>{ new List<OrderItem>{oi1, oi2} }
257+
List<Opportunity>.class,
258+
new List<Opportunity>{ opportunity },
259+
OpportunityLineItem.OpportunityId,
260+
new List<List<OpportunityLineItem>>{ new List<OpportunityLineItem>{oli1, oli2} }
261261
);
262262
} catch (JSONException e) {
263263
exceptionThatWasCalled = e;

0 commit comments

Comments
 (0)