DBService extends BasicService { @GET @Path("/screens") @Produces(MediaType.APPLICATION_JSON) public List<Screen> getScreens() { if (!isDBAdmin()) { throwUnauthorized(); } return new ScreenDAO().getAll("name"); }  @GET @Path("/users") @Produces(MediaType.APPLICATION_JSON) List<User> getUsers(); @GET @Path("/pages") @Produces(MediaType.APPLICATION_JSON) List<Page> getPages(); @GET @Path("/files") @Produces(MediaType.APPLICATION_JSON) List<File> getFiles(); @GET @Path("/playlists") @Produces(MediaType.APPLICATION_JSON) List<Playlist> getPlaylists(); @GET @Path("/screens") @Produces(MediaType.APPLICATION_JSON) List<Screen> getScreens(); @GET @Path("/owners") @Produces(MediaType.APPLICATION_JSON) List<Owner> getOwners(); @GET @Path("/pagereferences") @Produces(MediaType.APPLICATION_JSON) List<PageReference> getPageReferences();  }
@Test public void testGetScreens() throws Exception { doReturn(true).when(dbService).isDBAdmin(); assertEquals(0, dbService.getScreens().size()); screenService.createScreen(new Screen("s1")); assertEquals(1, dbService.getScreens().size()); }