๐
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
| class AccountTest { | |
| @Test | |
| void canPrintAccountStatement() { | |
| Account account = new AccountBuilder().anAccount() | |
| .withDepositOf(500, LocalDate.of(2015, 12, 24)) | |
| .withWithdrawalOf(100, LocalDate.of(2016, 8, 23)) | |
| .build(); | |
| String statement = account.printStatement(); |
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
| class AccountTest { | |
| @Test | |
| void canPrintAccountStatement() { | |
| Account account = AccountMother.accountWithTransactions(); | |
| String statement = account.printStatement(); | |
| assertThat(statement).isEqualTo(""" | |
| Date Amount Balance | |
| 24.12.2015 +500 500 |
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
| class AdvantageOrWinResult extends Result { | |
| AdvantageOrWinResult(int player1Score, int player2Score) { | |
| super(player1Score, player2Score); | |
| } | |
| @Override | |
| String score() { | |
| int minusResult = player1Score - player2Score; | |
| if (minusResult == 1) { | |
| return "Advantage player1"; |
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
| package tech.pathtoprogramming.lombokdemo.model; | |
| import java.util.List; | |
| import lombok.AllArgsConstructor; | |
| import lombok.Builder; | |
| import lombok.Data; | |
| import lombok.NoArgsConstructor; | |
| @Data |
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
| // Generated by delombok at Mon Jul 20 16:14:37 CDT 2020 | |
| package tech.pathtoprogramming.lombokdemo.model; | |
| public class PersonService { | |
| private final PersonRepository personRepository; | |
| public void savePerson(Person person) { | |
| personRepository.save(person); | |
| } |
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
| package tech.pathtoprogramming.lombokdemo.model; | |
| import lombok.RequiredArgsConstructor; | |
| @RequiredArgsConstructor | |
| public class PersonService { | |
| private final PersonRepository personRepository; | |
| public void savePerson(Person person) { |
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
| // Generated by delombok at Mon Jul 20 16:02:03 CDT 2020 | |
| package tech.pathtoprogramming.lombokdemo.model; | |
| public class PersonService { | |
| @java.lang.SuppressWarnings("all") | |
| private static final org.slf4j.Logger log = | |
| org.slf4j.LoggerFactory.getLogger(PersonService.class); | |
| public void processPeople() { | |
| log.info("processing people"); |
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
| package tech.pathtoprogramming.lombokdemo.model; | |
| import lombok.extern.slf4j.Slf4j; | |
| @Slf4j | |
| public class PersonService { | |
| public void processPeople() { | |
| log.info("processing people"); | |
| } |
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
| // Generated by delombok at Mon Jul 20 15:55:34 CDT 2020 | |
| package tech.pathtoprogramming.lombokdemo.model; | |
| public class Address { | |
| private String city; | |
| private String state; | |
| private String streetAddress; | |
| private String zipcode; | |
| @java.lang.SuppressWarnings("all") |
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
| package tech.pathtoprogramming.lombokdemo.model; | |
| import lombok.AllArgsConstructor; | |
| import lombok.With; | |
| @AllArgsConstructor | |
| @With | |
| public class Address { | |
| private String city; | |
| private String state; |
NewerOlder