text: 
  const { set } = require('lodash');
  const Promise = require('bluebird');
  
  const queryMicroserviceQueueLogEntry = require('./queryMicroserviceQueueLogEntry');
  
  jest.mock('../../core/buildQuery')
  
  const buildQuery = require('../../core/buildQuery');
  
  describe("queryMicroserviceQueueLogEntry", () => {
      it("queryMicroserviceQueueLogEntry executes query", async () => {
          jest.clearAllMocks();
  
          let mockResult = [{
              id: "123"
          }];
  
          let mockAllow = jest.fn(() => true);
          let mockFields = jest.fn((fields) => fields);
          let mockFilter = jest.fn((filter) => filter);
  
          let ctx = {
              db: () => {},
              entities: {
                  microserviceQueueLogEntry: {
                      extensions: {
                          onSelect: {
                              allow: mockAllow,
                              filter: mockFilter,
                              fields: mockFields
                          }
                      }
                  }
              }
          };
  
          set(ctx, 'db.client.config.client', 'pg');
   
          buildQuery.mockImplementation(() => {
              return Promise.resolve(mockResult);
          });
  
          let result = await queryMicroserviceQueueLogEntry.call(ctx);
  
          expect(mockAllow).toHaveBeenCalled();
          expect(mockFields).toHaveBeenCalled();
          expect(mockFilter).toHaveBeenCalled();
          expect(result).toMatchObject(mockResult);
      });
  
      it("queryMicroserviceQueueLogEntry returns lastFetched", async () => {
          jest.clearAllMocks();
  
          let mockResult = [{
              id: "123"
          }];
          
          let mockLastFetched = new Date();
          
          let expectedResult = [{
              id: "123",
              lastFetched: mockLastFetched
          }];
  
          let mockAllow = jest.fn(() => true);
          let mockFields = jest.fn((fields) => fields);
          let mockFilter = jest.fn((filter) => filter);
          let mockGetCurrentTimestamp = jest.fn(() => Promise.resolve(mockLastFetched) );
  
          let ctx = {
              db: () => { },
              entities: {
                  microserviceQueueLogEntry: {
                      extensions: {
                          onSelect: {
                              allow: mockAllow,
                              filter: mockFilter,
                              fields: mockFields
                          }
                      }
                  }
              },
              getCurrentTimestamp: mockGetCurrentTimestamp
          };
  
          set(ctx, 'db.client.config.client', 'pg');
   
          buildQuery.mockImplementation(() => {
              return Promise.resolve(mockResult);
          });
  
          let result = await queryMicroserviceQueueLogEntry.call(ctx, ["lastFetched"]);
  
          expect(mockGetCurrentTimestamp).toHaveBeenCalled();
          expect(result).toMatchObject(expectedResult);
      });
  
      it("queryMicroserviceQueueLogEntry returns empty array if disallowed", async () => {
          let ctx = {
              db: () => ({ count: () => "qry" }),
              entities: {
                  microserviceQueueLogEntry: {
                      extensions: {
                          onSelect: {
                              allow: () => false
                          }
                      }
                  }
              }
          };
   
          let result = await queryMicroserviceQueueLogEntry.call(ctx);
  
          expect(result).toEqual([]);
      });
  
  
  
  })