-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #41 from paypal/release/4.9.0
Release 4.9.0
- Loading branch information
Showing
121 changed files
with
3,749 additions
and
2,527 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
springBoot = 2.6.6 | ||
dependencyManagement = 1.0.11.RELEASE | ||
projectVersion = 4.8.0 | ||
projectVersion = 4.9.0 | ||
paypalHyperwalletDockerRepository = hyperwallet-mirakl-connector | ||
org.gradle.jvmargs = -XX:PermSize=1024M -XX:MaxPermSize=1024M |
9 changes: 2 additions & 7 deletions
9
...structure/src/main/java/com/paypal/infrastructure/InfrastructureConnectorApplication.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,10 @@ | ||
package com.paypal.infrastructure; | ||
|
||
import lombok.extern.slf4j.Slf4j; | ||
import org.springframework.boot.SpringApplication; | ||
import org.springframework.boot.autoconfigure.SpringBootApplication; | ||
import org.springframework.context.annotation.ComponentScan; | ||
|
||
@Slf4j | ||
@SpringBootApplication | ||
@ComponentScan | ||
public class InfrastructureConnectorApplication { | ||
|
||
public static void main(final String[] args) { | ||
SpringApplication.run(InfrastructureConnectorApplication.class, args); | ||
} | ||
|
||
} |
10 changes: 10 additions & 0 deletions
10
infrastructure/src/main/java/com/paypal/infrastructure/batchjob/BatchJob.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package com.paypal.infrastructure.batchjob; | ||
|
||
import org.quartz.Job; | ||
|
||
/** | ||
* Marker interface for Batch Jobs | ||
*/ | ||
public interface BatchJob extends Job { | ||
|
||
} |
8 changes: 6 additions & 2 deletions
8
infrastructure/src/main/java/com/paypal/infrastructure/batchjob/BatchJobFailedItemId.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,21 @@ | ||
package com.paypal.infrastructure.batchjob; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
|
||
import java.io.Serializable; | ||
|
||
/** | ||
* Data class for item id and type. | ||
*/ | ||
@Data | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
public class BatchJobFailedItemId implements Serializable { | ||
|
||
private final String id; | ||
private String id; | ||
|
||
private final String type; | ||
private String type; | ||
|
||
} |
28 changes: 28 additions & 0 deletions
28
...ucture/src/main/java/com/paypal/infrastructure/exceptions/HMCHyperwalletAPIException.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package com.paypal.infrastructure.exceptions; | ||
|
||
import com.hyperwallet.clientsdk.HyperwalletException; | ||
|
||
/** | ||
* Base exception for all Hyperwallet Connector exceptions. | ||
*/ | ||
public class HMCHyperwalletAPIException extends HMCException { | ||
|
||
protected static final String DEFAULT_MSG = "An error has occurred while invoking Hyperwallet API"; | ||
|
||
private final HyperwalletException hyperwalletException; | ||
|
||
public HMCHyperwalletAPIException(final String message, final HyperwalletException e) { | ||
super(message, e); | ||
hyperwalletException = e; | ||
} | ||
|
||
public HMCHyperwalletAPIException(HyperwalletException e) { | ||
super(DEFAULT_MSG, e); | ||
hyperwalletException = e; | ||
} | ||
|
||
public HyperwalletException getHyperwalletException() { | ||
return hyperwalletException; | ||
} | ||
|
||
} |
28 changes: 28 additions & 0 deletions
28
infrastructure/src/main/java/com/paypal/infrastructure/exceptions/HMCMiraklAPIException.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package com.paypal.infrastructure.exceptions; | ||
|
||
import com.mirakl.client.core.exception.MiraklException; | ||
|
||
/** | ||
* Base exception for all Mirakl Connector exceptions. | ||
*/ | ||
public class HMCMiraklAPIException extends HMCException { | ||
|
||
protected static final String DEFAULT_MSG = "An error has occurred while invoking Mirakl API"; | ||
|
||
private final MiraklException miraklException; | ||
|
||
public HMCMiraklAPIException(final String message, final MiraklException e) { | ||
super(message, e); | ||
miraklException = e; | ||
} | ||
|
||
public HMCMiraklAPIException(MiraklException e) { | ||
super(DEFAULT_MSG, e); | ||
miraklException = e; | ||
} | ||
|
||
public MiraklException getMiraklException() { | ||
return miraklException; | ||
} | ||
|
||
} |
17 changes: 17 additions & 0 deletions
17
...tructure/src/main/java/com/paypal/infrastructure/service/TokenSynchronizationService.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package com.paypal.infrastructure.service; | ||
|
||
/** | ||
* Service for ensure the tokens in hypewallet and mirakl ar in sync | ||
* | ||
* @param <T> | ||
*/ | ||
public interface TokenSynchronizationService<T> { | ||
|
||
/** | ||
* Synchronize the tokens in hypewallet and mirakl for a specific item | ||
* @param model that contains the item to synchronize | ||
* @return the updated model item with the token in case there was a synchronization | ||
*/ | ||
T synchronizeToken(T model); | ||
|
||
} |
55 changes: 55 additions & 0 deletions
55
...re/src/test/java/com/paypal/infrastructure/exceptions/HMCHyperwalletAPIExceptionTest.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
package com.paypal.infrastructure.exceptions; | ||
|
||
import com.hyperwallet.clientsdk.HyperwalletException; | ||
import org.junit.jupiter.api.Test; | ||
import org.junit.jupiter.api.extension.ExtendWith; | ||
import org.mockito.Mock; | ||
import org.mockito.junit.jupiter.MockitoExtension; | ||
|
||
import static com.paypal.infrastructure.exceptions.HMCHyperwalletAPIException.DEFAULT_MSG; | ||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
@ExtendWith(MockitoExtension.class) | ||
class HMCHyperwalletAPIExceptionTest { | ||
|
||
private static final String HMC_HYPERWALLET_EXCEPTION_MESSAGE = "HMC Mirakl exception message"; | ||
|
||
private static final String HYPERWALLET_EXCEPTION_FIELD = "hyperwalletException"; | ||
|
||
private static final String DETAIL_MESSAGE_FIELD = "detailMessage"; | ||
|
||
@Mock | ||
private HyperwalletException hyperwalletExceptionMock; | ||
|
||
@Test | ||
void hMCHyperwalletAPIException_ShouldPopulateMessageAndException() { | ||
|
||
final HMCHyperwalletAPIException hmcHyperwalletAPIException = new HMCHyperwalletAPIException( | ||
HMC_HYPERWALLET_EXCEPTION_MESSAGE, hyperwalletExceptionMock); | ||
|
||
assertThat(hmcHyperwalletAPIException) | ||
.hasFieldOrPropertyWithValue(HYPERWALLET_EXCEPTION_FIELD, hyperwalletExceptionMock) | ||
.hasFieldOrPropertyWithValue(DETAIL_MESSAGE_FIELD, HMC_HYPERWALLET_EXCEPTION_MESSAGE); | ||
} | ||
|
||
@Test | ||
void hMCHyperwalletAPIException_ShouldPopulateDefaultMessageAndException() { | ||
|
||
final HMCHyperwalletAPIException hmcHyperwalletAPIException = new HMCHyperwalletAPIException( | ||
hyperwalletExceptionMock); | ||
|
||
assertThat(hmcHyperwalletAPIException) | ||
.hasFieldOrPropertyWithValue(HYPERWALLET_EXCEPTION_FIELD, hyperwalletExceptionMock) | ||
.hasFieldOrPropertyWithValue(DETAIL_MESSAGE_FIELD, DEFAULT_MSG); | ||
} | ||
|
||
@Test | ||
void hMCHyperwalletAPIException_ShouldReturnException() { | ||
|
||
final HMCHyperwalletAPIException hmcHyperwalletAPIException = new HMCHyperwalletAPIException( | ||
hyperwalletExceptionMock); | ||
|
||
assertThat(hmcHyperwalletAPIException.getHyperwalletException()).isEqualTo(hyperwalletExceptionMock); | ||
} | ||
|
||
} |
51 changes: 51 additions & 0 deletions
51
...ructure/src/test/java/com/paypal/infrastructure/exceptions/HMCMiraklAPIExceptionTest.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
package com.paypal.infrastructure.exceptions; | ||
|
||
import com.mirakl.client.core.exception.MiraklException; | ||
import org.junit.jupiter.api.Test; | ||
import org.junit.jupiter.api.extension.ExtendWith; | ||
import org.mockito.Mock; | ||
import org.mockito.junit.jupiter.MockitoExtension; | ||
|
||
import static com.paypal.infrastructure.exceptions.HMCMiraklAPIException.DEFAULT_MSG; | ||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
@ExtendWith(MockitoExtension.class) | ||
class HMCMiraklAPIExceptionTest { | ||
|
||
private static final String HMC_MIRAKL_EXCEPTION_MESSAGE = "HMC Mirakl exception message"; | ||
|
||
private static final String MIRAKL_EXCEPTION_FIELD = "miraklException"; | ||
|
||
private static final String DETAIL_MESSAGE_FIELD = "detailMessage"; | ||
|
||
@Mock | ||
private MiraklException miraklExceptionMock; | ||
|
||
@Test | ||
void hMCMiraklAPIException_ShouldPopulateMessageAndException() { | ||
|
||
final HMCMiraklAPIException hmcMiraklAPIException = new HMCMiraklAPIException(HMC_MIRAKL_EXCEPTION_MESSAGE, | ||
miraklExceptionMock); | ||
|
||
assertThat(hmcMiraklAPIException).hasFieldOrPropertyWithValue(MIRAKL_EXCEPTION_FIELD, miraklExceptionMock) | ||
.hasFieldOrPropertyWithValue(DETAIL_MESSAGE_FIELD, HMC_MIRAKL_EXCEPTION_MESSAGE); | ||
} | ||
|
||
@Test | ||
void hMCMiraklAPIException_ShouldPopulateDefaultMessageAndException() { | ||
|
||
final HMCMiraklAPIException hmcMiraklAPIException = new HMCMiraklAPIException(miraklExceptionMock); | ||
|
||
assertThat(hmcMiraklAPIException).hasFieldOrPropertyWithValue(MIRAKL_EXCEPTION_FIELD, miraklExceptionMock) | ||
.hasFieldOrPropertyWithValue(DETAIL_MESSAGE_FIELD, DEFAULT_MSG); | ||
} | ||
|
||
@Test | ||
void hMCMiraklAPIException_ShouldReturnException() { | ||
|
||
final HMCMiraklAPIException hmcMiraklAPIException = new HMCMiraklAPIException(miraklExceptionMock); | ||
|
||
assertThat(hmcMiraklAPIException.getMiraklException()).isEqualTo(miraklExceptionMock); | ||
} | ||
|
||
} |
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
8 changes: 3 additions & 5 deletions
8
...s/src/main/java/com/paypal/invoices/batchjobs/creditnotes/CreditNotesExtractBatchJob.java
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
8 changes: 3 additions & 5 deletions
8
invoices/src/main/java/com/paypal/invoices/batchjobs/invoices/InvoicesExtractBatchJob.java
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
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
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
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
Oops, something went wrong.