Skip to content

Increase test coverage of network functions #418

@TomasTurina

Description

@TomasTurina

Description

One of the most important components of the new agent is the communicator. It is responsible for communication between the agent and the server in all directions. To do this, it uses the HttpClient class which was designed as a wrapper for boost asio/beast and interacts directly with the MultitypeQueue to get/store messages.

As part of this problem, a greater coverage of unit tests is requested, with which it will be possible to validate how the code reacts to each possible error code and message it receives or sends. In addition, it is necessary to mock each external function in order to be able to react to different return values ​​and see how the agent behaves.

The testing should include, at least, the following classes:

  • HttpClient
  • Communicator
  • AgentRegistration
  • Utils (http_client_utils, message_queue_utils, command_handler_utils)

Tests should be as simple as possible and each one should test a particular scenario. In case we have already developed complex tests and/or tests that require changes or new mocks, these changes should also be made as part of this issue.

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions