Skip to content

Commit f2757fa

Browse files
committed
Code Refactoring
Signed-off-by: Piotr PG Gajek <[email protected]>
1 parent 6529d39 commit f2757fa

12 files changed

+24
-13
lines changed

force-app/main/default/classes/Consts.cls

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1+
@SuppressWarnings('PMD.PropertyNamingConventions')
12
public class Consts {
2-
33
public static final AccountConsts ACCOUNT {
44
get {
55
return AccountConsts.INSTANCE;
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
3-
<apiVersion>55.0</apiVersion>
3+
<apiVersion>64.0</apiVersion>
44
<status>Active</status>
55
</ApexClass>
Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,22 @@
11
@IsTest
2-
public class ConstsTest {
3-
2+
private class ConstsTest {
43
@IsTest
54
static void accountConsts() {
6-
Assert.areNotEqual(null, Consts.ACCOUNT);
5+
Assert.isNotNull(Consts.ACCOUNT, 'Account constants should not be null');
76
}
87

98
@IsTest
109
static void contactConsts() {
11-
Assert.areNotEqual(null, Consts.CONTACT);
10+
Assert.isNotNull(Consts.CONTACT, 'Contact constants should not be null');
1211
}
1312

1413
@IsTest
1514
static void opportunityConsts() {
16-
Assert.areNotEqual(null, Consts.OPPORTUNITY);
15+
Assert.isNotNull(Consts.OPPORTUNITY, 'Opportunity constants should not be null');
1716
}
1817

1918
@IsTest
2019
static void profileConsts() {
21-
Assert.areNotEqual(null, Consts.PROFILE);
20+
Assert.isNotNull(Consts.PROFILE, 'Profile constants should not be null');
2221
}
2322
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
3-
<apiVersion>55.0</apiVersion>
3+
<apiVersion>64.0</apiVersion>
44
<status>Active</status>
55
</ApexClass>

force-app/main/default/classes/concrete-consts/AccountConsts.cls

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
@SuppressWarnings('PMD.FieldNamingConventions, PMD.EmptyStatementBlock')
12
public class AccountConsts {
23
public static final AccountConsts INSTANCE = new AccountConsts();
34

@@ -21,4 +22,6 @@ public class AccountConsts {
2122
public final String HOT = 'Hot';
2223
public final String WARM = 'Warm';
2324
}
25+
26+
private AccountConsts() {}
2427
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
3-
<apiVersion>55.0</apiVersion>
3+
<apiVersion>64.0</apiVersion>
44
<status>Active</status>
55
</ApexClass>

force-app/main/default/classes/concrete-consts/ContactConsts.cls

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
@SuppressWarnings('PMD.FieldNamingConventions, PMD.EmptyStatementBlock')
12
public class ContactConsts {
23
public static final ContactConsts INSTANCE = new ContactConsts();
34

@@ -10,4 +11,6 @@ public class ContactConsts {
1011
public final String ACTIVATED = 'Activated';
1112
public final String DRAFT = 'Draft';
1213
}
14+
15+
private ContactConsts() {}
1316
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
3-
<apiVersion>55.0</apiVersion>
3+
<apiVersion>64.0</apiVersion>
44
<status>Active</status>
55
</ApexClass>

force-app/main/default/classes/concrete-consts/OpportunityConsts.cls

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
@SuppressWarnings('PMD.FieldNamingConventions, PMD.EmptyStatementBlock')
12
public class OpportunityConsts {
23
public static final OpportunityConsts INSTANCE = new OpportunityConsts();
34

@@ -12,4 +13,6 @@ public class OpportunityConsts {
1213
public final String EXISTING_CUSTOMER_UPGRADE = 'Existing Customer - Upgrade';
1314
public final String NEW_CUSTOMER = 'New Customer';
1415
}
16+
17+
private OpportunityConsts() {}
1518
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
3-
<apiVersion>55.0</apiVersion>
3+
<apiVersion>64.0</apiVersion>
44
<status>Active</status>
55
</ApexClass>

0 commit comments

Comments
 (0)