@Test public void testChangeText(){ String foo = "foo"; String bar = "bar"; long id = createNews("a", foo, "Norway"); assertEquals(foo, crud.findById(id).get().getText()); crud.changeText(id, bar); assertEquals(bar, crud.findById(id).get().getText()); }
@Override public boolean changeText(long newsId, String text) { NewsEntity news = em.find(NewsEntity.class, newsId); if(news == null){ return false; } news.setText(text); return true; }
MyCustomMethodsImpl implements MyCustomMethods { @Override public boolean changeText(long newsId, String text) { NewsEntity news = em.find(NewsEntity.class, newsId); if(news == null){ return false; } news.setText(text); return true; } }
MyCustomMethodsImpl implements MyCustomMethods { @Override public boolean changeText(long newsId, String text) { NewsEntity news = em.find(NewsEntity.class, newsId); if(news == null){ return false; } news.setText(text); return true; }  }
MyCustomMethodsImpl implements MyCustomMethods { @Override public boolean changeText(long newsId, String text) { NewsEntity news = em.find(NewsEntity.class, newsId); if(news == null){ return false; } news.setText(text); return true; }  @Override boolean changeText(long newsId, String text); }
MyCustomMethodsImpl implements MyCustomMethods { @Override public boolean changeText(long newsId, String text) { NewsEntity news = em.find(NewsEntity.class, newsId); if(news == null){ return false; } news.setText(text); return true; }  @Override boolean changeText(long newsId, String text);  }