Intermediate extends MetadataAPIBase { public void keyValue(List<IntermediateInfo> intermediateInfos) { try { for (IntermediateInfo intermediateInfo : intermediateInfos) { com.wipro.ats.bdre.md.dao.jpa.Intermediate intermediate = new com.wipro.ats.bdre.md.dao.jpa.Intermediate(); IntermediateId intermediateId = new IntermediateId(); intermediateId.setInterKey(intermediateInfo.getKey()); intermediateId.setUuid(intermediateInfo.getUuid()); intermediate.setId(intermediateId); intermediate.setInterValue(intermediateInfo.getValue()); intermediateDAO.insert(intermediate); } } catch (Exception e) { LOGGER.error("Error occurred", e); throw new MetadataException(e); } } Intermediate(); @Override IntermediateInfo execute(String[] params); void keyValue(List<IntermediateInfo> intermediateInfos);  }
@Ignore @Test public void testKeyValue() throws Exception { com.wipro.ats.bdre.md.api.Intermediate intermediate = new com.wipro.ats.bdre.md.api.Intermediate(); List<IntermediateInfo> intermediateInfos = new ArrayList<IntermediateInfo>(); for (int i = 0; i < 5; i++) { IntermediateInfo intermediateInfo = new IntermediateInfo(); intermediateInfo.setUuid("testing the log " + i); intermediateInfo.setKey("key for " + i); intermediateInfo.setValue("value for" + i); intermediateInfos.add(i, intermediateInfo); } LOGGER.debug("0 " + intermediateInfos.get(0).getKey() + "1 is " + intermediateInfos.get(2).getKey() + "2 is " + intermediateInfos.get(4).getKey()); intermediate.keyValue(intermediateInfos); }