package com.abc.tests; import com.abc.entities.Dept; import com.abc.exceptions.AppException; import com.abc.service.DeptService; import com.abc.util.SpringUtil; public class DeptTest{ static DeptService service = (DeptService) SpringUtil.getBean("deptService"); static void createTest(){ try { Dept dept = service.registerDept("BFS", "OXIDE", "FIXED", "2008-12-01"); System.out.println(dept.toString()); } catch (AppException e) { System.out.println(e.getMessage()); } } static void getTest(){ Dept dept; try { dept = service.getDept("BFS", "CAIN"); //dept = service.getDeptWithEmployees("BFS", "CAIN"); System.out.println(dept.toString()); } catch (AppException e) { System.out.println(e.getMessage()); } } static void updateTest(){ try { service.updateProjectDetails("BFS", "OXIDE", "FIXED"); } catch (AppException e) { System.out.println(e.getMessage()); } } static void deleteTest(){ try { service.removeProject("BFS", "CAIN"); } catch (AppException e) { System.out.println(e.getMessage()); } } public static void main(String[] args) { getTest(); } }