コード例 #1
0
  @Test
  public void shouldParseAllLocationsByName() throws HttpException, IOException {
    List<MRSFacility> expected = buildExpectedFacilityList();

    String json = TestUtils.parseJsonFileAsString("json/location-list-response.json");
    when(client.getJson(any(URI.class))).thenReturn(json);

    List<MRSFacility> mrsFacilities = impl.getFacilities("Test");

    assertEquals(expected, mrsFacilities);
  }
コード例 #2
0
  @Test
  public void shouldParseSingleLocation() throws IOException, HttpException {
    MRSFacility expected = makeFacility(true);

    String json = TestUtils.parseJsonFileAsString("json/location-response.json");

    when(client.getJson(null)).thenReturn(json);

    MRSFacility result = impl.getFacility("Test");

    assertEquals(expected, result);
  }