Skip to content

Commit

Permalink
ID: FPCO-24112; Update arguments of updated getProducts method
Browse files Browse the repository at this point in the history
  • Loading branch information
ManishPrajapati-GoFynd committed Oct 9, 2024
1 parent e761e35 commit 0c23257
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public class PlatformController extends BasePlatformController {
public CatalogPlatformModels.ProductListingResponseV2 getProducts(HttpServletRequest request) {
try {
PlatformClient platformClient = (PlatformClient) request.getAttribute("platformClient");
return platformClient.catalog.getProducts(Collections.emptyList(), Collections.emptyList(), Collections.emptyList(), Collections.emptyList(), Collections.emptyList(), "", Collections.emptyList(), 1, 10);
return platformClient.catalog.getProducts(Collections.emptyList(), Collections.emptyList(), Collections.emptyList(), Collections.emptyList(), Collections.emptyList(), "", "",Collections.emptyList(), "", Collections.emptyList(),1, 10, "", "", "");

} catch (Exception e) {
System.out.println(e.getMessage());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,15 @@ void testGetAppProducts_Exception() throws FDKServerResponseError, FDKException
@Test
void testGetProducts_Success() throws Exception {
CatalogPlatformModels.ProductListingResponseV2 mockResponse = new CatalogPlatformModels.ProductListingResponseV2();
when(catalogPlatformService.getProducts(anyList(), anyList(), anyList(), anyList(), anyList(), anyString(), anyList(), anyInt(), anyInt()))
when(catalogPlatformService.getProducts(anyList(), anyList(), anyList(), anyList(), anyList(), anyString(), anyString(), anyList(), anyString(), anyList(), anyInt(), anyInt(), anyString(), anyString(), anyString()))
.thenReturn(mockResponse);
CatalogPlatformModels.ProductListingResponseV2 response = platformController.getProducts(request);
assertEquals(mockResponse, response);
}

@Test
void testGetProducts_Exception() throws FDKServerResponseError, FDKException {
when(catalogPlatformService.getProducts(anyList(), anyList(), anyList(), anyList(), anyList(), anyString(), anyList(), anyInt(), anyInt()))
when(catalogPlatformService.getProducts(anyList(), anyList(), anyList(), anyList(), anyList(), anyString(), anyString(), anyList(), anyString(), anyList(), anyInt(), anyInt(), anyString(), anyString(), anyString()))
.thenThrow(new RuntimeException("Error"));
RuntimeException exception = assertThrows(RuntimeException.class, () -> {
platformController.getProducts(request);
Expand Down

0 comments on commit 0c23257

Please sign in to comment.