micro-integrator icon indicating copy to clipboard operation
micro-integrator copied to clipboard

Unit Test doesn't worked in Externalized Configuration

Open a0529gox opened this issue 9 months ago • 6 comments

Description

No response

Steps to Reproduce

I use config variable as below. It works fine in usual. It occurs error during unit test as below:

command for running unit test server

\wso2mi-4.4.0\bin\micro-integrator.bat -DsynapseTest --env-file="\wso2mi-4.4.0\conf\file.properties"

{MI_HOME}\conf\file.properties

endpoint_pi_basicAuth=Basic d3NvMjp3c28y

{MI_PROJECT}\src\main\wso2mi\resources\conf\config.properties

endpoint_pi_basicAuth:string

Sequence:

<sequence name="PIHeaderSequence" trace="disable" xmlns="http://ws.apache.org/ns/synapse">
    <header name="Authorization" action="set" scope="transport"
        expression="${configs.endpoint_pi_basicAuth}" />
</sequence>

error message

[2025-03-14 17:01:40,596]  WARN {SynapseExpression} - Error evaluating expression: configs.endpoint_pi_basicAuth cause : Could not fetch the value of the key: endpoint_pi_basicAuth

Version

4.4.0

Environment Details (with versions)

No response

a0529gox avatar Mar 14 '25 09:03 a0529gox

Hi There... I'm interested in to solve this issue. can you please assign to me

Darshaka-Weerasinghe avatar Sep 24 '25 03:09 Darshaka-Weerasinghe

Hi Can I take this up? Thanks!

d3varaja avatar Sep 26 '25 20:09 d3varaja

Hi I'm ojith, can I work on this issue?

OjithUddeeptha avatar Sep 29 '25 14:09 OjithUddeeptha

Hi @a0529gox , This issue is interesting to resolve. Kindly assign it to me.

myleshmulecraft avatar Sep 30 '25 10:09 myleshmulecraft

I'd be happy to have a look

SachinthaHewawasam avatar Sep 30 '25 16:09 SachinthaHewawasam

Hi @a0529gox šŸ‘‹,

I’m interested in working on this issue for Hacktoberfest.
I can help troubleshoot why unit tests fail with externalized configuration and provide a fix to ensure the configuration variables are correctly loaded during tests.

Could you kindly assign this issue to me? šŸ™

adityagupta0251 avatar Oct 01 '25 05:10 adityagupta0251