Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0049510Openbravo ERPA. Platformpublic2022-06-08 11:062022-07-02 13:33
jlopez 
jlopez 
normalminorhave not tried
closedfixed 
5
 
PR22Q4 
Core
No
0049510: HttpServletRequestMock.getSession(boolean arg0) returns null instead of the active session
In jUnit tests you have to use the HttpServletRequestMock class, for example to test Callouts that make use of the active session to transform the request parameters to numeric types with the CalloutInfo.getBigDecimalParameter(String param) method, it is returning null instead of the active session.
Run any jUnit test of a Callout that is retrieving parameters of type BigDecimal with the method CalloutInfo.getBigDecimalParameter(String param).

For example: https://gitlab.com/openbravo/devel/pmods/org.openbravo.commercialoperations/-/blob/fr/860/src-test/org/openbravo/commercialoperations/callouts/CheckProductPricesValuesTest.java [^]
Modify the HttpServletRequestMock.getSession(boolean arg0) method so that it returns the active session.
No tags attached.
Issue History
2022-06-08 11:06jlopezNew Issue
2022-06-08 11:06jlopezAssigned To => Triage Platform Base
2022-06-08 11:06jlopezModules => Core
2022-06-08 11:06jlopezTriggers an Emergency Pack => No
2022-06-08 11:16jlopezIssue Monitored: jlopez
2022-06-08 11:16jlopezIssue End Monitor: jlopez
2022-06-08 11:23hgbotNote Added: 0138151
2022-06-08 11:38aferrazSummaryUsing the HttpServletRequestMock class in jUnit tests => HttpServletRequestMock.getSession(boolean arg0) returns null instead of the active session
2022-07-02 11:53hgbotResolutionopen => fixed
2022-07-02 11:53hgbotStatusnew => closed
2022-07-02 11:53hgbotNote Added: 0138979
2022-07-02 11:53hgbotFixed in Version => PR22Q4
2022-07-02 11:53hgbotNote Added: 0138980
2022-07-02 13:33aferrazAssigned ToTriage Platform Base => jlopez

Notes
(0138151)
hgbot   
2022-06-08 11:23   
Merge Request created: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/616 [^]
(0138979)
hgbot   
2022-07-02 11:53   
Merge request merged: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/616 [^]
(0138980)
hgbot   
2022-07-02 11:53   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/openbravo [^]
Changeset: 55b773e0a14aa51cbcd140a0a41c5b68cff337b8
Author: Javier López <javier.lopez@precognis.com>
Date: 02-07-2022 09:53:19
URL: https://gitlab.com/openbravo/product/openbravo/-/commit/55b773e0a14aa51cbcd140a0a41c5b68cff337b8 [^]

Fixes ISSUE-49510: HttpServletRequestMock.getSession(boolean arg0) returns null instead of the active session

---
M src-test/src/org/openbravo/test/base/mock/HttpServletRequestMock.java
---