pnopjp / jmeter-plugins

Apache JMeter plugins for Microsoft Azure
Apache License 2.0
17 stars 13 forks source link

unable to execute in jmeter cli context with Shared access signature selected #4

Closed dislev closed 3 years ago

dislev commented 3 years ago

Unable to execute in jmeter cli context with Shared access signature selected. Error generated from below:

https://github.com/pnopjp/jmeter-plugins/blob/64ed25ecce831a510dc79e9604089b18f3e6c0a5/plugins/protocol/aad/src/main/java/jp/co/pnop/jmeter/protocol/aad/config/AzAdCredential.java#L234-L250

due to the following:

https://github.com/pnopjp/jmeter-plugins/blob/64ed25ecce831a510dc79e9604089b18f3e6c0a5/plugins/protocol/eventhubs/src/main/java/jp/co/pnop/jmeter/protocol/azureeventhubs/sampler/AzEventHubsSampler.java#L201-L214

The if (getAuthType() == AUTHTYPE_SAS) line seems to be causing some unintended behavior where, == compares memory address of the two values (which since AUTHTYPE_SAS is static, it's not the same address). Versus, changing the if statement to getAuthType().equals(AUTHTYPE_SAS), will compare the value of the variables (https://www.geeksforgeeks.org/difference-equals-method-java/).

Actual: Unable to execute in jmeter cli context with Shared access signature selected with proper parameters

Expected: Able to execute in jmeter cli context with Shared access signature selected with proper parameters

dislev commented 3 years ago

PRのマージありがとうございました!このバグを解決したという形でクローズして良いでしょうか?

kuniteru commented 3 years ago

You are right. I'll be closing this issue since I've merged your pull request. Thank you very much for your great feedback.