Hello,

I was writing unit test for a DAO function where I have the sorting applied 
in data while pulling it from DB.

I have added the mock data randomly(no sorting) in the .txt file and when I 
ran the unit test, it seems like the result is however I have put the mock 
data in the file not sorted way. 

Is that the expected behavior ?

I was in an impression that Mock data is basically data stored in DB not 
the DB returned by the query. But it seems like the mock data is the 
returned data by the query. It does not apply sorting.

Example: Following is my mock data and data returned in the same way its 
there in the mock file not applying sorting for the title column.
#testGetEduContentsByContentIdsSortByTitle
select `content_management`.`edu_content`.`id`, 
`content_management`.`edu_content`.`title`, 
`content_management`.`edu_content`.`description`, 
`content_management`.`edu_content`.`media_type`, 
`content_management`.`edu_content`.`edu_document_type`, 
`content_management`.`edu_content`.`content_status`, 
`content_management`.`edu_content`.`custom_document_type`, 
`content_management`.`edu_content`.`original_file_s3_url`, 
`content_management`.`edu_content`.`preview_file_s3_url`, 
`content_management`.`edu_content`.`thumbnail_file_s3_url`, 
`content_management`.`edu_content`.`created_ts`, 
`content_management`.`edu_content`.`updated_ts`, 
`content_management`.`edu_content`.`exam_name`, 
`content_management`.`edu_content`.`year`, 
`content_management`.`edu_content`.`term`, 
`content_management`.`edu_content`.`comment`, 
`content_management`.`edu_content`.`deleted`, 
`content_management`.`edu_content`.`num_pages` from 
`content_management`.`edu_content` where 
`content_management`.`edu_content`.`id` in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 
?, ?, ?, ?) order by `content_management`.`edu_content`.`updated_ts` desc 
limit ?;
> id title description media_type edu_document_type content_status 
custom_document_type original_file_s3_url preview_file_s3_url 
thumbnail_file_s3_url created_ts updated_ts exam_name year term comment 
deleted num_pages
> ------------------------------------- ----------- ------------- 
----------------- -------------------- ------------------------- 
---------------------- ----------------------- ----------------------- 
------------------------- ---------------------- --------------------- 
----------- ------- -------- ------- ---------- -----------
> a32ba478-90d9-4c7c-85e9-2899bddab41f Zunit test test application/pdf 
SYLLABUS SYLLABUS_REQUIRED null original/unittest.pdf preview/unittest.pdf 
thumbnail/unittest.pdf 2021-04-16 11:27:46 2021-04-21 11:27:46 midterm 2021 
summer test false 1
> b32ba478-90d9-4c7c-85e9-2899bddab41e Nunit test test application/pdf 
SYLLABUS SYLLABUS_REQUIRED null original/unittest.pdf preview/unittest.pdf 
thumbnail/unittest.pdf 2021-04-06 11:27:46 2021-04-27 11:27:46 midterm 2021 
summer test false 1
> c32ba478-90d9-4c7c-85e9-2899bddab41f Funit test test application/pdf QUIZ 
PENDING_VERIFICATION null original/unittest.pdf preview/unittest.pdf 
thumbnail/unittest.pdf 2021-04-26 11:27:46 2021-04-10 11:27:46 midterm 2021 
summer test false 1

Thanks,
Deba

-- 
You received this message because you are subscribed to the Google Groups "jOOQ 
User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jooq-user+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jooq-user/a7238fca-ee95-4b05-b46f-2a4dd1c35313n%40googlegroups.com.

Reply via email to