### Question:
DatabaseInitializingServiceImpl implements InitializingService { @Override public void initTestSuite() { try { testSuite.setDbPrimaryKey(daoTestSuite.insertInitialTestSuiteData()); } catch (Exception e) { exceptionHandler.handleException(new SakuliForwarderCheckedException(e, "error at database initialization!"), true); } }  @Override int getServicePriority(); @Override void initTestSuite();  }### Answer:
@Test public void testInitTestSuiteInDatabase() throws Exception { int dbKey = 11; when(daoTestSuite.insertInitialTestSuiteData()).thenReturn(dbKey); testling.initTestSuite(); verify(testSuite).setDbPrimaryKey(eq(dbKey)); }
@Test public void testSaveResultsInDatabaseHandleException() throws Exception { doThrow(DataAccessResourceFailureException.class).when(daoTestSuite).insertInitialTestSuiteData(); testling.initTestSuite(); verify(exceptionHandler).handleException(any(SakuliForwarderCheckedException.class), anyBoolean()); }