@Test public void shouldGetAll() throws Exception { Product product = new Product(); Facility facility = new Facility(10L); product.setId(20L); OrderQuantityAdjustmentProduct adjustmentProduct = new OrderQuantityAdjustmentProduct(); adjustmentProduct.setAdjustmentFactor(new OrderQuantityAdjustmentFactor("adj-factor","adj-factor",1,true)); adjustmentProduct.setAdjustmentType(new OrderQuantityAdjustmentType("adj-type","adj-type",1)); adjustmentProduct.setFacility(facility); adjustmentProduct.setProduct(product); adjustmentProduct.setMinMOS(5L); adjustmentProduct.setMaxMOS(15L); List<OrderQuantityAdjustmentProduct> adjustmentProductList = new ArrayList<>(1); adjustmentProductList.add(adjustmentProduct); when(adjustmentProductRepository.getAll()).thenReturn(adjustmentProductList); List<OrderQuantityAdjustmentProduct> fetchedAdjustment = adjustmentProductRepository.getAll(); verify(adjustmentProductRepository).getAll(); assertThat(fetchedAdjustment, is(adjustmentProductList)); }
public List<OrderQuantityAdjustmentProduct> getAll() { return this.repository.getAll(); }
OrderQuantityAdjustmentProductService { public List<OrderQuantityAdjustmentProduct> getAll() { return this.repository.getAll(); } }
OrderQuantityAdjustmentProductService { public List<OrderQuantityAdjustmentProduct> getAll() { return this.repository.getAll(); }  }
OrderQuantityAdjustmentProductService { public List<OrderQuantityAdjustmentProduct> getAll() { return this.repository.getAll(); }  List<OrderQuantityAdjustmentProduct> getAll(); @Transactional void save(OrderQuantityAdjustmentProduct adjustmentProduct); OrderQuantityAdjustmentProduct getByProductAndFacility(Long productId, Long facilityId); }
OrderQuantityAdjustmentProductService { public List<OrderQuantityAdjustmentProduct> getAll() { return this.repository.getAll(); }  List<OrderQuantityAdjustmentProduct> getAll(); @Transactional void save(OrderQuantityAdjustmentProduct adjustmentProduct); OrderQuantityAdjustmentProduct getByProductAndFacility(Long productId, Long facilityId);  }