-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ACL-175] Fix missing EqualsAndHashCode Lombok annotations (#304)
Co-authored-by: Andrea Di Lisio <andrea.dilisio91@gmail.com>
- Loading branch information
1 parent
c5e057a
commit 600f252
Showing
21 changed files
with
203 additions
and
3 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
2 changes: 2 additions & 0 deletions
2
src/main/java/com/truelayer/java/entities/accountidentifier/IbanAccountIdentifier.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
2 changes: 2 additions & 0 deletions
2
...com/truelayer/java/entities/accountidentifier/SortCodeAccountNumberAccountIdentifier.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
2 changes: 2 additions & 0 deletions
2
src/main/java/com/truelayer/java/mandates/entities/beneficiary/MerchantAccount.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
2 changes: 2 additions & 0 deletions
2
src/main/java/com/truelayer/java/payments/entities/beneficiary/MerchantAccount.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
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
6 changes: 6 additions & 0 deletions
6
...java/com/truelayer/java/payments/entities/schemeselection/InstantOnlySchemeSelection.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,14 +1,20 @@ | ||
package com.truelayer.java.payments.entities.schemeselection; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import lombok.Builder; | ||
import lombok.EqualsAndHashCode; | ||
import lombok.Getter; | ||
import lombok.ToString; | ||
import lombok.experimental.Accessors; | ||
|
||
@Getter | ||
@Builder | ||
@EqualsAndHashCode(callSuper = false) | ||
@ToString | ||
public class InstantOnlySchemeSelection extends SchemeSelection { | ||
private final Type type = Type.INSTANT_ONLY; | ||
|
||
@Accessors(fluent = true) | ||
@JsonProperty // Jackson's @JsonProperty is required for serialization to work as expected | ||
private boolean allowRemitterFee; | ||
} |
6 changes: 6 additions & 0 deletions
6
...com/truelayer/java/payments/entities/schemeselection/InstantPreferredSchemeSelection.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,14 +1,20 @@ | ||
package com.truelayer.java.payments.entities.schemeselection; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import lombok.Builder; | ||
import lombok.EqualsAndHashCode; | ||
import lombok.Getter; | ||
import lombok.ToString; | ||
import lombok.experimental.Accessors; | ||
|
||
@Getter | ||
@Builder | ||
@EqualsAndHashCode(callSuper = false) | ||
@ToString | ||
public class InstantPreferredSchemeSelection extends SchemeSelection { | ||
private final Type type = Type.INSTANT_PREFERRED; | ||
|
||
@Accessors(fluent = true) | ||
@JsonProperty // Jackson's @JsonProperty is required for serialization to work as expected | ||
private boolean allowRemitterFee; | ||
} |
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
46 changes: 46 additions & 0 deletions
46
src/test/java/com/truelayer/java/payments/entities/SchemeSelectionTests.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,46 @@ | ||
package com.truelayer.java.payments.entities; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
|
||
import com.truelayer.java.payments.entities.schemeselection.SchemeSelection; | ||
import java.util.stream.Stream; | ||
import org.junit.jupiter.api.DisplayName; | ||
import org.junit.jupiter.params.ParameterizedTest; | ||
import org.junit.jupiter.params.provider.Arguments; | ||
import org.junit.jupiter.params.provider.MethodSource; | ||
|
||
public class SchemeSelectionTests { | ||
|
||
@DisplayName("Scheme selection base class should yield the expected type and allow_remitter_fee") | ||
@ParameterizedTest(name = "object={0}, expected type={1}, expected allow_remitter_fee={2}") | ||
@MethodSource("provideSchemeSelectionTestParameters") | ||
public void baseClassShouldYieldExpectedDetails( | ||
SchemeSelection schemeSelection, SchemeSelection.Type expectedType, boolean expectAllowRemitterFee) { | ||
assertEquals(schemeSelection.getType(), expectedType); | ||
assertEquals(schemeSelection.allowRemitterFee(), expectAllowRemitterFee); | ||
} | ||
|
||
private static Stream<Arguments> provideSchemeSelectionTestParameters() { | ||
return Stream.of( | ||
Arguments.of( | ||
SchemeSelection.instantOnly().allowRemitterFee(true).build(), | ||
SchemeSelection.Type.INSTANT_ONLY, | ||
true), | ||
Arguments.of( | ||
SchemeSelection.instantOnly().allowRemitterFee(false).build(), | ||
SchemeSelection.Type.INSTANT_ONLY, | ||
false), | ||
Arguments.of( | ||
SchemeSelection.instantPreferred() | ||
.allowRemitterFee(true) | ||
.build(), | ||
SchemeSelection.Type.INSTANT_PREFERRED, | ||
true), | ||
Arguments.of( | ||
SchemeSelection.instantPreferred() | ||
.allowRemitterFee(false) | ||
.build(), | ||
SchemeSelection.Type.INSTANT_PREFERRED, | ||
false)); | ||
} | ||
} |
Oops, something went wrong.