@Test public void shouldReturnMalariaProducts() throws Exception { List<Product> expectedMalariaProducts = newArrayList(product6x1, product6x2, product6x3, product6x4); List<Product> malariaProducts = patientDataService.getMalariaProducts(); assertThat(malariaProducts.size(), is(expectedMalariaProducts.size())); for (Product expectedProduct : expectedMalariaProducts) { assertTrue(malariaProducts.contains(expectedProduct)); } }
public List<Product> getMalariaProducts() { List<Product> malariaProducts = new ArrayList<>(); try { malariaProducts.add(productRepository.getByCode(PRODUCT_6x1_CODE.getValue())); malariaProducts.add(productRepository.getByCode(PRODUCT_6x2_CODE.getValue())); malariaProducts.add(productRepository.getByCode(PRODUCT_6x3_CODE.getValue())); malariaProducts.add(productRepository.getByCode(PRODUCT_6x4_CODE.getValue())); } catch (LMISException e) { e.printStackTrace(); } return malariaProducts; }
PatientDataService { public List<Product> getMalariaProducts() { List<Product> malariaProducts = new ArrayList<>(); try { malariaProducts.add(productRepository.getByCode(PRODUCT_6x1_CODE.getValue())); malariaProducts.add(productRepository.getByCode(PRODUCT_6x2_CODE.getValue())); malariaProducts.add(productRepository.getByCode(PRODUCT_6x3_CODE.getValue())); malariaProducts.add(productRepository.getByCode(PRODUCT_6x4_CODE.getValue())); } catch (LMISException e) { e.printStackTrace(); } return malariaProducts; } }
PatientDataService { public List<Product> getMalariaProducts() { List<Product> malariaProducts = new ArrayList<>(); try { malariaProducts.add(productRepository.getByCode(PRODUCT_6x1_CODE.getValue())); malariaProducts.add(productRepository.getByCode(PRODUCT_6x2_CODE.getValue())); malariaProducts.add(productRepository.getByCode(PRODUCT_6x3_CODE.getValue())); malariaProducts.add(productRepository.getByCode(PRODUCT_6x4_CODE.getValue())); } catch (LMISException e) { e.printStackTrace(); } return malariaProducts; }  }
PatientDataService { public List<Product> getMalariaProducts() { List<Product> malariaProducts = new ArrayList<>(); try { malariaProducts.add(productRepository.getByCode(PRODUCT_6x1_CODE.getValue())); malariaProducts.add(productRepository.getByCode(PRODUCT_6x2_CODE.getValue())); malariaProducts.add(productRepository.getByCode(PRODUCT_6x3_CODE.getValue())); malariaProducts.add(productRepository.getByCode(PRODUCT_6x4_CODE.getValue())); } catch (LMISException e) { e.printStackTrace(); } return malariaProducts; }  List<Period> calculatePeriods(VIAReportType VIAReportType); List<StockCard> getMalariaProductsStockCards(); List<Long> getMalariaProductsStockHand(); Optional<MalariaProgram> save(MalariaProgram malariaProgram); MalariaProgram findForPeriod(DateTime beginDate, DateTime endDate); List<Product> getMalariaProducts(); }
PatientDataService { public List<Product> getMalariaProducts() { List<Product> malariaProducts = new ArrayList<>(); try { malariaProducts.add(productRepository.getByCode(PRODUCT_6x1_CODE.getValue())); malariaProducts.add(productRepository.getByCode(PRODUCT_6x2_CODE.getValue())); malariaProducts.add(productRepository.getByCode(PRODUCT_6x3_CODE.getValue())); malariaProducts.add(productRepository.getByCode(PRODUCT_6x4_CODE.getValue())); } catch (LMISException e) { e.printStackTrace(); } return malariaProducts; }  List<Period> calculatePeriods(VIAReportType VIAReportType); List<StockCard> getMalariaProductsStockCards(); List<Long> getMalariaProductsStockHand(); Optional<MalariaProgram> save(MalariaProgram malariaProgram); MalariaProgram findForPeriod(DateTime beginDate, DateTime endDate); List<Product> getMalariaProducts();  }