title: Junit How to mock namedParameterJdbcTemplate.query(" ", parameters,(ResultSet rs))
body: <p>i am writing test cases for repository classes were i am not able to cover some of lines in repository classes. i need to achieve 85% of code coverage and its mandatory in my case,Please suggest me something </p>
  
  <p><strong>My actual method</strong></p>
  
  <pre><code>public Map&lt;String, String&gt; getProductFamily(List&lt;String&gt; itmNms) {
  
          Map&lt;String, String&gt; productFamilyMap=new HashMap&lt;String, String&gt;();
          try {
          NamedParameterJdbcTemplate namedParameterJdbcTemplate = new NamedParameterJdbcTemplate(jdbcTemplate);
          String sql = "some query";
          MapSqlParameterSource namedParameters = new MapSqlParameterSource();
          namedParameters.addValue("itmNms", itmNms);
          productFamilyMap = namedParameterJdbcTemplate.query(sql, namedParameters, (ResultSet rs) -&gt; {
              Map&lt;String, String&gt; productFamily = new HashMap&lt;&gt;();
              while (rs.next()) {
                  productFamily.put(rs.getString("ITEMNAME"), rs.getString("PRODUCTFAMILY"));
              }
              return productFamily;
          });
          }catch (Exception e) {
              LOGGER.error("Exception in OracleRespository.getProductFamily : {}", e);
          }
          return productFamilyMap;
      }
  </code></pre>
  
  <p><strong>Test case for above method</strong></p>
  
  <pre><code>@Test
      public void getProductFamily() {
  
      List&lt;String&gt; itmNms = new ArrayList&lt;String&gt;();
      itmNms.add("A-SPK-NAMED-USER");
      oracleRepo.getProductFamily(itmNms);
      Map&lt;String, String&gt; mp = new HashMap&lt;String, String&gt;();
      Assert.assertNull(mp);
  
  }
  </code></pre>
  
  <p>By writing above test cases i am able to cover code coverage till line no 6 below lines i am not able to cover due to below statements</p>
  
  <pre><code>productFamilyMap = namedParameterJdbcTemplate.query(sql, namedParameters, (ResultSet rs) -&gt;{}
  </code></pre>
  
  <p>Can some one suggest how can i achieve code coverage for above method as 100%.</p>