diff --git a/BudgetMasterServer/src/main/java/de/deadlocker8/budgetmaster/accounts/Account.java b/BudgetMasterServer/src/main/java/de/deadlocker8/budgetmaster/accounts/Account.java index 933d446ab8d888ad0d8020bd9f7eeca93e9b0d14..5121aeae136898d0a113ec7671588c03f521baee 100644 --- a/BudgetMasterServer/src/main/java/de/deadlocker8/budgetmaster/accounts/Account.java +++ b/BudgetMasterServer/src/main/java/de/deadlocker8/budgetmaster/accounts/Account.java @@ -5,10 +5,10 @@ import de.deadlocker8.budgetmaster.icon.Icon; import de.deadlocker8.budgetmaster.icon.Iconizable; import de.deadlocker8.budgetmaster.transactions.Transaction; import de.deadlocker8.budgetmaster.utils.ProvidesID; - import jakarta.persistence.*; import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.Size; + import java.util.List; import java.util.Objects; @@ -45,9 +45,13 @@ public class Account implements ProvidesID, Iconizable @Expose private AccountType type; - public Account(String name, AccountType type, Icon iconReference) + @Expose + private String description; + + public Account(String name, String description, AccountType type, Icon iconReference) { this.name = name; + this.description = description; this.type = type; this.isSelected = false; this.isDefault = false; @@ -55,9 +59,9 @@ public class Account implements ProvidesID, Iconizable this.iconReference = iconReference; } - public Account(String name, AccountType type) + public Account(String name, String description, AccountType type) { - this(name, type, null); + this(name, description, type, null); } public Account() @@ -145,6 +149,16 @@ public class Account implements ProvidesID, Iconizable this.type = type; } + public String getDescription() + { + return description; + } + + public void setDescription(String description) + { + this.description = description; + } + @Override public Icon getIconReference() { @@ -198,6 +212,7 @@ public class Account implements ProvidesID, Iconizable ", accountState=" + accountState + ", type=" + type + ", iconReference=" + iconReference + + ", description='" + description + '\'' + '}'; } @@ -213,12 +228,13 @@ public class Account implements ProvidesID, Iconizable Objects.equals(isDefault, account.isDefault) && accountState == account.accountState && Objects.equals(iconReference, account.iconReference) && - type == account.type; + type == account.type && + Objects.equals(description, account.description); } @Override public int hashCode() { - return Objects.hash(ID, name, isSelected, isDefault, accountState, iconReference, type); + return Objects.hash(ID, name, description, isSelected, isDefault, accountState, iconReference, type); } } \ No newline at end of file diff --git a/BudgetMasterServer/src/main/java/de/deadlocker8/budgetmaster/accounts/AccountService.java b/BudgetMasterServer/src/main/java/de/deadlocker8/budgetmaster/accounts/AccountService.java index 7bc9edd4f3834a2e79c8e6e8b626b409e1d06726..d6cafbb22d029ca9885619f6a095cce6c1d71498 100644 --- a/BudgetMasterServer/src/main/java/de/deadlocker8/budgetmaster/accounts/AccountService.java +++ b/BudgetMasterServer/src/main/java/de/deadlocker8/budgetmaster/accounts/AccountService.java @@ -133,14 +133,14 @@ public class AccountService implements Resettable, AccessAllEntities<Account>, A { if(accountRepository.findAll().isEmpty()) { - Account placeholder = new Account("Placeholder", AccountType.ALL); + Account placeholder = new Account("Placeholder", "", AccountType.ALL); final Icon newIcon = iconService.createIconReference(null, PLACEHOLDER_ICON, null); iconService.getRepository().save(newIcon); placeholder.setIconReference(newIcon); accountRepository.save(placeholder); LOGGER.debug("Created placeholder account"); - Account account = accountRepository.save(new Account(Localization.getString(Strings.ACCOUNT_DEFAULT_NAME), AccountType.CUSTOM)); + Account account = accountRepository.save(new Account(Localization.getString(Strings.ACCOUNT_DEFAULT_NAME), "", AccountType.CUSTOM)); final Icon iconDefaultAccount = iconService.createIconReference(null, null, null); iconService.getRepository().save(iconDefaultAccount); account.setIconReference(iconDefaultAccount); @@ -273,6 +273,7 @@ public class AccountService implements Resettable, AccessAllEntities<Account>, A Account existingAccount = existingAccountOptional.get(); existingAccount.setName(newAccount.getName()); + existingAccount.setDescription(newAccount.getDescription()); existingAccount.setIconReference(newAccount.getIconReference()); existingAccount.setType(AccountType.CUSTOM); existingAccount.setAccountState(newAccount.getAccountState()); diff --git a/BudgetMasterServer/src/main/java/de/deadlocker8/budgetmaster/settings/demo/DemoDataCreator.java b/BudgetMasterServer/src/main/java/de/deadlocker8/budgetmaster/settings/demo/DemoDataCreator.java index 4269c39b0869357424e42482055b24076dd1d474..d4f6ddfb7f4931d680bb0952c00deba0c6fdbfd2 100644 --- a/BudgetMasterServer/src/main/java/de/deadlocker8/budgetmaster/settings/demo/DemoDataCreator.java +++ b/BudgetMasterServer/src/main/java/de/deadlocker8/budgetmaster/settings/demo/DemoDataCreator.java @@ -71,19 +71,19 @@ public class DemoDataCreator { final Icon icon = iconService.createIconReference(null, null, null); iconService.getRepository().save(icon); - final Account oldAccount = new Account("Old account", AccountType.CUSTOM, icon); + final Account oldAccount = new Account("Old account", "", AccountType.CUSTOM, icon); oldAccount.setAccountState(AccountState.HIDDEN); accountService.getRepository().save(oldAccount); final Icon icon2 = iconService.createIconReference(null, null, null); iconService.getRepository().save(icon2); - final Account readOnlyAccount = new Account("Read-only account", AccountType.CUSTOM, icon2); + final Account readOnlyAccount = new Account("Read-only account", "", AccountType.CUSTOM, icon2); readOnlyAccount.setAccountState(AccountState.READ_ONLY); accountService.getRepository().save(readOnlyAccount); final Icon icon3 = iconService.createIconReference(null, "fas fa-piggy-bank", null); iconService.getRepository().save(icon3); - final Account savingsBankAccount = new Account("Savings Bank", AccountType.CUSTOM, icon3); + final Account savingsBankAccount = new Account("Savings Bank", "", AccountType.CUSTOM, icon3); accountService.getRepository().save(savingsBankAccount); } diff --git a/BudgetMasterServer/src/test/java/de/deadlocker8/budgetmaster/integration/EnsureAllIconizableHaveAnIconInstanceTest.java b/BudgetMasterServer/src/test/java/de/deadlocker8/budgetmaster/integration/EnsureAllIconizableHaveAnIconInstanceTest.java index 31526730100007b607e25991c6a1bfd7954fa71e..a8fa80d39487132f7ef98d49b006233d8d861d57 100644 --- a/BudgetMasterServer/src/test/java/de/deadlocker8/budgetmaster/integration/EnsureAllIconizableHaveAnIconInstanceTest.java +++ b/BudgetMasterServer/src/test/java/de/deadlocker8/budgetmaster/integration/EnsureAllIconizableHaveAnIconInstanceTest.java @@ -68,7 +68,7 @@ class EnsureAllIconizableHaveAnIconInstanceTest @BeforeEach void beforeEach() { - final Account accountWithoutIconReference = new Account("My Account", AccountType.CUSTOM); + final Account accountWithoutIconReference = new Account("My Account", "", AccountType.CUSTOM); accountRepository.save(accountWithoutIconReference); final Category categoryWithoutIconReference = new Category("Car", "#ffcc00", CategoryType.CUSTOM); diff --git a/BudgetMasterServer/src/test/java/de/deadlocker8/budgetmaster/integration/selenium/ChartTest.java b/BudgetMasterServer/src/test/java/de/deadlocker8/budgetmaster/integration/selenium/ChartTest.java index 60b00c4c35f5ca1b129370d612f2ddd4bda8c053..b333dda234244276d5a6f0e943220c999cc8043d 100644 --- a/BudgetMasterServer/src/test/java/de/deadlocker8/budgetmaster/integration/selenium/ChartTest.java +++ b/BudgetMasterServer/src/test/java/de/deadlocker8/budgetmaster/integration/selenium/ChartTest.java @@ -381,7 +381,7 @@ class ChartTest extends SeleniumTestBase Actions actions = new Actions(driver); actions.moveToElement(driver.findElement(By.className("plot-container"))).perform(); - actions.moveByOffset(-250, 25) + actions.moveByOffset(-450, 25) .keyDown(Keys.SHIFT) .click() .keyUp(Keys.SHIFT) diff --git a/BudgetMasterServer/src/test/java/de/deadlocker8/budgetmaster/unit/AccountServiceTest.java b/BudgetMasterServer/src/test/java/de/deadlocker8/budgetmaster/unit/AccountServiceTest.java index 09f67e20a3f8b3ba8220984507ac3d2836b7309c..831d6d993d07871aeabeb3bea7c4c15f13386037 100644 --- a/BudgetMasterServer/src/test/java/de/deadlocker8/budgetmaster/unit/AccountServiceTest.java +++ b/BudgetMasterServer/src/test/java/de/deadlocker8/budgetmaster/unit/AccountServiceTest.java @@ -58,18 +58,18 @@ class AccountServiceTest @BeforeEach void beforeEach() { - ACCOUNT_DEFAULT = new Account(Localization.getString(Strings.ACCOUNT_DEFAULT_NAME), AccountType.CUSTOM); + ACCOUNT_DEFAULT = new Account(Localization.getString(Strings.ACCOUNT_DEFAULT_NAME), "", AccountType.CUSTOM); - ACCOUNT_PLACEHOLDER = new Account("Placeholder", AccountType.ALL); + ACCOUNT_PLACEHOLDER = new Account("Placeholder", "", AccountType.ALL); ACCOUNT_PLACEHOLDER.setID(1); - ACCOUNT_NORMAL = new Account("Normal account", AccountType.CUSTOM); + ACCOUNT_NORMAL = new Account("Normal account", "awesome description", AccountType.CUSTOM); ACCOUNT_NORMAL.setID(3); - ACCOUNT_READONLY = new Account("Readonly account", AccountType.CUSTOM); + ACCOUNT_READONLY = new Account("Readonly account", "", AccountType.CUSTOM); ACCOUNT_READONLY.setAccountState(AccountState.READ_ONLY); - ACCOUNT_HIDDEN = new Account("Hidden account", AccountType.CUSTOM); + ACCOUNT_HIDDEN = new Account("Hidden account", "", AccountType.CUSTOM); ACCOUNT_HIDDEN.setAccountState(AccountState.HIDDEN); ACCOUNT_DEFAULT.setID(15); @@ -77,7 +77,7 @@ class AccountServiceTest ICON_PLACEHOLDER = new Icon("fas fa-landmark", null); - Mockito.when(accountRepository.save(new Account(Localization.getString(Strings.ACCOUNT_DEFAULT_NAME), AccountType.CUSTOM))).thenReturn(ACCOUNT_DEFAULT); + Mockito.when(accountRepository.save(new Account(Localization.getString(Strings.ACCOUNT_DEFAULT_NAME), "", AccountType.CUSTOM))).thenReturn(ACCOUNT_DEFAULT); Mockito.when(accountRepository.findByIsDefault(true)).thenReturn(ACCOUNT_DEFAULT); Mockito.when(accountRepository.findAllByType(AccountType.ALL)).thenReturn(List.of(ACCOUNT_PLACEHOLDER)); Mockito.when(accountRepository.findById(1)).thenReturn(Optional.of(ACCOUNT_PLACEHOLDER)); @@ -97,9 +97,9 @@ class AccountServiceTest accounts.add(ACCOUNT_READONLY); accounts.add(ACCOUNT_HIDDEN); - final Account accountNormal2 = new Account("normal account", AccountType.CUSTOM); + final Account accountNormal2 = new Account("normal account", "", AccountType.CUSTOM); accounts.add(accountNormal2); - final Account accountNormal3 = new Account("123 account", AccountType.CUSTOM); + final Account accountNormal3 = new Account("123 account", "", AccountType.CUSTOM); accounts.add(accountNormal3); Mockito.when(accountRepository.findAllByType(AccountType.ALL)).thenReturn(List.of(ACCOUNT_PLACEHOLDER)); @@ -115,9 +115,9 @@ class AccountServiceTest final List<Account> accounts = new ArrayList<>(); accounts.add(ACCOUNT_NORMAL); - final Account accountNormal2 = new Account("normal account", AccountType.CUSTOM); + final Account accountNormal2 = new Account("normal account", "", AccountType.CUSTOM); accounts.add(accountNormal2); - final Account accountNormal3 = new Account("123 account", AccountType.CUSTOM); + final Account accountNormal3 = new Account("123 account", "", AccountType.CUSTOM); accounts.add(accountNormal3); Mockito.when(accountRepository.findAllByType(AccountType.ALL)).thenReturn(List.of(ACCOUNT_PLACEHOLDER)); @@ -133,9 +133,9 @@ class AccountServiceTest final List<Account> accounts = new ArrayList<>(); accounts.add(ACCOUNT_NORMAL); - final Account accountNormal2 = new Account("normal account", AccountType.CUSTOM); + final Account accountNormal2 = new Account("normal account", "", AccountType.CUSTOM); accounts.add(accountNormal2); - final Account accountNormal3 = new Account("123 account", AccountType.CUSTOM); + final Account accountNormal3 = new Account("123 account", "", AccountType.CUSTOM); accounts.add(accountNormal3); Mockito.when(accountRepository.findAllByType(AccountType.ALL)).thenReturn(List.of(ACCOUNT_PLACEHOLDER)); @@ -159,13 +159,13 @@ class AccountServiceTest Mockito.verify(templateService, Mockito.atLeast(1)).unsetTemplatesWithAccount(Mockito.any()); // placeholder account is set as selected account - final Account accountSelected = new Account("Placeholder", AccountType.ALL); + final Account accountSelected = new Account("Placeholder", "", AccountType.ALL); accountSelected.setSelected(true); accountSelected.setID(1); Mockito.verify(accountRepository, Mockito.atLeast(1)).save(accountSelected); // default account is set another account - final Account newDefault = new Account("Normal account", AccountType.CUSTOM); + final Account newDefault = new Account("Normal account", "awesome description", AccountType.CUSTOM); newDefault.setDefault(true); newDefault.setID(3); Mockito.verify(accountRepository, Mockito.atLeast(1)).save(newDefault); @@ -177,8 +177,8 @@ class AccountServiceTest accountService.createDefaults(); // createDefaults() may also be called in constructor so 2 calls are possible - Mockito.verify(accountRepository, Mockito.atLeast(1)).save(new Account("Placeholder", AccountType.ALL)); - Mockito.verify(accountRepository, Mockito.atLeast(1)).save(new Account(Localization.getString(Strings.ACCOUNT_DEFAULT_NAME), AccountType.CUSTOM)); + Mockito.verify(accountRepository, Mockito.atLeast(1)).save(new Account("Placeholder", "", AccountType.ALL)); + Mockito.verify(accountRepository, Mockito.atLeast(1)).save(new Account(Localization.getString(Strings.ACCOUNT_DEFAULT_NAME), "", AccountType.CUSTOM)); } @Test @@ -186,7 +186,7 @@ class AccountServiceTest { accountService.selectAccount(3); - final Account accountSelected = new Account(ACCOUNT_NORMAL.getName(), AccountType.CUSTOM); + final Account accountSelected = new Account(ACCOUNT_NORMAL.getName(), "awesome description", AccountType.CUSTOM); accountSelected.setSelected(true); accountSelected.setID(ACCOUNT_NORMAL.getID()); Mockito.verify(accountRepository, Mockito.atLeast(1)).save(accountSelected); @@ -200,13 +200,13 @@ class AccountServiceTest accountService.setAsDefaultAccount(3); // old default unset - final Account oldDefault = new Account(ACCOUNT_DEFAULT.getName(), AccountType.CUSTOM); + final Account oldDefault = new Account(ACCOUNT_DEFAULT.getName(), "", AccountType.CUSTOM); oldDefault.setDefault(false); oldDefault.setID(ACCOUNT_DEFAULT.getID()); Mockito.verify(accountRepository, Mockito.atLeast(1)).save(oldDefault); // new default set - final Account newDefault = new Account(ACCOUNT_NORMAL.getName(), AccountType.CUSTOM); + final Account newDefault = new Account(ACCOUNT_NORMAL.getName(), "awesome description", AccountType.CUSTOM); newDefault.setDefault(true); newDefault.setID(ACCOUNT_NORMAL.getID()); Mockito.verify(accountRepository, Mockito.atLeast(1)).save(newDefault); @@ -215,11 +215,11 @@ class AccountServiceTest @Test void test_updateExistingAccount() { - final Account account = new Account("my account", AccountType.CUSTOM); + final Account account = new Account("my account", "awesome new description", AccountType.CUSTOM); account.setAccountState(AccountState.FULL_ACCESS); account.setID(22); - final Account existingAccount = new Account("existing account", AccountType.CUSTOM); + final Account existingAccount = new Account("existing account", "awesome description", AccountType.CUSTOM); existingAccount.setAccountState(AccountState.READ_ONLY); existingAccount.setIconReference(new Icon()); existingAccount.setID(22); @@ -228,7 +228,7 @@ class AccountServiceTest accountService.updateExistingAccount(account); - final Account expected = new Account("my account", AccountType.CUSTOM); + final Account expected = new Account("my account", "awesome new description", AccountType.CUSTOM); expected.setAccountState(AccountState.FULL_ACCESS); expected.setID(22); @@ -238,12 +238,12 @@ class AccountServiceTest @Test void test_updateExistingAccount_isDefaultAccount_noFullAccessAnymore() { - final Account account = new Account("my account", AccountType.CUSTOM); + final Account account = new Account("my account", "", AccountType.CUSTOM); account.setAccountState(AccountState.READ_ONLY); account.setDefault(true); account.setID(22); - final Account existingAccount = new Account("existing account", AccountType.CUSTOM); + final Account existingAccount = new Account("existing account", "", AccountType.CUSTOM); existingAccount.setAccountState(AccountState.FULL_ACCESS); existingAccount.setIconReference(new Icon()); existingAccount.setDefault(true); @@ -255,14 +255,14 @@ class AccountServiceTest accountService.updateExistingAccount(account); // account updated - final Account expected = new Account("my account", AccountType.CUSTOM); + final Account expected = new Account("my account", "", AccountType.CUSTOM); expected.setAccountState(AccountState.READ_ONLY); expected.setDefault(true); expected.setID(22); Mockito.verify(accountRepository, Mockito.atLeast(1)).save(expected); // new default set - final Account newDefault = new Account(ACCOUNT_NORMAL.getName(), AccountType.CUSTOM); + final Account newDefault = new Account(ACCOUNT_NORMAL.getName(), "awesome description", AccountType.CUSTOM); newDefault.setDefault(true); newDefault.setID(ACCOUNT_NORMAL.getID()); Mockito.verify(accountRepository, Mockito.atLeast(1)).save(newDefault); @@ -271,12 +271,12 @@ class AccountServiceTest @Test void test_updateExistingAccount_isSelected_nowHidden() { - final Account account = new Account("my account", AccountType.CUSTOM); + final Account account = new Account("my account", "", AccountType.CUSTOM); account.setAccountState(AccountState.HIDDEN); account.setSelected(true); account.setID(22); - final Account existingAccount = new Account("existing account", AccountType.CUSTOM); + final Account existingAccount = new Account("existing account", "", AccountType.CUSTOM); existingAccount.setAccountState(AccountState.FULL_ACCESS); existingAccount.setIconReference(new Icon()); existingAccount.setSelected(true); @@ -287,14 +287,14 @@ class AccountServiceTest accountService.updateExistingAccount(account); // account updated - final Account expected = new Account("my account", AccountType.CUSTOM); + final Account expected = new Account("my account", "", AccountType.CUSTOM); expected.setAccountState(AccountState.HIDDEN); expected.setSelected(true); expected.setID(22); Mockito.verify(accountRepository, Mockito.atLeast(1)).save(expected); // placeholder set as selected account - final Account accountSelected = new Account("Placeholder", AccountType.ALL); + final Account accountSelected = new Account("Placeholder", "", AccountType.ALL); accountSelected.setSelected(true); accountSelected.setID(1); Mockito.verify(accountRepository, Mockito.atLeast(1)).save(accountSelected); diff --git a/BudgetMasterServer/src/test/java/de/deadlocker8/budgetmaster/unit/IconServiceTest.java b/BudgetMasterServer/src/test/java/de/deadlocker8/budgetmaster/unit/IconServiceTest.java index b4bf86a140b3b7305c75714c592b0c4ed5928356..447688f87d5cfbcccc45b37a641bb35170386cdb 100644 --- a/BudgetMasterServer/src/test/java/de/deadlocker8/budgetmaster/unit/IconServiceTest.java +++ b/BudgetMasterServer/src/test/java/de/deadlocker8/budgetmaster/unit/IconServiceTest.java @@ -47,7 +47,7 @@ class IconServiceTest void test_deleteIcon_withReferringAccount() { final Icon icon = Mockito.spy(new Icon("fas fa-icons")); - final Account account = Mockito.spy(new Account("account with icon", AccountType.CUSTOM, icon)); + final Account account = Mockito.spy(new Account("account with icon", "", AccountType.CUSTOM, icon)); Mockito.when(icon.getReferringAccount()).thenReturn(account); diff --git a/BudgetMasterServer/src/test/java/de/deadlocker8/budgetmaster/unit/IconizableTest.java b/BudgetMasterServer/src/test/java/de/deadlocker8/budgetmaster/unit/IconizableTest.java index 077d89c584d1e3a794487ddd528d49c3f023e555..6d267ded39e94f716bef334fa8ea21b3f41fe012 100644 --- a/BudgetMasterServer/src/test/java/de/deadlocker8/budgetmaster/unit/IconizableTest.java +++ b/BudgetMasterServer/src/test/java/de/deadlocker8/budgetmaster/unit/IconizableTest.java @@ -33,7 +33,7 @@ class IconizableTest @Test void test_updateIcon_noExistingItem_newEmptyIcon() { - final Account account = Mockito.spy(new Account("account with icon", AccountType.CUSTOM)); + final Account account = Mockito.spy(new Account("account with icon", "", AccountType.CUSTOM)); final Icon icon = new Icon(null, null); @@ -52,7 +52,7 @@ class IconizableTest @Test void test_updateIcon_noExistingItem_newBuiltinIcon() { - final Account account = Mockito.spy(new Account("account with icon", AccountType.CUSTOM)); + final Account account = Mockito.spy(new Account("account with icon", "", AccountType.CUSTOM)); final String builtinIdentifier = "fas fa-icons"; final Icon icon = new Icon(builtinIdentifier); @@ -75,7 +75,7 @@ class IconizableTest final String builtinIdentifier = "fas fa-icons"; final Icon icon = new Icon(builtinIdentifier); - final Account account = new Account("account with icon", AccountType.CUSTOM, icon); + final Account account = new Account("account with icon", "", AccountType.CUSTOM, icon); account.setID(18); final Account accountSpy = Mockito.spy(account); @@ -95,7 +95,7 @@ class IconizableTest void test_updateIcon_existingItem_newEmptyIcon() { final Icon icon = new Icon("fas fa-icons"); - final Account account = new Account("account with icon", AccountType.CUSTOM, icon); + final Account account = new Account("account with icon", "", AccountType.CUSTOM, icon); account.setID(18); final Account accountSpy = Mockito.spy(account); diff --git a/BudgetMasterServer/src/test/java/de/deadlocker8/budgetmaster/unit/TemplateServiceTest.java b/BudgetMasterServer/src/test/java/de/deadlocker8/budgetmaster/unit/TemplateServiceTest.java index fb8711816cc3190d73b556d6e3f50464ce17ccf6..44b6a7df0401d027a496ec2db30eb49fea20cd30 100644 --- a/BudgetMasterServer/src/test/java/de/deadlocker8/budgetmaster/unit/TemplateServiceTest.java +++ b/BudgetMasterServer/src/test/java/de/deadlocker8/budgetmaster/unit/TemplateServiceTest.java @@ -25,7 +25,7 @@ class TemplateServiceTest { private static final Category CATEGORY_NONE = new Category("No category", "#FFFFFF", CategoryType.NONE); - private static final Account ACCOUNT_SELECTED = new Account("Selected Account", AccountType.CUSTOM); + private static final Account ACCOUNT_SELECTED = new Account("Selected Account", "", AccountType.CUSTOM); @Mock private TemplateRepository templateRepository; @@ -58,14 +58,14 @@ class TemplateServiceTest final Template expectedTemplate = new Template(); expectedTemplate.setCategory(CATEGORY_NONE); - templateService.prepareTemplateForNewTransaction(template, false, new Account("my account", AccountType.CUSTOM)); + templateService.prepareTemplateForNewTransaction(template, false, new Account("my account", "", AccountType.CUSTOM)); assertThat(template).isEqualTo(expectedTemplate); } @Test void test_prepareTemplateForNewTransaction_accountIsFullAccess_noPreparation() { - final Account account = new Account("Account", AccountType.CUSTOM); + final Account account = new Account("Account", "", AccountType.CUSTOM); account.setAccountState(AccountState.FULL_ACCESS); final Template template = new Template(); @@ -83,7 +83,7 @@ class TemplateServiceTest @Test void test_prepareTemplateForNewTransaction_accountIsNotFullAccess_noPreparation() { - final Account account = new Account("Account", AccountType.CUSTOM); + final Account account = new Account("Account", "", AccountType.CUSTOM); account.setAccountState(AccountState.READ_ONLY); final Template template = new Template(); @@ -104,10 +104,10 @@ class TemplateServiceTest @Test void test_prepareTemplateForNewTransaction_transferAccountIsFullAccess_noPreparation() { - final Account account = new Account("Account", AccountType.CUSTOM); + final Account account = new Account("Account", "", AccountType.CUSTOM); account.setAccountState(AccountState.FULL_ACCESS); - final Account transferAccount = new Account("Transfer Account", AccountType.CUSTOM); + final Account transferAccount = new Account("Transfer Account", "", AccountType.CUSTOM); transferAccount.setAccountState(AccountState.FULL_ACCESS); final Template template = new Template(); @@ -127,10 +127,10 @@ class TemplateServiceTest @Test void test_prepareTemplateForNewTransaction_transferAccountIsNotFullAccess_noPreparation() { - final Account account = new Account("Account", AccountType.CUSTOM); + final Account account = new Account("Account", "", AccountType.CUSTOM); account.setAccountState(AccountState.FULL_ACCESS); - final Account transferAccount = new Account("Transfer Account", AccountType.CUSTOM); + final Account transferAccount = new Account("Transfer Account", "", AccountType.CUSTOM); transferAccount.setAccountState(AccountState.READ_ONLY); final Template template = new Template(); diff --git a/BudgetMasterServer/src/test/java/de/deadlocker8/budgetmaster/unit/TransactionImportServiceTest.java b/BudgetMasterServer/src/test/java/de/deadlocker8/budgetmaster/unit/TransactionImportServiceTest.java index cbc2a34ee0bcc88e7a1219e4582f93268dcf2f49..30e12772d151d755b6192841ee2f4e0638cdbbd4 100644 --- a/BudgetMasterServer/src/test/java/de/deadlocker8/budgetmaster/unit/TransactionImportServiceTest.java +++ b/BudgetMasterServer/src/test/java/de/deadlocker8/budgetmaster/unit/TransactionImportServiceTest.java @@ -32,7 +32,7 @@ class TransactionImportServiceTest { private static final Category CATEGORY_NONE = new Category("No category", "#FFFFFF", CategoryType.NONE); private static final Category CATEGORY_CUSTOM = new Category("CustomCategory", "#0F0F0F", CategoryType.CUSTOM); - private static final Account ACCOUNT = new Account("MyAccount", AccountType.CUSTOM); + private static final Account ACCOUNT = new Account("MyAccount", "", AccountType.CUSTOM); @Mock private HelpersService helpersService; diff --git a/BudgetMasterServer/src/test/java/de/deadlocker8/budgetmaster/unit/TransactionSearchSpecificationsTest.java b/BudgetMasterServer/src/test/java/de/deadlocker8/budgetmaster/unit/TransactionSearchSpecificationsTest.java index 62045b38e441a674e2727069773aa1d2a40a7c7b..c6c27fafaadccfc45bfe9971f7ac2fe27f0ede7d 100644 --- a/BudgetMasterServer/src/test/java/de/deadlocker8/budgetmaster/unit/TransactionSearchSpecificationsTest.java +++ b/BudgetMasterServer/src/test/java/de/deadlocker8/budgetmaster/unit/TransactionSearchSpecificationsTest.java @@ -90,9 +90,9 @@ class TransactionSearchSpecificationsTest @BeforeEach public void init() { - account = accountRepository.save(new Account("TestAccount", AccountType.CUSTOM)); - account2 = accountRepository.save(new Account("TestAccount2", AccountType.CUSTOM)); - accountHidden = accountRepository.save(new Account("Hidden account", AccountType.CUSTOM)); + account = accountRepository.save(new Account("TestAccount", "", AccountType.CUSTOM)); + account2 = accountRepository.save(new Account("TestAccount2", "", AccountType.CUSTOM)); + accountHidden = accountRepository.save(new Account("Hidden account", "", AccountType.CUSTOM)); accountHidden.setAccountState(AccountState.HIDDEN); category1 = categoryRepository.save(new Category("Category1", "#ff0000", CategoryType.CUSTOM)); diff --git a/BudgetMasterServer/src/test/java/de/deadlocker8/budgetmaster/unit/TransactionServiceDatabaseTest.java b/BudgetMasterServer/src/test/java/de/deadlocker8/budgetmaster/unit/TransactionServiceDatabaseTest.java index 5e4443064753678cd7fb4486632877ea61002493..cb6302dcc379b303f753086cd1237494323314ad 100644 --- a/BudgetMasterServer/src/test/java/de/deadlocker8/budgetmaster/unit/TransactionServiceDatabaseTest.java +++ b/BudgetMasterServer/src/test/java/de/deadlocker8/budgetmaster/unit/TransactionServiceDatabaseTest.java @@ -77,7 +77,7 @@ class TransactionServiceDatabaseTest @BeforeEach void beforeEach() { - Account secondAccount = new Account("Second Account", AccountType.CUSTOM); + Account secondAccount = new Account("Second Account", "", AccountType.CUSTOM); secondAccount = accountRepository.save(secondAccount); Category category1 = new Category("Regen", "#ffcc00", CategoryType.CUSTOM); diff --git a/BudgetMasterServer/src/test/java/de/deadlocker8/budgetmaster/unit/TransactionServiceTest.java b/BudgetMasterServer/src/test/java/de/deadlocker8/budgetmaster/unit/TransactionServiceTest.java index 907cffd7648f38762c9efc4537dd655dadeb89cf..f38c17e796c7e69e436521f6e0b6dd1788908587 100644 --- a/BudgetMasterServer/src/test/java/de/deadlocker8/budgetmaster/unit/TransactionServiceTest.java +++ b/BudgetMasterServer/src/test/java/de/deadlocker8/budgetmaster/unit/TransactionServiceTest.java @@ -29,7 +29,7 @@ class TransactionServiceTest private static final Category CATEGORY_REST = new Category("Balance", "#FFFF00", CategoryType.REST); private static final Category CATEGORY_CUSTOM = new Category("CustomCategory", "#0F0F0F", CategoryType.CUSTOM); - private static final Account ACCOUNT = new Account("MyAccount", AccountType.CUSTOM); + private static final Account ACCOUNT = new Account("MyAccount", "", AccountType.CUSTOM); @Mock private TransactionRepository transactionRepository; diff --git a/BudgetMasterServer/src/test/java/de/deadlocker8/budgetmaster/unit/TransactionSpecificationsTest.java b/BudgetMasterServer/src/test/java/de/deadlocker8/budgetmaster/unit/TransactionSpecificationsTest.java index b3422d40d4fd8098fc7464587234783f358823f3..73061e91d9915a4ff9c46906b38962c47d21e265 100644 --- a/BudgetMasterServer/src/test/java/de/deadlocker8/budgetmaster/unit/TransactionSpecificationsTest.java +++ b/BudgetMasterServer/src/test/java/de/deadlocker8/budgetmaster/unit/TransactionSpecificationsTest.java @@ -94,9 +94,9 @@ class TransactionSpecificationsTest @BeforeEach public void init() { - account = accountRepository.save(new Account("TestAccount", AccountType.CUSTOM)); - account2 = accountRepository.save(new Account("TestAccount2", AccountType.CUSTOM)); - accountHidden = accountRepository.save(new Account("Hidden Account", AccountType.CUSTOM)); + account = accountRepository.save(new Account("TestAccount", "", AccountType.CUSTOM)); + account2 = accountRepository.save(new Account("TestAccount2", "", AccountType.CUSTOM)); + accountHidden = accountRepository.save(new Account("Hidden Account", "", AccountType.CUSTOM)); accountHidden.setAccountState(AccountState.HIDDEN); categoryUnused = categoryRepository.save(new Category("CategoryUnused", "#00ff00", CategoryType.CUSTOM)); diff --git a/BudgetMasterServer/src/test/java/de/deadlocker8/budgetmaster/unit/database/DatabaseExportTest.java b/BudgetMasterServer/src/test/java/de/deadlocker8/budgetmaster/unit/database/DatabaseExportTest.java index c25c689c9ffbaf270ce094b067ddee9daaa994bc..f49c814b37a702fb5833626a3693b0bbffcec77c 100644 --- a/BudgetMasterServer/src/test/java/de/deadlocker8/budgetmaster/unit/database/DatabaseExportTest.java +++ b/BudgetMasterServer/src/test/java/de/deadlocker8/budgetmaster/unit/database/DatabaseExportTest.java @@ -206,9 +206,9 @@ class DatabaseExportTest Mockito.when(categoryService.getAllEntitiesAsc()).thenReturn(List.of(categoryNone, categoryCustom)); // accounts - Account account1 = new Account("Source_Account_1", AccountType.CUSTOM); + Account account1 = new Account("Source_Account_1", null, AccountType.CUSTOM); account1.setID(2); - Account account2 = new Account("Source_Account_2", AccountType.CUSTOM); + Account account2 = new Account("Source_Account_2", null, AccountType.CUSTOM); account2.setID(3); AccountRepository accountRepositoryMock = Mockito.mock(AccountRepository.class); diff --git a/BudgetMasterServer/src/test/java/de/deadlocker8/budgetmaster/unit/database/DatabaseParser_v10_convertToInternalTest.java b/BudgetMasterServer/src/test/java/de/deadlocker8/budgetmaster/unit/database/DatabaseParser_v10_convertToInternalTest.java index 77af31beafafc404a3877a0090e523f058f36e09..a65fb1d9a134b1a1381603839160fd13be22661b 100644 --- a/BudgetMasterServer/src/test/java/de/deadlocker8/budgetmaster/unit/database/DatabaseParser_v10_convertToInternalTest.java +++ b/BudgetMasterServer/src/test/java/de/deadlocker8/budgetmaster/unit/database/DatabaseParser_v10_convertToInternalTest.java @@ -121,7 +121,7 @@ class DatabaseParser_v10_convertToInternalTest final Icon icon = new Icon(accountImage); icon.setID(1); - final Account account = new Account("Second Account", AccountType.CUSTOM, icon); + final Account account = new Account("Second Account", null, AccountType.CUSTOM, icon); account.setID(3); assertThat(database.getAccounts()).hasSize(3) @@ -206,7 +206,7 @@ class DatabaseParser_v10_convertToInternalTest DatabaseParser_v10 importer = new DatabaseParser_v10(json); InternalDatabase database = importer.parseDatabaseFromJSON().convertToInternal(); - Account account1 = new Account("Default", AccountType.CUSTOM); + Account account1 = new Account("Default", null, AccountType.CUSTOM); account1.setID(2); Image image = new Image(new Byte[0], "awesomeIcon.png", ImageFileExtension.PNG); @@ -215,7 +215,7 @@ class DatabaseParser_v10_convertToInternalTest Icon accountIcon = new Icon(image); accountIcon.setID(1); - Account account2 = new Account("Second Account", AccountType.CUSTOM); + Account account2 = new Account("Second Account", null, AccountType.CUSTOM); account2.setIconReference(accountIcon); account2.setID(3); diff --git a/BudgetMasterServer/src/test/java/de/deadlocker8/budgetmaster/unit/database/ImportServiceTest.java b/BudgetMasterServer/src/test/java/de/deadlocker8/budgetmaster/unit/database/ImportServiceTest.java index 99d2750393b0002029efc07e5e5751426c88bd20..a30bcb3845ed743ed0d1d2531ab8ad189ff2f33a 100644 --- a/BudgetMasterServer/src/test/java/de/deadlocker8/budgetmaster/unit/database/ImportServiceTest.java +++ b/BudgetMasterServer/src/test/java/de/deadlocker8/budgetmaster/unit/database/ImportServiceTest.java @@ -38,6 +38,7 @@ import de.deadlocker8.budgetmaster.transactions.keywords.TransactionNameKeyword; import de.deadlocker8.budgetmaster.transactions.keywords.TransactionNameKeywordService; import de.deadlocker8.budgetmaster.utils.Strings; import de.thecodelabs.utils.util.Localization; +import jakarta.persistence.EntityManager; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.mockito.Mockito; @@ -53,7 +54,6 @@ import org.testcontainers.containers.PostgreSQLContainer; import org.testcontainers.junit.jupiter.Container; import org.testcontainers.junit.jupiter.Testcontainers; -import jakarta.persistence.EntityManager; import java.io.IOException; import java.net.URISyntaxException; import java.nio.charset.StandardCharsets; @@ -215,11 +215,11 @@ class ImportServiceTest categoryRent); // assert accounts - final Account accountPlaceholder = createAccount(1, "Placeholder", AccountType.ALL, AccountState.FULL_ACCESS, iconAllAccounts, false, false); - final Account accountDefault = createAccount(2, "Default Account", AccountType.CUSTOM, AccountState.FULL_ACCESS, iconAccountDefault, true, true); - final Account accountDefaultNew = createAccount(3, "My Default Account", AccountType.CUSTOM, AccountState.FULL_ACCESS, iconAccountDefaultNew, false, false); - final Account accountReadOnly = createAccount(4, "Read-only account", AccountType.CUSTOM, AccountState.READ_ONLY, iconAccountReadOnly, false, false); - final Account accountSecond = createAccount(5, "Second Account", AccountType.CUSTOM, AccountState.FULL_ACCESS, iconAccountSecond, false, false); + final Account accountPlaceholder = createAccount(1, "Placeholder", "", AccountType.ALL, AccountState.FULL_ACCESS, iconAllAccounts, false, false); + final Account accountDefault = createAccount(2, "Default Account", "", AccountType.CUSTOM, AccountState.FULL_ACCESS, iconAccountDefault, true, true); + final Account accountDefaultNew = createAccount(3, "My Default Account", null, AccountType.CUSTOM, AccountState.FULL_ACCESS, iconAccountDefaultNew, false, false); + final Account accountReadOnly = createAccount(4, "Read-only account", null, AccountType.CUSTOM, AccountState.READ_ONLY, iconAccountReadOnly, false, false); + final Account accountSecond = createAccount(5, "Second Account", null, AccountType.CUSTOM, AccountState.FULL_ACCESS, iconAccountSecond, false, false); assertThat(accountRepository.findAll()) .hasSize(5) .contains(accountPlaceholder, @@ -461,9 +461,9 @@ class ImportServiceTest return category; } - private Account createAccount(int ID, String name, AccountType type, AccountState state, Icon icon, boolean isSelected, boolean isDefault) + private Account createAccount(int ID, String name, String description, AccountType type, AccountState state, Icon icon, boolean isSelected, boolean isDefault) { - final Account account = new Account(name, type, icon); + final Account account = new Account(name, description, type, icon); account.setID(ID); account.setAccountState(state); account.setSelected(isSelected); diff --git a/BudgetMasterServer/src/test/java/de/deadlocker8/budgetmaster/unit/database/importer/AccountImporterTest.java b/BudgetMasterServer/src/test/java/de/deadlocker8/budgetmaster/unit/database/importer/AccountImporterTest.java index 479999181b8a9957b9a205fe1cf466b70f6b786e..bc9b7169ae3412cf2e0803875862dbaa5c5f46c8 100644 --- a/BudgetMasterServer/src/test/java/de/deadlocker8/budgetmaster/unit/database/importer/AccountImporterTest.java +++ b/BudgetMasterServer/src/test/java/de/deadlocker8/budgetmaster/unit/database/importer/AccountImporterTest.java @@ -2,7 +2,6 @@ package de.deadlocker8.budgetmaster.unit.database.importer; import de.deadlocker8.budgetmaster.accounts.Account; import de.deadlocker8.budgetmaster.accounts.AccountRepository; -import de.deadlocker8.budgetmaster.accounts.AccountState; import de.deadlocker8.budgetmaster.accounts.AccountType; import de.deadlocker8.budgetmaster.database.importer.AccountImporter; import de.deadlocker8.budgetmaster.services.EntityType; @@ -12,7 +11,6 @@ import org.springframework.beans.factory.annotation.Autowired; import java.util.List; -import static org.assertj.core.api.Assertions.as; import static org.assertj.core.api.Assertions.assertThat; class AccountImporterTest extends ImporterTestBase @@ -29,16 +27,16 @@ class AccountImporterTest extends ImporterTestBase @Test void test_importAccounts() { - final Account sourceAccount = new Account("SourceAccount", AccountType.CUSTOM); + final Account sourceAccount = new Account("SourceAccount", "", AccountType.CUSTOM); sourceAccount.setID(2); - final Account sourceAccount2 = new Account("SourceAccount 2", AccountType.CUSTOM); + final Account sourceAccount2 = new Account("SourceAccount 2", "", AccountType.CUSTOM); sourceAccount2.setID(7); - final Account destinationAccount = new Account("DestinationAccount", AccountType.CUSTOM); + final Account destinationAccount = new Account("DestinationAccount", "", AccountType.CUSTOM); destinationAccount.setID(1); - final Account destinationAccount2 = new Account("DestinationAccount 2", AccountType.CUSTOM); + final Account destinationAccount2 = new Account("DestinationAccount 2", "", AccountType.CUSTOM); destinationAccount2.setID(2); final AccountImporter importer = new AccountImporter(accountRepository); @@ -53,10 +51,10 @@ class AccountImporterTest extends ImporterTestBase @Test void test_importAccounts_placeholder() { - final Account placeholderAccount = new Account("Placeholder", AccountType.ALL); + final Account placeholderAccount = new Account("Placeholder", "", AccountType.ALL); placeholderAccount.setID(12); - final Account existingPlaceholderAccount = new Account("Placeholder", AccountType.ALL); + final Account existingPlaceholderAccount = new Account("Placeholder", "", AccountType.ALL); existingPlaceholderAccount.setID(1); accountRepository.save(existingPlaceholderAccount); @@ -71,10 +69,10 @@ class AccountImporterTest extends ImporterTestBase @Test void test_importAccounts_nameAlreadyExists() { - final Account account = new Account("ABC", AccountType.CUSTOM); + final Account account = new Account("ABC", "", AccountType.CUSTOM); account.setID(12); - final Account existingAccount = new Account("ABC", AccountType.CUSTOM); + final Account existingAccount = new Account("ABC", "", AccountType.CUSTOM); existingAccount.setID(1); accountRepository.save(existingAccount); diff --git a/BudgetMasterServer/src/test/java/de/deadlocker8/budgetmaster/unit/database/importer/TemplateImporterTest.java b/BudgetMasterServer/src/test/java/de/deadlocker8/budgetmaster/unit/database/importer/TemplateImporterTest.java index f9e002bcb84e3af3388f5ca4583e160e2640b4e9..505c7e694b1016294c01b951b5d93b38f32548da 100644 --- a/BudgetMasterServer/src/test/java/de/deadlocker8/budgetmaster/unit/database/importer/TemplateImporterTest.java +++ b/BudgetMasterServer/src/test/java/de/deadlocker8/budgetmaster/unit/database/importer/TemplateImporterTest.java @@ -59,10 +59,10 @@ class TemplateImporterTest extends ImporterTestBase Category category = new Category("Awesome Category", "#ff0000", CategoryType.CUSTOM); category = categoryRepository.save(category); - Account account = new Account("Awesome Account", AccountType.CUSTOM); + Account account = new Account("Awesome Account", "", AccountType.CUSTOM); account = accountRepository.save(account); - Account transferAccount = new Account("Transfer Account", AccountType.CUSTOM); + Account transferAccount = new Account("Transfer Account", "", AccountType.CUSTOM); transferAccount = accountRepository.save(transferAccount); Icon icon = new Icon("fas fa-icons"); @@ -115,7 +115,7 @@ class TemplateImporterTest extends ImporterTestBase Category category = new Category("Awesome Category", "#ff0000", CategoryType.CUSTOM); category = categoryRepository.save(category); - Account account = new Account("Awesome Account", AccountType.CUSTOM); + Account account = new Account("Awesome Account", "", AccountType.CUSTOM); account = accountRepository.save(account); Icon icon = new Icon("fas fa-icons"); @@ -179,7 +179,7 @@ class TemplateImporterTest extends ImporterTestBase Category category = new Category("Awesome Category", "#ff0000", CategoryType.CUSTOM); category = categoryRepository.save(category); - Account account = new Account("Awesome Account", AccountType.CUSTOM); + Account account = new Account("Awesome Account", "", AccountType.CUSTOM); account = accountRepository.save(account); Icon icon = new Icon("fas fa-icons"); diff --git a/BudgetMasterServer/src/test/java/de/deadlocker8/budgetmaster/unit/database/importer/TransactionImporterTest.java b/BudgetMasterServer/src/test/java/de/deadlocker8/budgetmaster/unit/database/importer/TransactionImporterTest.java index 22d63f916dfb2207ce2d41e3687a5f868309b3b6..c8d21e2a4aee434a9cfdbd98d2c6dbb149a4b15b 100644 --- a/BudgetMasterServer/src/test/java/de/deadlocker8/budgetmaster/unit/database/importer/TransactionImporterTest.java +++ b/BudgetMasterServer/src/test/java/de/deadlocker8/budgetmaster/unit/database/importer/TransactionImporterTest.java @@ -52,7 +52,7 @@ class TransactionImporterTest extends ImporterTestBase Category category = new Category("Awesome Category", "#ff0000", CategoryType.CUSTOM); category = categoryRepository.save(category); - Account account = new Account("Awesome Account", AccountType.CUSTOM); + Account account = new Account("Awesome Account", "", AccountType.CUSTOM); account = accountRepository.save(account); final Transaction transaction = new Transaction(); @@ -96,10 +96,10 @@ class TransactionImporterTest extends ImporterTestBase Category category = new Category("Awesome Category", "#ff0000", CategoryType.CUSTOM); category = categoryRepository.save(category); - Account account = new Account("Awesome Account", AccountType.CUSTOM); + Account account = new Account("Awesome Account", "", AccountType.CUSTOM); account = accountRepository.save(account); - Account transferAccount = new Account("Transfer Account", AccountType.CUSTOM); + Account transferAccount = new Account("Transfer Account", "", AccountType.CUSTOM); transferAccount = accountRepository.save(transferAccount); final Transaction transaction = new Transaction(); @@ -144,7 +144,7 @@ class TransactionImporterTest extends ImporterTestBase Category category = new Category("Awesome Category", "#ff0000", CategoryType.CUSTOM); category = categoryRepository.save(category); - Account account = new Account("Awesome Account", AccountType.CUSTOM); + Account account = new Account("Awesome Account", "", AccountType.CUSTOM); account = accountRepository.save(account); final Transaction transaction = new Transaction(); @@ -192,7 +192,7 @@ class TransactionImporterTest extends ImporterTestBase Category category = new Category("Awesome Category", "#ff0000", CategoryType.CUSTOM); category = categoryRepository.save(category); - Account account = new Account("Awesome Account", AccountType.CUSTOM); + Account account = new Account("Awesome Account", "", AccountType.CUSTOM); account = accountRepository.save(account); final Transaction transaction = new Transaction(); @@ -246,7 +246,7 @@ class TransactionImporterTest extends ImporterTestBase Category category = new Category("Awesome Category", "#ff0000", CategoryType.CUSTOM); category = categoryRepository.save(category); - Account account = new Account("Awesome Account", AccountType.CUSTOM); + Account account = new Account("Awesome Account", "", AccountType.CUSTOM); account = accountRepository.save(account); diff --git a/BudgetMasterServer/src/test/java/de/deadlocker8/budgetmaster/unit/repeating/RepeatingTransactionUpdaterTest.java b/BudgetMasterServer/src/test/java/de/deadlocker8/budgetmaster/unit/repeating/RepeatingTransactionUpdaterTest.java index f6e5116205a0d4fd60b809a21a77237f21daddab..e6a67bf1cf78130d8f0cf1195978cde9ad353028 100644 --- a/BudgetMasterServer/src/test/java/de/deadlocker8/budgetmaster/unit/repeating/RepeatingTransactionUpdaterTest.java +++ b/BudgetMasterServer/src/test/java/de/deadlocker8/budgetmaster/unit/repeating/RepeatingTransactionUpdaterTest.java @@ -63,7 +63,7 @@ class RepeatingTransactionUpdaterTest new RepeatingModifierYears(1), new RepeatingEndAfterXTimes(2)); - final Account account = new Account("Account", AccountType.CUSTOM); + final Account account = new Account("Account", "", AccountType.CUSTOM); TRANSACTION_1 = new Transaction(); TRANSACTION_1.setName("abc");