OHDSI / WebAPI

OHDSI WebAPI contains all OHDSI services that can be called from OHDSI applications
Apache License 2.0
126 stars 156 forks source link

Fix SecurityIT.java Integration Tests #2377

Open pieterlukasse opened 1 month ago

pieterlukasse commented 1 month ago

Expected behavior

Actual behavior

[INFO] Results:
[INFO] 
Error:  Errors: 
Error:    SecurityIT.testServiceSecurity » AmbiguousTableName COHORT
[INFO] 
Error:  Tests run: 6, Failures: 0, Errors: 1, Skipped: 1
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------

The SecurityIT tests also reports a lot of errors like

2024-05-30T12:22:48.9955376Z 2024-05-30 12:22:48.970 INFO main org.ohdsi.webapi.test.SecurityIT - [] - failed service PUT:http://localhost:34829/WebAPI/reusable/0/version/0
2024-05-30T12:22:48.9957527Z 2024-05-30 12:22:48.971 INFO main org.ohdsi.webapi.test.SecurityIT - [] - testing service DELETE:http://localhost:34829/WebAPI/reusable/0/version/0
2024-05-30T12:22:48.9959824Z 2024-05-30 12:22:48.993 ERROR http-nio-auto-1-exec-4 org.ohdsi.webapi.util.GenericExceptionMapper - [] - javax.ws.rs.NotFoundException: There is no reusable version with id = 0.

or

2024-05-30T12:22:51.5852794Z 2024-05-30 12:22:51.580 INFO main org.ohdsi.webapi.test.SecurityIT - [] - tested service PUT:http://localhost:34829/WebAPI/conceptset/0 with code 500
2024-05-30T12:22:51.5853793Z 2024-05-30 12:22:51.580 INFO main org.ohdsi.webapi.test.SecurityIT - [] - failed service PUT:http://localhost:34829/WebAPI/conceptset/0
2024-05-30T12:22:51.5857909Z 2024-05-30 12:22:51.580 INFO main org.ohdsi.webapi.test.SecurityIT - [] - testing service PUT:http://localhost:34829/WebAPI/estimation/0
2024-05-30T12:22:51.5928720Z 2024-05-30 12:22:51.591 ERROR http-nio-auto-1-exec-7 org.ohdsi.webapi.util.GenericExceptionMapper - [] - java.lang.NullPointerException

Somehow the IT tests step finished with SUCCESS, so the errors are also not being detected correctly.

Steps to reproduce behavior