title: Writing junit test case for json data
body: <p>i have a method in my controller class</p>
  
  <pre><code>    @RequestMapping(value = "/getSearchData/{fdate}/{tdate}", method = RequestMethod.GET)
      public @ResponseBody List&lt;Map&lt;String, Object&gt;&gt; getSearchData(@PathVariable String fdate,
          @PathVariable String tdate) {
      System.out.println("fdate============" + fdate);
      System.out.println("tdate============" + tdate);
      String frdate = fdate.substring(2, 4) + "/" + fdate.substring(0, 2) + "/" + fdate.substring(4, 8);
  
      String todate = tdate.substring(2, 4) + "/" + tdate.substring(0, 2) + "/" + tdate.substring(4, 8);
      String json = null;
      List&lt;Object[]&gt; list = retrievePublicationService.getsearchData(frdate, todate);
  
      List&lt;Map&lt;String, Object&gt;&gt; activeTeamMap = new ArrayList&lt;Map&lt;String, Object&gt;&gt;();
  
      if (list != null) {
  
          for (Object[] obj : list) {
              Map&lt;String, Object&gt; dropDownData = new HashMap&lt;String, Object&gt;();
              dropDownData.put("publicationId", obj[0]);
              dropDownData.put("documentId", obj[1]);
              dropDownData.put("documentType", obj[2]);
              dropDownData.put("languageCode", obj[3]);
              dropDownData.put("processStartDate", obj[4]);
              dropDownData.put("publicationType", obj[5]);
              activeTeamMap.add(dropDownData);
              System.out.println("activeTeamMap==vbnbvn==" + activeTeamMap);
          }
  
      } else {
  
      }
  
      return activeTeamMap;
  }
  </code></pre>
  
  <p>I need to write a junit test case for this method. I am new to junit so I am not sure how to proceed with this one. Any kind of help will be appreciated. :(</p>