grassrootza / grassroot-platform

Modular application to make it easier and faster to organize and mobilize people, through a meeting organizer, vote taker, action logger and group manager.
BSD 3-Clause "New" or "Revised" License
12 stars 9 forks source link

Account entity ID not being generated #23

Closed luke-grassroot closed 9 years ago

luke-grassroot commented 9 years ago

Via 'admin/accounts/create', posting, get this log error:

org.postgresql.util.PSQLException: ERROR: null value in column "id" violates not-null constraint Detail: Failing row contains (null, 2015-11-13 23:05:49.053, Test, null, t, t, t).

luke-grassroot commented 9 years ago

Call route is accountManagementService.createAccount(String accountName)

aakil786 commented 9 years ago

will have a look

aakil786 commented 9 years ago

account entity and account repository looks fine, passes a simple save test

aakil786 commented 9 years ago

service test also passes :-(

@Test
public void shouldSaveBilling() {
    String email = "bigbucks@money.com";
    Account account = accountManagementService.createAccount("branch1");
    account = accountManagementService.setBillingEmail(account, email);
    assertNotEquals(null,account.getId());
    assertEquals("bigbucks@money.com",account.getPrimaryEmail());
}
aakil786 commented 9 years ago

will have to make myself an administrator so i can test the web page

luke-grassroot commented 9 years ago

I am also writing tests in core (really big bloops on my part not to have done earlier) and the repository is passing. So the problem isn't in Hibernate/JPA, it must be in the DB (since this only causes a problem in local_pg). Maybe I messed something up in creating/assigning the sequences?

luke-grassroot commented 9 years ago

Fixed by latest commit recreating table.