This file contains hidden or 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 obtaining_commands_when_some_claims_were_already_opened_but_not_notified_to_broker() { | |
| // arrange.... | |
| List<ClaimCommand> claimCommands = allClaimCommandsRepository.getCommands(); | |
| assertThat(claimCommands).isEqualTo(List.of( | |
| aClaimOpenButNotNotified().withOpeningListener(claimsOpeningListener) | |
| .withReferenceInCompany(refInCompany) | |
| .withClaimId(aClaimId).withCompanyId(companyId).build(), |
This file contains hidden or 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
| // some imports... | |
| public class OpenClaimCommandBuilder { | |
| private Company company; | |
| private ClaimDataBuilder claimBuilder; | |
| private OpenClaimCommandBuilder() {} | |
| public static OpenClaimCommandBuilder anOpenCommand() { | |
| return new OpenClaimCommandBuilder(); |
This file contains hidden or 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
| public class OpeningResult | |
| { | |
| private readonly string? _failureDescription; | |
| private readonly string? _referenceInCompany; | |
| private readonly string _claimId; | |
| private OpeningResult(string? referenceInCompany, string claimId, string? failureDescription) | |
| { | |
| _failureDescription = failureDescription; | |
| _claimId = claimId; |
This file contains hidden or 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
| namespace Security; | |
| public class SimulatedSecurityManager | |
| { | |
| private readonly Encrypter _encrypter; | |
| private readonly Notifier _notifier; | |
| private readonly TextUserDataRequester _userDataRequester; | |
| public SimulatedSecurityManager(Notifier notifier, InputReader inputReader) | |
| { |
This file contains hidden or 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
| // imports elided... | |
| public abstract class ClaimBuilder<T extends ClaimBuilder<T>> { | |
| // some fields elided... | |
| protected ClaimBuilder() { | |
| // setting some defaults elided... | |
| } | |
| public T withClaimId(String number) { |
This file contains hidden or 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
| // imports elided... | |
| public class OpenButNotNotifiedClaimBuilder extends ClaimBuilder<OpenButNotNotifiedClaimBuilder> { | |
| private ClaimReferenceInCompany referenceInCompany; | |
| private ClaimsOpeningListener claimsOpeningListener; | |
| private OpenButNotNotifiedClaimBuilder() { | |
| super(); | |
| } |
This file contains hidden or 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
| // some imports elided... | |
| public class ReadyToOpenClaimBuilder extends ClaimBuilder<ReadyToOpenClaimBuilder> { | |
| private Company company; | |
| private ReadyToOpenClaimBuilder() { | |
| super(); | |
| } |
This file contains hidden or 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
| // imports elided... | |
| public class ClaimDataBuilder extends ClaimBuilder<ClaimDataBuilder> { | |
| private ClaimDataBuilder() { | |
| super(); | |
| } | |
| public static ClaimDataBuilder aClaimDto() { | |
| return new ClaimDataBuilder(); | |
| } |
This file contains hidden or 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
| // imports elided... | |
| public abstract class ClaimBuilder<T> { | |
| // some fields elided... | |
| protected ClaimBuilder() { | |
| // setting some defaults elided... | |
| } | |
| public T withClaimId(String number) { |
This file contains hidden or 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
| // imports elided... | |
| public class ClaimBuilder { | |
| // some fields elided... | |
| public static ClaimBuilder aClaimReadyToOpen() { | |
| ClaimBuilder builder = new ClaimBuilder(); | |
| builder.status = ClaimStatus.ReadyToOpen; | |
| return aClaim(builder); | |
| } |