@Test public void testAddApplication() { /* Adding dummy application to the application store */ String testAppIdentifier = "test sample1"; try { DeviceManagementDAOFactory.openConnection(); applicationDAO.addApplication( TestDataHolder.generateApplicationDummyData(testAppIdentifier), -1234); } catch (DeviceManagementDAOException | SQLException e) { log.error("Error occurred while adding application test sample1", e); } finally { DeviceManagementDAOFactory.closeConnection(); } /* Retrieving the application by its name */ Application target = null; try { target = this.getApplication(testAppIdentifier, -1234); } catch (DeviceManagementDAOException e) { String msg = "Error occurred while retrieving application info"; log.error(msg, e); Assert.fail(msg, e); } Assert.assertEquals( target.getApplicationIdentifier(), testAppIdentifier, "Application added is not as same as " + "what's " + "retrieved"); }