shwstppr commented on code in PR #10773:
URL: https://github.com/apache/cloudstack/pull/10773#discussion_r2073010449


##########
server/src/main/java/com/cloud/server/ManagementServerImpl.java:
##########
@@ -2723,29 +2728,109 @@ public Pair<List<? extends GuestOS>, Integer> 
listGuestOSByCriteria(final ListGu
 
     @Override
     public Pair<List<? extends GuestOsCategory>, Integer> 
listGuestOSCategoriesByCriteria(final ListGuestOsCategoriesCmd cmd) {
-        final Filter searchFilter = new Filter(GuestOSCategoryVO.class, "id", 
true, cmd.getStartIndex(), cmd.getPageSizeVal());
+        final Filter searchFilter = new Filter(GuestOSCategoryVO.class, 
"sortKey", true,
+                cmd.getStartIndex(), cmd.getPageSizeVal());
+        searchFilter.addOrderBy(GuestOSCategoryVO.class, "id", true);
         final Long id = cmd.getId();
         final String name = cmd.getName();
         final String keyword = cmd.getKeyword();
+        final Boolean featured = cmd.isFeatured();
+        final Boolean isIso = cmd.isIso();
+        final Boolean isVnf = cmd.isVnf();
+        final Long zoneId = cmd.getZoneId();
+        final CPU.CPUArch arch = cmd.getArch();
 
-        final SearchCriteria<GuestOSCategoryVO> sc = 
_guestOSCategoryDao.createSearchCriteria();
-
+        final SearchBuilder<GuestOSCategoryVO> sb = 
_guestOSCategoryDao.createSearchBuilder();
+        sb.and("id", sb.entity().getId(), SearchCriteria.Op.EQ);
+        sb.and("name", sb.entity().getId(), SearchCriteria.Op.LIKE);
+        sb.and("keyword", sb.entity().getId(), SearchCriteria.Op.LIKE);

Review Comment:
   Done :man_facepalming: 



##########
server/src/test/java/com/cloud/server/ManagementServerImplTest.java:
##########
@@ -124,27 +139,27 @@ public class ManagementServerImplTest {
     UserDataManager userDataManager;
 
     @Spy
+    @InjectMocks
     ManagementServerImpl spy = new ManagementServerImpl();
 
     @Mock
     UserVmDetailsDao userVmDetailsDao;
 
     @Mock
     HostDetailsDao hostDetailsDao;
+
+    @Mock
+    GuestOSCategoryDao guestOSCategoryDao;
+
+    @Mock
+    GuestOSDao guestOSDao;

Review Comment:
   done



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to