Skip to content

Instantly share code, notes, and snippets.

@yusufcakal
Created August 17, 2020 04:12
Show Gist options
  • Save yusufcakal/a05d015d67fbe3074f59ce69f1db9f53 to your computer and use it in GitHub Desktop.
Save yusufcakal/a05d015d67fbe3074f59ce69f1db9f53 to your computer and use it in GitHub Desktop.
SellerCenterServiceTest
@Test
public void shouldGetWorstSellerCenterLabelWhenSellerLabelOne() {
int sellCount = 3;
Seller seller = SellerBuilder.aSellerBuilder()
.sellCount(sellCount)
.previousSellerLabel(SellerLabel.SELLER_5)
.build();
when(sellerLabelTwentyProcessor.getSellerLabel(sellCount)).thenReturn(SellerLabel.NEW_SELLER);
when(sellerLabelFiveProcessor.getSellerLabel(sellCount)).thenReturn(SellerLabel.NEW_SELLER);
when(sellerLabelOneProcessor.getSellerLabel(sellCount)).thenReturn(SellerLabel.SELLER_1);
SellerCenterLabel sellerCenterLabel = sellerCenterService.getSellerCenterLabel(seller);
verify(sellerLabelTwentyProcessor).getSellerLabel(sellCount);
verify(sellerLabelFiveProcessor).getSellerLabel(sellCount);
verify(sellerLabelOneProcessor).getSellerLabel(sellCount);
assertTrue(sellerCenterLabel.isSellerCenterLabelWorstSeller());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment