@Override protected void configure() { bindCertPathStore(); bindAttachmentStore(); bindAccountStore(); bindDeltaStore(); }
public final void testRoundtripRobotAccount() throws Exception { AccountStore accountStore = newAccountStore(); accountStore.putAccount(robotAccount); AccountData retrievedAccount = accountStore.getAccount(ROBOT_ID); assertEquals(robotAccount, retrievedAccount); }
public final void testRemoveAccount() throws Exception { AccountStore accountStore = newAccountStore(); accountStore.putAccount(robotAccount); AccountData account = accountStore.getAccount(ROBOT_ID); assertEquals(robotAccount, account); accountStore.removeAccount(ROBOT_ID); assertNull("Removed account was not null", accountStore.getAccount(ROBOT_ID)); } }
public void testStoreCanStoreData() throws Exception { String testData = "some file data"; AttachmentId id = new AttachmentId("", "id_1"); AttachmentStore store = makeStoreWithData(id, testData); AttachmentData data = store.getAttachment(id); assertEquals(testData, dataToString(data)); }
public void testContentLengthMatchesDataSize() throws Exception { String testData = "blah blah blah"; AttachmentId id = new AttachmentId("", "id_2"); AttachmentStore store = makeStoreWithData(id, testData); AttachmentData data = store.getAttachment(id); assertEquals(testData.length(), data.getSize()); }
public void testStoreCanDeleteData() throws Exception { String testData = "some day, I'm going to run out of test strings"; AttachmentId id = new AttachmentId("", "id_3"); AttachmentStore store = makeStoreWithData(id, testData); store.deleteAttachment(id); AttachmentData data = store.getAttachment(id); assertNull(data); }
public final void testGetMissingAccountReturnsNull() throws Exception { AccountStore accountStore = newAccountStore(); assertNull(accountStore.getAccount(HUMAN_ID)); }
public void testStoreReturnsNullForNonexistantId() throws IOException { AttachmentStore store = newAttachmentStore(); AttachmentId id = new AttachmentId("", "some_madeup_id"); assertNull(store.getAttachment(id)); }
protected AttachmentStore makeStoreWithData(AttachmentId id, String data) throws Exception { AttachmentStore store = newAttachmentStore(); writeStringDataToAttachmentStore(store, id, data); return store; }
public final void testPutAccountOverrides() throws Exception { AccountStore accountStore = newAccountStore(); accountStore.putAccount(robotAccount); AccountData account = accountStore.getAccount(ROBOT_ID); assertEquals(robotAccount, account); accountStore.putAccount(updatedRobotAccount); AccountData updatedAccount = accountStore.getAccount(ROBOT_ID); assertEquals(updatedRobotAccount, updatedAccount); }
public final void testRemoveAccount() throws Exception { AccountStore accountStore = newAccountStore(); accountStore.putAccount(robotAccount); AccountData account = accountStore.getAccount(ROBOT_ID); assertEquals(robotAccount, account); accountStore.removeAccount(ROBOT_ID); assertNull("Removed account was not null", accountStore.getAccount(ROBOT_ID)); } }
public void testStoreCanStoreData() throws Exception { String testData = "some file data"; AttachmentId id = new AttachmentId("", "id_1"); AttachmentStore store = makeStoreWithData(id, testData); AttachmentData data = store.getAttachment(id); assertEquals(testData, dataToString(data)); }
public final void testGetMissingAccountReturnsNull() throws Exception { AccountStore accountStore = newAccountStore(); assertNull(accountStore.getAccount(HUMAN_ID)); }
protected AttachmentStore makeStoreWithData(AttachmentId id, String data) throws Exception { AttachmentStore store = newAttachmentStore(); writeStringDataToAttachmentStore(store, id, data); return store; }
public final void testPutAccountCanChangeType() throws Exception { AccountStore accountStore = newAccountStore(); accountStore.putAccount(robotAccount); AccountData account = accountStore.getAccount(ROBOT_ID); assertEquals(robotAccount, account); accountStore.putAccount(convertedRobot); AccountData updatedAccount = accountStore.getAccount(ROBOT_ID); assertEquals(convertedRobot, updatedAccount); }
public final void testPutAccountOverrides() throws Exception { AccountStore accountStore = newAccountStore(); accountStore.putAccount(robotAccount); AccountData account = accountStore.getAccount(ROBOT_ID); assertEquals(robotAccount, account); accountStore.putAccount(updatedRobotAccount); AccountData updatedAccount = accountStore.getAccount(ROBOT_ID); assertEquals(updatedRobotAccount, updatedAccount); }
public final void testRoundtripRobotAccount() throws Exception { AccountStore accountStore = newAccountStore(); accountStore.putAccount(robotAccount); AccountData retrievedAccount = accountStore.getAccount(ROBOT_ID); assertEquals(robotAccount, retrievedAccount); }
public final void testPutAccountCanChangeType() throws Exception { AccountStore accountStore = newAccountStore(); accountStore.putAccount(robotAccount); AccountData account = accountStore.getAccount(ROBOT_ID); assertEquals(robotAccount, account); accountStore.putAccount(convertedRobot); AccountData updatedAccount = accountStore.getAccount(ROBOT_ID); assertEquals(convertedRobot, updatedAccount); }
public final void testRoundtripHumanAccount() throws Exception { AccountStore accountStore = newAccountStore(); HumanAccountDataImpl account = new HumanAccountDataImpl(HUMAN_ID); accountStore.putAccount(account); AccountData retrievedAccount = accountStore.getAccount(HUMAN_ID); assertEquals(account, retrievedAccount); }
public final void testRoundtripHumanAccount() throws Exception { AccountStore accountStore = newAccountStore(); HumanAccountDataImpl account = new HumanAccountDataImpl(HUMAN_ID); accountStore.putAccount(account); AccountData retrievedAccount = accountStore.getAccount(HUMAN_ID); assertEquals(account, retrievedAccount); }