private Account createAccount() { final Account account = Mockito.mock(Account.class); Mockito.when(account.getExternalKey()).thenReturn("1234abcd"); Mockito.when(account.getName()).thenReturn("Jim Smith"); Mockito.when(account.getFirstNameLength()).thenReturn(3); Mockito.when(account.getEmail()).thenReturn("jim.smith@mail.com"); Mockito.when(account.getLocale()).thenReturn(Locale.US.toString()); Mockito.when(account.getAddress1()).thenReturn("123 Some Street"); Mockito.when(account.getAddress2()).thenReturn("Apt 456"); Mockito.when(account.getCity()).thenReturn("Some City"); Mockito.when(account.getStateOrProvince()).thenReturn("Some State"); Mockito.when(account.getPostalCode()).thenReturn("12345-6789"); Mockito.when(account.getCountry()).thenReturn("USA"); Mockito.when(account.getPhone()).thenReturn("123-456-7890"); return account; }
Assert.assertEquals(accountJson.getAddress2(), account.getAddress2()); Assert.assertEquals(accountJson.getBillCycleDayLocal(), (Integer) bcd); Assert.assertEquals(accountJson.getCountry(), account.getCountry());
public AccountJson(final Account account, final BigDecimal accountBalance, final BigDecimal accountCBA, @Nullable final AccountAuditLogs accountAuditLogs) { super(toAuditLogJson(accountAuditLogs == null ? null : accountAuditLogs.getAuditLogsForAccount())); this.accountCBA = accountCBA; this.accountBalance = accountBalance; this.accountId = account.getId().toString(); this.externalKey = account.getExternalKey(); this.name = account.getName(); this.firstNameLength = account.getFirstNameLength(); this.email = account.getEmail(); this.billCycleDayLocal = account.getBillCycleDayLocal(); this.currency = account.getCurrency() != null ? account.getCurrency().toString() : null; this.paymentMethodId = account.getPaymentMethodId() != null ? account.getPaymentMethodId().toString() : null; this.timeZone = account.getTimeZone().toString(); this.address1 = account.getAddress1(); this.address2 = account.getAddress2(); this.postalCode = account.getPostalCode(); this.company = account.getCompanyName(); this.city = account.getCity(); this.state = account.getStateOrProvince(); this.country = account.getCountry(); this.locale = account.getLocale(); this.phone = account.getPhone(); this.isMigrated = account.isMigrated(); this.isNotifiedForInvoices = account.isNotifiedForInvoices(); }