SyncUpManager { public void syncArchivedProducts() { final String facilityId = UserInfoMgr.getInstance().getUser().getFacilityId(); try { List<String> archivedProductCodes = productRepository.listArchivedProductCodes(); lmisRestApi.syncUpArchivedProducts(facilityId, archivedProductCodes); } catch (LMISException e) { new LMISException(e, "SyncUpManager.syncArchivedProducts").reportToFabric(); } } SyncUpManager(); boolean syncRnr(); boolean fakeSyncRnr(); boolean syncStockCards(); boolean fakeSyncStockCards(); void syncUpUnSyncedStockCardCodes(); void fakeSyncUpUnSyncedStockCardCodes(); void syncAppVersion(); void syncArchivedProducts(); void syncUpCmms(); void fakeSyncUpCmms(); boolean syncDeleteMovement(); void syncRapidTestForms(); void fakeSyncRapidTestForms();  }
@Test public void shouldSyncArchivedProducts() throws Exception { List<String> productCodes = new ArrayList<>(); syncUpManager.productRepository = mockedProductRepository; when(mockedProductRepository.listArchivedProductCodes()).thenReturn(productCodes); syncUpManager.syncArchivedProducts(); verify(mockedLmisRestApi).syncUpArchivedProducts(UserInfoMgr.getInstance().getUser().getFacilityId(), productCodes); }