Fix for Penetration test _ Session and cookie management
[vid.git] / vid-automation / src / test / java / org / onap / vid / api / VersionControllerApiTest.java
1 package org.onap.vid.api;
2
3 import java.util.HashMap;
4 import org.junit.Assert;
5 import org.springframework.core.ParameterizedTypeReference;
6 import org.springframework.http.ResponseEntity;
7 import org.testng.annotations.Test;
8 import vid.automation.test.utils.InsecureHttpsClient;
9
10 public class VersionControllerApiTest extends BaseApiTest {
11
12     @Test
13     public void probeRequest_returnsResponseAsExpected() {
14         // without log-in
15         ResponseEntity<HashMap<String, String>> response = InsecureHttpsClient.newRestTemplate().exchange(
16                 uri + "/version",
17                 org.springframework.http.HttpMethod.GET,
18                 null,
19                 new ParameterizedTypeReference<HashMap<String, String>>() {
20                 });
21         HashMap<String,String> versionResults = response.getBody();
22         Assert.assertNotNull(versionResults.get("features"));
23         Assert.assertNotNull(versionResults.get("build"));
24     }
25 }