Untitled

mail@pastecode.io avatar
unknown
java
2 months ago
913 B
1
Indexable
Never
@Test
    public void testProductwiseBrandSchemes_Success() {
        // Mock data
        int providerId = 1;
        int offset = 0;
        int size = 10;

        List<BrandScheme> brandSchemeList = new ArrayList<>(); // Populate with test data
        // Populate other necessary mock data

        when(brandSchemeRepository.findByStatusAndSellerIdAndOrderByStartValueAndDiscountIsZero(any(), any()))
                .thenReturn(brandSchemeList);

        when(skuDiscountRepository.findDiscountsAndSubProducts(any(), any(Pageable.class)))
                .thenReturn(mock(Page.class));

        // Execute the function
        ResponseEntity<MinistoreResponse> responseEntity = brandSchemeService.productwiseBrandSchemes(providerId, offset, size);

        // Assertions
        assertEquals(HttpStatus.OK, responseEntity.getStatusCode());
        // Add more assertions based on the expected results
    }
Leave a Comment