@Test @UsingDataSet(locations = "singleDashboard.json", loadStrategy = LoadStrategyEnum.CLEAN_INSERT) public void testLoad() throws Exception { final String exampleDashboardId = "54e3deadbeefdeadbeefaffe"; final Dashboard dashboard = dashboardService.load(exampleDashboardId); assertNotNull("Dashboard should have been found", dashboard); assertEquals( "Dashboard id should be the one that was retrieved", exampleDashboardId, dashboard.getId()); }
@Test @UsingDataSet(loadStrategy = LoadStrategyEnum.DELETE_ALL) public void testCreate() throws Exception { final String title = "Dashboard Title"; final String description = "This is the dashboard description"; final String creatorUserId = "foobar"; final DateTime createdAt = Tools.nowUTC(); final Dashboard dashboard = dashboardService.create(title, description, creatorUserId, createdAt); assertNotNull(dashboard); assertEquals(title, dashboard.getTitle()); assertEquals(description, dashboard.getDescription()); assertNotNull(dashboard.getId()); assertEquals(0, dashboardService.count()); }