This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wsimport -keep -verbose -p com.yusuf.client -J-Djavax.xml.accessExternalSchema=all -J-Djavax.xml.accessExternalDTD=all 'https://example.wsdl' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.dolap.settlement.model.request.CreateSettlementRequest; | |
import com.dolap.settlement.model.response.GetSettlementResponse; | |
import com.fasterxml.jackson.core.type.TypeReference; | |
import com.fasterxml.jackson.databind.ObjectMapper; | |
import org.apache.commons.lang3.tuple.ImmutablePair; | |
import org.apache.logging.log4j.util.Strings; | |
import org.slf4j.MDC; | |
import org.springframework.core.ParameterizedTypeReference; | |
import org.springframework.http.HttpMethod; | |
import org.springframework.stereotype.Component; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0"?> | |
<!DOCTYPE module PUBLIC | |
"-//Checkstyle//DTD Checkstyle Configuration 1.3//EN" | |
"https://checkstyle.org/dtds/configuration_1_3.dtd"> | |
<!-- | |
Checkstyle configuration that checks the Google coding conventions from Google Java Style | |
that can be found at https://google.github.io/styleguide/javaguide.html | |
Checkstyle is very configurable. Be sure to read the documentation at |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Test(expected = AddressUpdateException.class) | |
public void shouldNotUpdateAddressAndDoNotSendNotificationWhenAddressIdIsWrong() { | |
AddressUpdateRequest addressUpdateRequest = AddressUpdateRequestBuilder.anAddressUpdateRequestBuilder() | |
.id(1L) | |
.build(); | |
when(addressRepository.findById(1L)).thenReturn(Optional.empty()); | |
try { | |
addressService.update(addressUpdateRequest); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Service | |
public class AddressService { | |
private final AddressRepository addressRepository; | |
private final SendNotificationService sendNotificationService; | |
public AddressService(AddressRepository addressRepository, SendNotificationService sendNotificationService) { | |
this.addressRepository = addressRepository; | |
this.sendNotificationService = sendNotificationService; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@RunWith(MockitoJUnitRunner.class) | |
public class SellerCenterServiceTest { | |
@Mock | |
private SellerLabelOneProcessor sellerLabelOneProcessor; | |
@Mock | |
private SellerLabelFiveProcessor sellerLabelFiveProcessor; | |
@Mock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Service | |
public class SellerLabelOneProcessor implements SellerLabelProcessor { | |
@Override | |
public SellerLabel getSellerLabel(int sellCount) { | |
return sellCount >= 1 && sellCount < 5 ? SellerLabel.SELLER_1 : SellerLabel.NEW_SELLER; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Service | |
public class SellerLabelFiveProcessor implements SellerLabelProcessor { | |
@Override | |
public SellerLabel getSellerLabel(int sellCount) { | |
return sellCount >= 5 && sellCount < 20 ? SellerLabel.SELLER_5 : SellerLabel.NEW_SELLER; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Service | |
public class SellerLabelTwentyProcessor implements SellerLabelProcessor { | |
@Override | |
public SellerLabel getSellerLabel(int sellCount) { | |
return sellCount >= 20 ? SellerLabel.SELLER_20 : SellerLabel.NEW_SELLER; | |
} | |
} |
NewerOlder