I was trying to Automate Rest APIs with Rest Assured framework and as part of this selected google place search API and tried to run. But, seeing error
I have tried adding the certificate from command prompt to the cacerts file but didn't work out
public class Rest {
public static void main(String[] args) {
// TODO Auto-generated method stub
RestAssured.baseURI= "https://maps.googleapis.com";
given().
param("input","Museum%20of%20Contemporary%20Art%20Australia").
param("inputtype","textquery").
param("fields","photos,formatted_address,name,rating,opening_hours,geometry").
param("key", "AIzaSfyDyn2l_QUZz7RT5MseFIrItuCdBR3drpaJU ").
when().
get("/maps/api/place/findplacefromtext/xml").
then().assertThat().statusCode(200);
}
}
Expected that script should run
Actual - Exception in thread "main" javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target