Uploaded image for project: 'Hawkular'
  1. Hawkular
  2. HAWKULAR-604

The message field of ExecuteOperationResponse should not be "undefined"

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • 1.0.0.Alpha6
    • None
    • Bus
    • None

    Description

      As marked in ExecuteOperationCommandITest, https://github.com/hawkular/hawkular-agent/blob/master/hawkular-agent-itest-parent/hawkular-agent-itest/src/test/java/org/hawkular/cmdgw/ws/test/ExecuteOperationCommandITest.java#L93
      the ExecuteOperationCommand returns "undefined" in the ExecuteOperationResponse in case the operation was successful. "undefined" in the response makes no sense and needs to be replaced by some meaningful message.

      The simplest solution would be to change this line https://github.com/hawkular/hawkular-agent/blob/master/hawkular-wildfly-monitor/src/main/java/org/hawkular/agent/monitor/cmd/ExecuteOperationCommand.java#L143 to write something meaningful into the response.

      But the preferred solution is to refactor ExecuteOperationCommand to
      (1) extend AbstractResourcePathCommand and
      (2) use OperationBuilder in the same way as it is used in several other commands ( AddDatasourceCommand, AddJdbcDriverCommand, UpdateDatasourceCommand ... )

      As a result of the refactoring, the response message will be written by org.hawkular.agent.monitor.cmd.AbstractResourcePathCommand.success(BasicMessageWithExtraData<REQ>, RESP) https://github.com/hawkular/hawkular-agent/blob/master/hawkular-wildfly-monitor/src/main/java/org/hawkular/agent/monitor/cmd/AbstractResourcePathCommand.java#L194-L197

      To run the build of the agent project with integration tests, use mvn clean install -Pitests

      Attachments

        Activity

          People

            Unassigned Unassigned
            ppalaga Peter Palaga
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: