Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0046572Openbravo ERPA. Platformpublic2021-05-07 10:132021-05-10 08:22
alostale 
alostale 
normalminorhave not tried
closedfixed 
5
 
PR21Q3 
Core
No
0046572: ws tests fail having modules in development
Having modules in development, some web service junit tests fail due to incorrect CSRF token management.
1. Set core in developemnt
2. start tomcat
3. run DataSourceSecurity
  ERROR:
10:10:47.003 INFO org.openbravo.test.base.OBBaseTest - *** Starting test case: org.openbravo.test.datasource.DataSourceSecurity.fetchShouldBeAllowedOnlyIfRoleIsGranted[ADMIN_ROLE - dataSource: ProductByPriceAndWarehouse]
10:10:47.213 ERROR org.openbravo.test.datasource.BaseDataSourceTestDal - Cannot retrieve CSRF Token
java.lang.Exception: Cannot find CSRF Token in SessionDynamic response
    at org.openbravo.test.datasource.BaseDataSourceTestDal.findCsrfTokenInResponse(BaseDataSourceTestDal.java:125) ~[classes/:?]
    at org.openbravo.test.datasource.BaseDataSourceTestDal.getTokenFromSessionDynamic(BaseDataSourceTestDal.java:111) [classes/:?]
No tags attached.
Issue History
2021-05-07 10:13alostaleNew Issue
2021-05-07 10:13alostaleAssigned To => platform
2021-05-07 10:13alostaleModules => Core
2021-05-07 10:13alostaleTriggers an Emergency Pack => No
2021-05-07 10:13alostaleAssigned Toplatform => alostale
2021-05-07 10:23hgbotNote Added: 0127883
2021-05-10 08:22hgbotResolutionopen => fixed
2021-05-10 08:22hgbotStatusnew => closed
2021-05-10 08:22hgbotNote Added: 0127924
2021-05-10 08:22hgbotFixed in Version => PR21Q3
2021-05-10 08:22hgbotNote Added: 0127925

Notes
(0127883)
hgbot   
2021-05-07 10:23   
Merge Request created: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/357 [^]
(0127924)
hgbot   
2021-05-10 08:22   
Merge request merged: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/357 [^]
(0127925)
hgbot   
2021-05-10 08:22   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/openbravo [^]
Changeset: 60751f1a3940d74af82316ed8efdf1c31c0bea37
Author: Asier Lostalé <asier.lostale@openbravo.com>
Date: 2021-05-10T07:07:16+02:00
URL: https://gitlab.com/openbravo/product/openbravo/-/commit/60751f1a3940d74af82316ed8efdf1c31c0bea37 [^]

fixes BUG-46572: ws tests fail having modules in development

When not having modules in development the response of the request to
get the CSRF token is minified. Test making use of it looked for the
token assuming it was minified making it fail when it was not.

The regexp to look for the token has been extended to allow optional
blank spaces, also it has been simplified getting in a group directly
the token value instead of parsing it afterward.

---
M src-test/src/org/openbravo/test/datasource/BaseDataSourceTestDal.java
---