Skip to content
This repository was archived by the owner on Jul 22, 2024. It is now read-only.
This repository was archived by the owner on Jul 22, 2024. It is now read-only.

Infinite Loop when using a retriable error code in PartnerServiceRetryStrategy.java  #152

@Isra1997

Description

@Isra1997

Steps to reproduce

 @Test
  void createAndPersistMsShoppingCart_withErrorCodeConflict_shouldThrowException() {
    // Arrange
    var cart = testData.buildCart();
    expectPostMethod("/v1/customers/" + customerId + "/carts", null, HttpStatus.SERVICE_UNAVAILABLE);

    // Act/Assert
    Assertions.assertThrows(
        RemoteServiceException.class,
        () ->
            msPartnerOperationsService.createAndPersistMsShoppingCart(
                FLOW_ID, MS_CUSTOMER_ID, cart));
  }

Expected behavior

Retry three times and then fails with a PartnerException.

Actual behavior

Goes into an infinite loop because of line 66 in PartnerServiceRetryStrategy.java

Diagnostic logs

Please share test platform diagnostics logs.
None
The logs may contain test assembly paths, kindly review and mask those before sharing.
None

Environment

Please share additional details about your environment.
Windows 10
Version
1.15.3

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