### Question:
MongoQueryUtil { public Map<String, Object> generateFieldMap(Object example) { return generateFieldMap(example, new ComplexFieldStack(PARAM_NAME_SEPARATOR), new GenerateStatementOptionBuilder().build(), new HashMap<>()); } MongoQueryUtil(MongoDBManager dbManager); Bson generateFilters(QueryByExample<T> queryRequest); String convertSQLLikeCharacterToRegex(String value); Bson generateSortFilter(QueryByExample<T> queryRequest); Bson generateGroupByFilter(QueryByExample<T> queryRequest); Bson generateUpdateSet(Object example); Map<String, Object> generateFieldMap(Object example); Map<String, Object> generateFieldMap(T example, ComplexFieldStack complexFieldStack, GenerateStatementOption generateStatementOption, Map<String, GenerateStatementOption> fieldOptions); Bson componentRestrictionFilter(UserContext userContext); Bson standardRestrictionFilter(UserContext userContext); Bson constructPKFilter(T entity); Bson constructPKFilter(Class<T> entity, Object id); MongoCollection<T> getCollectionForEntity(T entity); @SuppressWarnings("unchecked") MongoCollection<T> getCollectionForEntity(Class entityClass); static final int MONGO_SORT_ASCENDING; static final int MONGO_SORT_DESCENDING; }### Answer:
@Test public void checkMediaFileQuery() { MediaFile example = new MediaFile(); example.setFileName("Test.txt"); example.setFileType(MediaFileType.GENERAL); MongoQueryUtil mongoQueryUtil = new MongoQueryUtil(null); Map<String, Object> parameters = mongoQueryUtil.generateFieldMap(example); Assert.assertEquals("GENERAL", parameters.get("fileType")); }