-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes sonar issues #40
Conversation
public boolean equals(Object o) { | ||
HarNameValuePair obj = (HarNameValuePair) o; | ||
@Override | ||
public boolean equals(Object other) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe it will be simpler to use https://commons.apache.org/proper/commons-lang/apidocs/org/apache/commons/lang3/builder/EqualsBuilder.html
messagesManager.activate(Collections.emptyMap()); | ||
messagesManager.remove("correlation-company-correlation-12345"); | ||
|
||
verify(mockedConnection, times(1)).invoke(objectName, "removeMatchingMessages", | ||
new Object[]{"JMSCorrelationID='correlation-company-correlation-12345'"}, | ||
new String[]{"java.lang.String"}); | ||
} | ||
|
||
@Test(expected = AETException.class) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it covered somewhere else?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it wasn't, but I restored and fixed it
MBeanServerConnection connection = MessagesHelper.setupConnection(jmxUrl); | ||
for (ObjectName queue : MessagesHelper.getAetQueuesObjects(connection)) { | ||
String queueName = queue.getKeyProperty(MessagesHelper.DESTINATION_NAME_PROPERTY); | ||
jmxc = getJmxConnection(jmxUrl); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
JMXConnector
implements Closeable
so it may be auto-closed via try-with-resources.
@@ -53,7 +53,7 @@ public void addParameters(Map<String, String> parameters) { | |||
} | |||
|
|||
public Map<String, String> getParameters() { | |||
return parameters != null ? ImmutableMap.copyOf(parameters) : Collections.<String, String>emptyMap(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please make sure, that this change does not cause NPE
when Operation
instance is created using reflections (e.g. by GSON). Case here is when e.g. processing suite first time and there are no patterns in DB yet. Please check this case.
public class SerializingOperationTest { | ||
|
||
@Test | ||
public void testSerialization() throws Exception { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please check our rules about test naming convention:
https://github.com/Cognifide/aet/blob/master/CONTRIBUTING.md#tests-naming-convention
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
|
||
Gson gson = new Gson(); | ||
String json = gson.toJson(operationInput); | ||
Operation operationOutput = gson.fromJson(json, Operation.class); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please create Operation
instance from te json file that is e.g. read from the resources, not created before from Operation
instance.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added from string
Please see AET Contributing Rules Creating Pull Requests section. |
Fixed some most important sonar issues: https://sonarqube.com/component_issues?id=com.cognifide.aet%3Aaet-root#resolved=false|types=BUG
I hereby agree to the terms of the AET Contributor License Agreement.