diff --git a/src/main/java/jewellery/inventory/service/ProductInOrganizationService.java b/src/main/java/jewellery/inventory/service/ProductInOrganizationService.java index 70f2839a..db037fb6 100644 --- a/src/main/java/jewellery/inventory/service/ProductInOrganizationService.java +++ b/src/main/java/jewellery/inventory/service/ProductInOrganizationService.java @@ -271,7 +271,6 @@ private void throwExceptionIfOrganizationNotOwner(UUID organizationId, Product p private void moveQuantityFromResourcesInProductToResourcesInOrganization(Product product) { List resourcesInProduct = product.getResourcesContent(); - deleteAllResourcesInProduct(resourcesInProduct); resourcesInProduct.forEach( resourceInProduct -> { logger.info( @@ -290,9 +289,6 @@ private void moveQuantityFromResourcesInProductToResourcesInOrganization(Product }); product.setResourcesContent(null); } - private void deleteAllResourcesInProduct(List resources){ - resources.forEach(resourceInProductRepository::delete); - } @Override public Object fetchEntity(Object... ids) { diff --git a/src/test/java/jewellery/inventory/unit/service/ProductInOrganizationServiceTest.java b/src/test/java/jewellery/inventory/unit/service/ProductInOrganizationServiceTest.java index 00a61a50..21379ed2 100644 --- a/src/test/java/jewellery/inventory/unit/service/ProductInOrganizationServiceTest.java +++ b/src/test/java/jewellery/inventory/unit/service/ProductInOrganizationServiceTest.java @@ -55,7 +55,6 @@ class ProductInOrganizationServiceTest { @BeforeEach void setUp() { - User user = UserTestHelper.createSecondTestUser(); organization = OrganizationTestHelper.getTestOrganization(); Resource resource = ResourceTestHelper.getPearl();