Skip to content

Service Bus Client Mock Bean creation #432

@nitinagrawal89

Description

@nitinagrawal89

We are writing integration test as part of the application. This integration test is not supposed to send any data over wire. So, there is need to mock the ServiceBusSenderAsyncClient. Application is using Micronaut framework. Micronaut provides MockBean annotation to create the MockBean. Below is the error when using MockBean :

Cannot apply AOP advice to final class. Class must be made non-final to support proxying: com.azure.messaging.servicebus.ServiceBusSenderAsyncClient

Actual Behaviour

  1. Error received : Cannot apply AOP advice to final class. Class must be made non-final to support proxying: com.azure.messaging.servicebus.ServiceBusSenderAsyncClient

Expected Behaviour

  1. The ServiceBusSenderAsyncClient should be successfully mocked and integration test should pass.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions