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 NotifyOpenedClaimCommandBuilder { | |
| // some fields | |
| public static NotifyOpenedClaimCommandBuilder aNotifyOpenedCommand() { | |
| return new NotifyOpenedClaimCommandBuilder(); | |
| } | |
| public NotifyOpenedClaimCommandBuilder of(ClaimDataBuilder claimBuilder) { |
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 { | |
| // some fields | |
| 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
| // some imports... | |
| public class ClaimBuilderX { | |
| // some fields... | |
| public static ClaimBuilderX aClaim() { | |
| return new ClaimBuilderX(); | |
| } | |
| private ClaimBuilderX() { |
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( | |
| aNotifyOpenedCommand().of( | |
| aClaimDto().withClaimId(aClaimId).withCompanyId(companyId) | |
| ).withReferenceInCompany(refInCompany).usingOpeningListener(claimsOpeningListener).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 NotifyOpenedClaimCommandBuilder { | |
| private ClaimsOpeningListener openingListener; | |
| private ClaimReferenceInCompany referenceInCompany; | |
| private ClaimDataBuilder claimBuilder; | |
| public static NotifyOpenedClaimCommandBuilder aNotifyOpenedCommand() { | |
| return new NotifyOpenedClaimCommandBuilder(); | |
| } |
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
| @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 OpenedClaimData _openedClaimData; | |
| private readonly string? _failureDescription; | |
| private readonly string? _referenceInCompany; | |
| private readonly string _claimId; | |
| private OpeningResult(string? refenceInCompany, string claimId, string? failureDescription) | |
| { | |
| _openedClaimData = new OpenedClaimData(refenceInCompany, 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) | |
| { |
NewerOlder