title: API Automation : Assertion is not working for google place api
body: <p>//Below mentioned code not working for assertion in google api</p>
  
  <pre><code>import io.restassured.RestAssured;
  import io.restassured.http.ContentType;
  import static io.restassured.RestAssured.given;
  import static org.hamcrest.Matchers.equalTo;
  public class Base {
  
  public static void main(String[] args) {
      //URL --&gt; End Point --&gt; BaseURL/Resources/Format?Parameters
      // BaseURL or Host
      RestAssured.baseURI = "https://maps.googleapis.com";
      given().
              param("location","33.8670522,151.1957362").
              param("radius","500").
              param("key","AIzaSyDahQkqdxmUihrC0_3Gi7hRBZQWDrV1xI0").
              when().
              get("/maps/api/place/nearbysearch/json").
              then().assertThat().statusCode(200).and().contentType(ContentType.JSON).and().
              body("results[0].geometry.location.lat", equalTo("-33.8710748"));            
  }
  }
  </code></pre>
  
  <p>Below error I am getting :
  java.lang.AssertionError: 1 expectation failed.
  JSON path results[0].geometry.location.lat doesn't match.
  Expected: -33.8710748
  Actual: null</p>
  
  <p>Also find the original response:</p>
  
  <p><a href="https://jsoneditoronline.org/?id=7f9b24fa65f044fa9c4f48500a6c9bbe" rel="nofollow noreferrer">https://jsoneditoronline.org/?id=7f9b24fa65f044fa9c4f48500a6c9bbe</a></p>