summaryrefslogtreecommitdiffstats
path: root/vid-automation
diff options
context:
space:
mode:
authorEinat Vinouze <einat.vinouze@intl.att.com>2019-10-30 09:43:24 +0200
committerEylon Malin <eylon.malin@intl.att.com>2019-10-31 07:28:34 +0200
commit62f48357131b8b4cd7248a467e82c59b81956ef3 (patch)
tree89e92d8e4a4f0f29a255d38d298fb9647adbbb82 /vid-automation
parentc638391d22999bd61243794a1981d7476bfdbd5f (diff)
add to AAI headers in request and metric log
Issue-ID: VID-253 Including API test + use VidMetricLogClientFilter Signed-off-by: Einat Vinouze <einat.vinouze@intl.att.com> Change-Id: I62980b3c88e941d1a47b03c75a1c837078e1988b
Diffstat (limited to 'vid-automation')
-rw-r--r--vid-automation/src/test/java/org/onap/vid/api/AaiApiTest.java14
-rw-r--r--vid-automation/src/test/java/org/onap/vid/more/LoggerFormatTest.java2
2 files changed, 15 insertions, 1 deletions
diff --git a/vid-automation/src/test/java/org/onap/vid/api/AaiApiTest.java b/vid-automation/src/test/java/org/onap/vid/api/AaiApiTest.java
index c128b864b..39110c550 100644
--- a/vid-automation/src/test/java/org/onap/vid/api/AaiApiTest.java
+++ b/vid-automation/src/test/java/org/onap/vid/api/AaiApiTest.java
@@ -15,6 +15,7 @@ import static org.testng.Assert.assertTrue;
import static org.testng.AssertJUnit.assertEquals;
import static vid.automation.test.services.SimulatorApi.RegistrationStrategy.APPEND;
import static vid.automation.test.services.SimulatorApi.RegistrationStrategy.CLEAR_THEN_SET;
+import static vid.automation.test.services.SimulatorApi.registerExpectationFromPresets;
import static vid.automation.test.utils.TestHelper.GET_SERVICE_MODELS_BY_DISTRIBUTION_STATUS;
import com.fasterxml.jackson.core.JsonProcessingException;
@@ -768,6 +769,19 @@ public class AaiApiTest extends BaseApiAaiTest {
}
@Test
+ public void whenCallAaiThroughAAIRestInterface_thenRequestRecordedInMetricsLog() {
+ registerExpectationFromPresets(ImmutableList.of(
+ new PresetAAIGetVpnsByType(),
+ new PresetAAIGetSubscribersGet()
+ ),CLEAR_THEN_SET);
+
+ String url = uri + "/aai_get_vpn_list";
+ ResponseEntity<String> response = restTemplate.getForEntity(url, String.class);
+ final String requestId = response.getHeaders().getFirst("X-ECOMP-RequestID-echo");
+ LoggerFormatTest.assertHeadersAndMetricLogs(restTemplate, uri, requestId,"/network/vpn-bindings" , 1);
+ }
+
+ @Test
public void getVpnList() {
SimulatorApi.registerExpectationFromPreset(new PresetAAIGetVpnsByType(), CLEAR_THEN_SET);
String url = uri + "/aai_get_vpn_list";
diff --git a/vid-automation/src/test/java/org/onap/vid/more/LoggerFormatTest.java b/vid-automation/src/test/java/org/onap/vid/more/LoggerFormatTest.java
index 11a6932f4..597851086 100644
--- a/vid-automation/src/test/java/org/onap/vid/more/LoggerFormatTest.java
+++ b/vid-automation/src/test/java/org/onap/vid/more/LoggerFormatTest.java
@@ -133,7 +133,7 @@ public class LoggerFormatTest extends BaseApiTest {
List<RecordedRequests> requests = retrieveRecordedRequests();
List<RecordedRequests> underTestRequests =
- requests.stream().filter(x->x.path.startsWith(path)).collect(toList());
+ requests.stream().filter(x->x.path.contains(path)).collect(toList());
assertThat(underTestRequests, hasSize(requestsSize));