aws / aws-sdk-java-v2

The official AWS SDK for Java - Version 2
Apache License 2.0
2.16k stars 840 forks source link

ApiName does not implement equals #5292

Closed brettkail-wk closed 3 months ago

brettkail-wk commented 3 months ago

Describe the bug

The ApiName class doesn't implement equals. This complicates unittests using Mockito that want to verify requests are as expected.

Expected Behavior

Equal request objects after overriding configuration with a custom name (similar to AmazonSQSExtendedClient).

Current Behavior

Unequal request objects.

Reproduction Steps

Supplier<ReceiveMessageRequest> reqFactory = () ->
    ReceiveMessageRequest.builder()
        .overrideConfiguration(
            AwsRequestOverrideConfiguration.builder()
                .addApiName(ApiName.builder().name("n").version("v").build())
                .build())
        .build();
System.err.println(reqFactory.get().equals(reqFactory.get()));

Possible Solution

Implement equals.

Additional Information/Context

No response

AWS Java SDK version used

2.26.1

JDK version used

N/A

Operating System and version

N/A

debora-ito commented 3 months ago

@brettkail-wk acknowledged. Will try to work on this next week, but in the meantime if you can provide a PR we'd appreciate it.

github-actions[bot] commented 3 months ago

This issue is now closed. Comments on closed issues are hard for our team to see. If you need more assistance, please open a new issue that references this one.