Git
- Weblogic git repo https://github.com/dveselka/weblogic
- PR https://github.com/dveselka/weblogic/pull/6
Implemented.
Coverage analysis (current repo state)
- The codebase had effectively no automated tests (
@Testwas not present). - Major untested areas included:
rs-apiREST/resource flow and model classes- Most Java EE modules (
dave-basic-webapp-ejb-project, etc.) also have no tests, and some are not buildable in this environment due missing Oracle artifacts.
What I changed
In sample-javaee/14.1.1/dave-basic-project/rs-api:
- Added test dependency:
junit:junit:4.13.2(test scope) in:/home/runner/work/weblogic/weblogic/sample-javaee/14.1.1/dave-basic-project/rs-api/pom.xml
- Added comprehensive unit tests:
/home/runner/work/weblogic/weblogic/sample-javaee/14.1.1/dave-basic-project/rs-api/src/test/java/com/dave/service/PersonTest.java/home/runner/work/weblogic/weblogic/sample-javaee/14.1.1/dave-basic-project/rs-api/src/test/java/com/dave/service/PersonSessionBeanTest.java/home/runner/work/weblogic/weblogic/sample-javaee/14.1.1/dave-basic-project/rs-api/src/test/java/com/dave/service/MyResourceTest.java/home/runner/work/weblogic/weblogic/sample-javaee/14.1.1/dave-basic-project/rs-api/src/test/java/com/dave/service/MyApplicationTest.java
- Fixed edge-case behavior found during testing:
MyResource#getPersonnow handles negative IDs safely (id >= 0check).
Validation
- Ran:
mvn --no-transfer-progress testinrs-api
- Result:
- BUILD SUCCESS
- 10 tests run, 0 failures, 0 errors
Review/security validation
- Code review: clean after fixes.
- CodeQL scan: timed out in the validation tool (no actionable alert returned before timeout).
No comments:
Post a Comment