@Test public void findTestByUserId() { setUpUserToProducts(); String xmlStr = userToProductClient.find("Braffa", " ", " "); List<UserToProductXml> lOfUserToProductXml = getLOfUserToProductMsgXml(xmlStr); assertEquals("userId should be ", 5, lOfUserToProductXml.size()); UserToProductXml UserToProductXml = lOfUserToProductXml.get(0); System.out.println(UserToProductXml.toString()); }
@Test public void findTest() { setUpUserToProducts(); String xmlStr = userToProductClient.find("Braffa", "978098056856", "0"); List<UserToProductXml> lOfUserToProductXml = getLOfUserToProductMsgXml(xmlStr); assertEquals("One row should be returned ", 1, lOfUserToProductXml.size()); UserToProductXml UserToProductXml = lOfUserToProductXml.get(0); System.out.println(UserToProductXml.toString()); assertEquals("index should be 5 ", 5, UserToProductXml.getId()); assertEquals("userId should be ", "Braffa", UserToProductXml.getUserId()); assertEquals("productId should be ", "978098056856", UserToProductXml.getProductId()); assertEquals("productIndex should be ", "0", UserToProductXml.getProductIndex()); }
@Test public void findTestByProductId() { setUpUserToProducts(); String xmlStr = userToProductClient.find(" ", "9780789724410", " "); List<UserToProductXml> lOfUserToProductXml = getLOfUserToProductMsgXml(xmlStr); assertEquals("One row should be returned ", 2, lOfUserToProductXml.size()); UserToProductXml UserToProductXml = lOfUserToProductXml.get(0); System.out.println(UserToProductXml.toString()); assertEquals("index should be 2 ", 2, UserToProductXml.getId()); assertEquals("userId should be ", "georgie", UserToProductXml.getUserId()); assertEquals("productId should be ", "9780789724410", UserToProductXml.getProductId()); assertEquals("productIndex should be ", "0", UserToProductXml.getProductIndex()); UserToProductXml = lOfUserToProductXml.get(1); System.out.println(UserToProductXml.toString()); assertEquals("index should be 3 ", 3, UserToProductXml.getId()); assertEquals("userId should be ", "Braffa", UserToProductXml.getUserId()); assertEquals("productId should be ", "9780789724410", UserToProductXml.getProductId()); assertEquals("productIndex should be ", "0", UserToProductXml.getProductIndex()); }