You need to sign in to do that
Don't have an account?
Santosh Reddy9989
Force.com Security Source Code Scanner treating getter method as test method in test class
Hi,
Force.com Security Source Code Scanner treating getter method as test method in test class and giving Quality Issues (Query: Test Methods With No Assert).
sample code :
@isTest
public class StripePlanTests {
public static String testData_getPlan {
get {
return '{'+
' "interval": "year",'+
' "name": "Cirrus Insight Annual Subscription",'+
' "created": 1354825845,'+
' "amount": 0,'+
' "currency": "usd",'+
' "id": "CI_ANNUALLY",'+
' "object": "plan",'+
' "livemode": false,'+
' "interval_count": 1,'+
' "trial_period_days": null,'+
' "statement_description": null'+
'}';
}
}
public static Map<String, String> payload {
get{
Map<String, String> payload1 = new Map<String, String>();
payload1.put('interval','year');
payload1.put('name','Cirrus Insight Annual Subscription');
payload1.put('amount','0');
payload1.put('currency','usd');
payload1.put('id','CI_ANNUALLY');
payload1.put('interval_count','1');
payload1.put('trial_period_days','null');
return payload1;
}
}
}
Force.com Security Source Code Scanner treating getter method as test method in test class and giving Quality Issues (Query: Test Methods With No Assert).
sample code :
@isTest
public class StripePlanTests {
public static String testData_getPlan {
get {
return '{'+
' "interval": "year",'+
' "name": "Cirrus Insight Annual Subscription",'+
' "created": 1354825845,'+
' "amount": 0,'+
' "currency": "usd",'+
' "id": "CI_ANNUALLY",'+
' "object": "plan",'+
' "livemode": false,'+
' "interval_count": 1,'+
' "trial_period_days": null,'+
' "statement_description": null'+
'}';
}
}
public static Map<String, String> payload {
get{
Map<String, String> payload1 = new Map<String, String>();
payload1.put('interval','year');
payload1.put('name','Cirrus Insight Annual Subscription');
payload1.put('amount','0');
payload1.put('currency','usd');
payload1.put('id','CI_ANNUALLY');
payload1.put('interval_count','1');
payload1.put('trial_period_days','null');
return payload1;
}
}
}
Let us know if this will help you
All Answers
Let us know if this will help you