@Test(expected=UnstorableObjectException.class) public void test_storeModifiedApp_failed() throws UnstorableObjectException { IRegisteredApp app2 = new RegisteredApp(); app2.setName("New App 2"); dbClientToTest.storeModifiedApp(app2); }
@Override public void storeModifiedApp(IRegisteredApp app) throws UnstorableObjectException { if (app.getId() == null) { throw new UnstorableObjectException("App does not have an id."); } IRegisteredApp storedApp = getAppById(app.getId()); storedApp.setName(app.getName()); storedApp.setTokenIds(app.getTokenIds()); store(storedApp); }
RegisteredAppDatabaseClient extends DatabaseClient<IRegisteredApp> implements IRegisteredAppDatabaseClient { @Override public void storeModifiedApp(IRegisteredApp app) throws UnstorableObjectException { if (app.getId() == null) { throw new UnstorableObjectException("App does not have an id."); } IRegisteredApp storedApp = getAppById(app.getId()); storedApp.setName(app.getName()); storedApp.setTokenIds(app.getTokenIds()); store(storedApp); } }
RegisteredAppDatabaseClient extends DatabaseClient<IRegisteredApp> implements IRegisteredAppDatabaseClient { @Override public void storeModifiedApp(IRegisteredApp app) throws UnstorableObjectException { if (app.getId() == null) { throw new UnstorableObjectException("App does not have an id."); } IRegisteredApp storedApp = getAppById(app.getId()); storedApp.setName(app.getName()); storedApp.setTokenIds(app.getTokenIds()); store(storedApp); }  }
RegisteredAppDatabaseClient extends DatabaseClient<IRegisteredApp> implements IRegisteredAppDatabaseClient { @Override public void storeModifiedApp(IRegisteredApp app) throws UnstorableObjectException { if (app.getId() == null) { throw new UnstorableObjectException("App does not have an id."); } IRegisteredApp storedApp = getAppById(app.getId()); storedApp.setName(app.getName()); storedApp.setTokenIds(app.getTokenIds()); store(storedApp); }  @Override IRegisteredApp getAppById(String id); @Override void storeModifiedApp(IRegisteredApp app); @Override IRegisteredApp[] getAllRegisteredApps(); }
RegisteredAppDatabaseClient extends DatabaseClient<IRegisteredApp> implements IRegisteredAppDatabaseClient { @Override public void storeModifiedApp(IRegisteredApp app) throws UnstorableObjectException { if (app.getId() == null) { throw new UnstorableObjectException("App does not have an id."); } IRegisteredApp storedApp = getAppById(app.getId()); storedApp.setName(app.getName()); storedApp.setTokenIds(app.getTokenIds()); store(storedApp); }  @Override IRegisteredApp getAppById(String id); @Override void storeModifiedApp(IRegisteredApp app); @Override IRegisteredApp[] getAllRegisteredApps();  }