@@ -0,0 +1,2041 @@
+package com.growthbeat.model;%0A%0Aimport static org.junit.Assert.assertEquals;%0Aimport static org.junit.Assert.assertNotNull;%0Aimport static org.junit.Assert.assertNull;%0Aimport static org.junit.Assert.fail;%0A%0Aimport java.util.Random;%0A%0Aimport org.junit.BeforeClass;%0Aimport org.junit.Test;%0A%0Aimport com.growthbeat.BaseTest;%0Aimport com.growthbeat.GrowthbeatException;%0A%0Apublic class UserTest extends BaseTest %7B%0A%0A%09private static String password = null;%0A%0A%09@BeforeClass%0A%09public static void beforeClass() %7B%0A%09%09password = %22password_%22 + new Random().nextInt();%0A%09%7D%0A%0A%09@Test%0A%09public void findByAccountId() %7B%0A%09%09User user = User.findByAccountId(testAccount.getId(), testCredential.getId());%0A%09%09assertNull(user);%0A%09%7D%0A%0A%09@Test%0A%09public void create1() %7B%0A%09%09String mail = new Random().nextInt() + %22@growthbeat.com%22;%0A%09%09User user = User.create(testAccount.getId(), mail, password, testCredential.getId());%0A%09%09assertNotNull(user);%0A%09%09assertEquals(testAccount.getId(), user.getAccount().getId());%0A%09%09assertEquals(mail, user.getMail());%0A%09%7D%0A%0A%09@Test%0A%09public void create2() %7B%0A%09%09String mail = new Random().nextInt() + %22@growthbeat.com%22;%0A%09%09User user = User.create(mail, password, testCredential.getId());%0A%09%09assertNotNull(user);%0A%09%09assertNotNull(user.getAccount().getId());%0A%09%09assertEquals(mail, user.getMail());%0A%09%7D%0A%0A%09@Test%0A%09public void updateMail() %7B%0A%09%09String mail = new Random().nextInt() + %22@growthbeat.com%22;%0A%09%09User user = User.updateMail(testAccount.getId(), mail, testCredential.getId());%0A%09%09assertNotNull(user);%0A%09%09assertEquals(testAccount.getId(), user.getAccount().getId());%0A%09%09assertEquals(mail, user.getMail());%0A%09%7D%0A%0A%09@Test%0A%09public void updatePassword() %7B%0A%09%09String newPassword = %22password_%22 + new Random().nextInt();%0A%09%09User user = User.updatePassword(testAccount.getId(), password, newPassword, testCredential.getId());%0A%09%09assertNotNull(user);%0A%09%09assertEquals(testAccount.getId(), user.getAccount().getId());%0A%09%7D%0A%0A%09@Test%0A%09public void deleteById() %7B%0A%09%09try %7B%0A%09%09%09User.deleteByAccountId(testAccount.getId(), testCredential.getId());%0A%09%09%09fail();%0A%09%09%7D catch (GrowthbeatException e) %7B%0A%09%09%7D%0A%09%7D%0A%0A%7D%0A

Add test of User model