title: How to mock aggregate function result with JOOQ?
body: <p>I call the count aggregate function in my service class using JOOQ.  </p>
  
  <pre><code>SelectQuery&lt;Record&gt; query = this.dsl.selectQuery();
  query.addSelect(DSL.count());
  query.addFrom(SOME_TABLE);
  final Integer total = query.fetchOne(0, Integer.class);
  </code></pre>
  
  <p>I need to mock count result in my unit test.
  What is the best way to do that?</p>
  
  <p>Following <a href="https://www.jooq.org/doc/3.5/manual/tools/jdbc-mocking/#N2B72F" rel="nofollow noreferrer">jooq documentation</a>, I have to create result record with relevant fields count. 
  Something like that:</p>
  
  <pre><code>Result&lt;Record1&lt;Integer&gt;&gt; result = create.newResult(...);
  </code></pre>
  
  <p>But what I have to use as the <code>create.newResult()</code> method parameters in case of creating the mock record for aggregate function? </p>