title: Junit test for List<map<String, Object>> how to perform it
body: <p>How to perform testing for it, Trying but bot getting<br />
  for reference adding code,<br />
  please help....</p>
  <p>In Controller</p>
  <pre><code>@GET
  @Path(&quot;/vitals/{id}&quot;)
  @Produces(MediaType.APPLICATION_JSON)
  public Response getVitalsById(@PathParam(value = &quot;id&quot;)long id) {
      Response response;
      response =  Response.ok().entity(iAppointmentService.getVitals(id)).build();
      if(iAppointmentService.getVitals(id).isEmpty())
      {
          response = Response.ok().entity(&quot;Data Not Found For Entered Appointment Id&quot;).build();
      }
      return response;
  }
  </code></pre>
  <p>In Repo</p>
  <pre><code>@Override
  public List&lt;Map&lt;String, Object&gt;&gt; getVitals(long a_Id) { 
      List&lt;Map&lt;String, Object&gt;&gt; repos = null;
      repos = jdbcTemplate.queryForList(vitals + a_Id + &quot;;&quot;);
      return repos;
  }
  </code></pre>
  <p>For Testing in other package</p>
  <p>@WebMvcTest
  public class AppointmentServiceTest {</p>
  <pre><code>@Autowired
  private MockMvc mockMvc;
  
  @MockBean
  private IAppointmentService ias;
  
  @Test
  public void testGetVitals() throws Exception
  {
      UUID sid = UUID.fromString(&quot;79b804ed-765b-44ed-8e55-59b200aa536a&quot;);
      List&lt;Map&lt;String, Object&gt;&gt; expected = new ArrayList&lt;Map&lt;String,Object&gt;&gt;(); 
      Map&lt;String, Object&gt; safe_1 = new HashMap&lt;String, Object&gt;() ;
      safe_1.put(&quot;vital_id&quot;,801);
      safe_1.put(&quot;ecg&quot;,79);
      safe_1.put(&quot;temperature&quot;,37.3);
      safe_1.put(&quot;diabetes&quot;,159);
      safe_1.put(&quot;prescription_rate&quot;,14);
      safe_1.put(&quot;appointment_id&quot;,110);
      expected.add(safe_1);
      List&lt;Map&lt;String, Object&gt;&gt; actual = new ArrayList&lt;&gt;();
      Map&lt;String, Object&gt; safe_2 = new HashMap&lt;&gt;();
      safe_2.put(&quot;vital_id&quot;,801);
      safe_2.put(&quot;ecg&quot;,79);
      safe_2.put(&quot;temperature&quot;,37.3);
      safe_2.put(&quot;diabetes&quot;,159);
      safe_2.put(&quot;prescription_rate&quot;,14);
      safe_2.put(&quot;appointment_id&quot;,110);
      actual.add(safe_2);
      //when(ias.getVitals(ArgumentMatchers.any())).thenReturn(actual);
      mockMvc.perform(get(&quot;/appointments/vitals/102&quot;))
      .andExpect(status().isOk())
      .andExpect(jsonPath(&quot;$[0].vital_id&quot;, is(801)))
      .andExpect(jsonPath(&quot;$[1].ecg&quot;, is(79)))
      .andExpect(jsonPath(&quot;$[2].temperature&quot;, is(37.3)))
      .andExpect(jsonPath(&quot;$[3].diabetes&quot;, is(159)))
      .andExpect(jsonPath(&quot;$[4].prescription_rate&quot;, is(14)))
      .andExpect(jsonPath(&quot;$[5].appointment_id&quot;, is(110)));
  
  }
  </code></pre>
  <p>}</p>
  <p>i have 0 idea what to do in this testing class please help...</p>