Skip to content

Commit 5505fe5

Browse files
Update db-access-in-ut.md
1 parent 438ab81 commit 5505fe5

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

docs/checks/db-access-in-ut.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,22 @@ This check scans test classes and its contents searching for any kind of explici
88

99
### How does the check work?
1010

11-
Statements like: SELECT, EXEC SQL, COMMIT, COMMIT WORK, ROLLBACK, INSERT, DELETE, ALTER; UPDATE or READ TABLE accessing physical database tables (SAP Dictionary Tables) are detected and presented.
11+
Statements like: SELECT, EXEC SQL, COMMIT, COMMIT WORK, ROLLBACK, INSERT, DELETE, ALTER; UPDATE or READ TABLE accessing physical database tables (SAP Dictionary Tables) are detected and presented. However, the Check acts differently according to the RISK LEVEL classification of the test class under evaluation. So that:
12+
13+
· RISK LEVEL HARMLESS or missing RISK LEVEL classification --> These DB Operation will be forbidden/reported: COMMIT, DELETE, INSERT, MODIFY, ROLLBACK, SELECT and UPDATE statements on persistent DDIC tables;
14+
15+
· RISK LEVEL DANGEROUS/CRITICAL --> UPDATE, MODIFY DELETE, COMMIT, ROLLBACK operation(s) on persistent DDIC tables will be forbidden/reported.
16+
17+
OBS: For more details on RISK LEVEL classification, please refer to the last section of this page.
1218

19+
Besides, test classes having AMDP (this happens only in productive mode) are already excluded from the scope of the check (in other words, exempted) since the Check is only applicable on test-code. Again, data access should be always mocked. For the mocking, one of these alternatives should be used:
20+
21+
· OSQL Test Framework; and/or
22+
23+
· CDS Test Framework; and/or
24+
25+
· Test-Double Framework (isolating the database access in classes an mocking them via TDF).
26+
1327
### How to solve the issue?
1428

1529
The solution is to mock these DB accesses with a proper dependency isolation technique.

0 commit comments

Comments
 (0)