zerocode icon indicating copy to clipboard operation
zerocode copied to clipboard

Can't pass system env to properties file

Open tomunix2000 opened this issue 3 years ago • 3 comments

I have system env from mvn like this: mvn verify -Dskip.it=false -Ddb.username=xxxx -Ddb.password=xxxxx -DpropertyFile=local.properties

My properties app_host.properties is like this:

kafka.producer.properties=kafka_config/${propertyFile}
db.url=jdbc:db2://localhost:60004/QZCSH00
db.username=${db.username}
db.password=${db.password}
db.driver=com.ibm.db2.jcc.DB2Driver

My test case:

@TargetEnv("app_host.properties")
@EnvProperty("_${env}")
@RunWith(ZeroCodeUnitRunner.class)
public class LoadTest {

    @Test
    @Scenario("scenarios/promotion/produce_promotion_event.json")
    public void c_consumeMessage() throws Exception {
    }

}

I expect when I run the mvn command, zerocode will replace the properties value with env value kafka.producer.properties=kafka_config/local.properties

But it does not

tomunix2000 avatar May 26 '22 11:05 tomunix2000

Fixed. changed in ApplicationMainModule, will submit PR soon

tomunix2000 avatar May 30 '22 06:05 tomunix2000

@tomunix2000, Can you please submit a PR for this ApplicationMainModule when you're ready?

authorjapps avatar Jun 14 '22 20:06 authorjapps

@authorjapps I want to work on this issue, but I am new to open source. Would you recommend taking up this issue?

sejal-bansal avatar Nov 22 '23 19:11 sejal-bansal