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 abstract class OpeningResult | |
| { | |
| public static OpeningResult Success(ClaimId claimId, ReferenceInCompany referenceInCompany) | |
| { | |
| return new SuccessfulOpeningResult(claimId, referenceInCompany); | |
| } | |
| public static OpeningResult Failure(ClaimId claimId, string description) | |
| { | |
| return new FailingOpeningResult(claimId, description); |
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 ReferenceInCompany? _referenceInCompany; | |
| private readonly ClaimId _claimId; | |
| private OpeningResult(ReferenceInCompany? referenceInCompany, ClaimId 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
| // 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(); |
NewerOlder