aboutsummaryrefslogtreecommitdiffstats
path: root/vid-automation/src/test/java/org/onap/vid/api/VersionControllerApiTest.java
blob: 4dc799193e3d647bd2f5a69e4edc2c61bda688e1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
package org.onap.vid.api;

import org.junit.Assert;
import org.springframework.core.ParameterizedTypeReference;
import org.springframework.http.ResponseEntity;
import org.springframework.web.client.RestTemplate;
import org.testng.annotations.Test;

import java.util.HashMap;

public class VersionControllerApiTest extends BaseApiTest {

    @Test
    public void probeRequest_returnsResponseAsExpected() {
        // without log-in
        ResponseEntity<HashMap<String, String>> response = new RestTemplate().exchange(
                uri + "/version",
                org.springframework.http.HttpMethod.GET,
                null,
                new ParameterizedTypeReference<HashMap<String, String>>() {
                });
        HashMap<String,String> versionResults = response.getBody();
        Assert.assertNotNull(versionResults.get("features"));
        Assert.assertNotNull(versionResults.get("build"));
    }
}