@Test public void testGetEdtaCodesByLinkType() throws Exception { String linkType1 = "linkType1"; String linkType2 = "linkType2"; EdtaCode edtaCode1 = getTestObject("1", linkType1); edtaCodeDao.save(edtaCode1); assertTrue("Edtacode1 did not save", edtaCode1.getId() > 0); EdtaCode edtaCode2 = getTestObject("2", linkType1); edtaCodeDao.save(edtaCode2); assertTrue("Edtacode2 did not save", edtaCode2.getId() > 0); // create one with another link type to make sure it doesnt come back EdtaCode edtaCode3 = getTestObject("3", linkType2); edtaCodeDao.save(edtaCode3); assertTrue("Edtacode3 did not save", edtaCode3.getId() > 0); // now pull them back for linktype1 we should get 2 List<EdtaCode> checkEdtaCodes = edtaCodeDao.get(linkType1, specialty); assertNotNull(checkEdtaCodes); assertTrue("No edta codes found", !checkEdtaCodes.isEmpty() && checkEdtaCodes.size() > 0); assertTrue("To many codes found", checkEdtaCodes.size() == 2); // they should come out in order of edtacode so 1 should be first then 2 assertEquals("EdtaCode1 was not first", checkEdtaCodes.get(0).getId(), edtaCode1.getId()); assertEquals("EdtaCode2 was not second", checkEdtaCodes.get(1).getId(), edtaCode2.getId()); }