public void onStartup(ServletContext servletContext) throws ServletException {
super.onStartup(servletContext);
setDefaultTimeZoneToUTC();
+ setPartnerName();
+ }
+
+ private void setPartnerName() {
+ //org.onap.logging.filter.base.AbstractMetricLogFilter read this system property
+ System.setProperty("partnerName", "VID.VID");
}
//set time zone to UTC so Dates would be written to DB in UTC timezone
import static org.onap.vid.client.SyncRestClientInterface.HEADERS.CONTENT_TYPE;
import static org.onap.vid.client.SyncRestClientInterface.HEADERS.X_ECOMP_INSTANCE_ID;
import static org.onap.vid.client.UnirestPatchKt.extractRawAsString;
-import static org.onap.vid.logging.Headers.PARTNER_NAME;
-import static org.onap.vid.utils.Logging.REQUEST_ID_HEADER_KEY;
import com.att.eelf.configuration.EELFLogger;
import com.google.common.collect.ImmutableMap;
private Map<String, String> prepareHeaders(String auth, String contentType) {
return ImmutableMap.of(
X_ECOMP_INSTANCE_ID, SystemProperties.getProperty(APP_DISPLAY_NAME),
- PARTNER_NAME.getHeaderName(), PARTNER_NAME.getHeaderValue(),
AUTHORIZATION, auth,
- REQUEST_ID_HEADER_KEY, Logging.extractOrGenerateRequestId(),
CONTENT_TYPE, contentType
);
}
import org.apache.http.conn.ssl.SSLContexts;
import org.apache.http.conn.ssl.TrustSelfSignedStrategy;
import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.impl.client.HttpClientBuilder;
import org.apache.http.impl.client.HttpClients;
import org.eclipse.jetty.util.security.Password;
import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
import org.onap.portalsdk.core.util.SystemProperties;
+import org.onap.vid.logging.ApacheClientMetricRequestInterceptor;
+import org.onap.vid.logging.ApacheClientMetricResponseInterceptor;
import org.onap.vid.properties.VidProperties;
import org.onap.vid.utils.Logging;
import org.springframework.http.HttpMethod;
private RestClient restClient;
public SyncRestClient(Logging loggingService) {
- this(null, null, loggingService);
+ this(null, null, loggingService, false);
+ }
+
+ public SyncRestClient(Logging loggingService, boolean useLoggingInterceptor) {
+ this(null, null, loggingService, useLoggingInterceptor);
}
public SyncRestClient(ObjectMapper objectMapper, Logging loggingService) {
- this(null, objectMapper, loggingService);
+ this(null, objectMapper, loggingService, false);
}
public SyncRestClient(CloseableHttpClient httpClient, Logging loggingService) {
- this(httpClient, null, loggingService);
+ this(httpClient, null, loggingService, false);
}
- public SyncRestClient(CloseableHttpClient httpClient, ObjectMapper objectMapper, Logging loggingService) {
+ public SyncRestClient(CloseableHttpClient httpClient,
+ ObjectMapper objectMapper,
+ Logging loggingService,
+ boolean useLoggingInterceptor) {
restClient = RestClient
.newClient()
.objectMapper(ObjectUtils.defaultIfNull(objectMapper, defaultObjectMapper()))
- .httpClient(ObjectUtils.defaultIfNull(httpClient , defaultHttpClient()))
+ .httpClient(ObjectUtils.defaultIfNull(httpClient , defaultHttpClient(useLoggingInterceptor)))
.build();
this.loggingService = loggingService;
this.outgoingRequestsLogger = Logging.getRequestsLogger("syncRestClient");
return JOSHWORKS_JACKSON_OBJECT_MAPPER;
}
- private CloseableHttpClient defaultHttpClient() {
+ private CloseableHttpClient defaultHttpClient(boolean useLoggingInterceptor) {
try {
String trustStorePath = SystemProperties.getProperty(VidProperties.VID_TRUSTSTORE_FILENAME);
String trustStorePass = SystemProperties.getProperty(VidProperties.VID_TRUSTSTORE_PASSWD_X);
SSLContext sslContext = trustOwnCACerts(decryptedTrustStorePass, trustStore);
SSLConnectionSocketFactory sslSf = allowTLSProtocols(sslContext);
- return HttpClients.custom().setSSLSocketFactory(sslSf).build();
+ HttpClientBuilder httpClientBuilder = HttpClients.custom().setSSLSocketFactory(sslSf);
+ if (useLoggingInterceptor) {
+ httpClientBuilder
+ .addInterceptorFirst(new ApacheClientMetricRequestInterceptor())
+ .addInterceptorLast(new ApacheClientMetricResponseInterceptor());
+ }
+ return httpClientBuilder.build();
} catch (IOException | CertificateException | UnrecoverableKeyException | NoSuchAlgorithmException | KeyStoreException | KeyManagementException e) {
logger.warn("Cannot initialize custom http client from current configuration. Using default one.", e);
return HttpClients.createDefault();
this.logfilePathCreator = logfilePathCreator;
}
- @GetMapping(value = "/{loggerName:audit|audit2019|error|metrics}")
+ @GetMapping(value = "/{loggerName:audit|audit2019|error|metrics|metrics2019}")
public String getLog(@PathVariable String loggerName, HttpServletRequest request,
@RequestParam(value="limit", defaultValue = "5000") Integer limit) throws IOException {
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import javax.servlet.ServletContext;
+import org.onap.logging.filter.spring.LoggingInterceptor;
import org.onap.portalsdk.core.util.SystemProperties;
import org.onap.vid.aai.AaiClient;
import org.onap.vid.aai.AaiClientInterface;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
+import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
+import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import org.togglz.core.manager.FeatureManager;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
@EnableSwagger2
@Configuration
-public class WebConfig {
+public class WebConfig implements WebMvcConfigurer {
/**
* Gets the object mapper.
String protocol = asdcClientConfiguration.getAsdcClientProtocol();
int port = asdcClientConfiguration.getAsdcClientPort();
- return new SdcRestClient(protocol + "://" + host + ":" + port + "/", auth, new SyncRestClient(loggingService), loggingService);
+ return new SdcRestClient(protocol + "://" + host + ":" + port + "/", auth,
+ new SyncRestClient( loggingService, true),
+ loggingService);
}
@Bean
int threadsCount = defaultIfNull(Integer.parseInt(SystemProperties.getProperty(VidProperties.VID_THREAD_COUNT)), 1);
return Executors.newFixedThreadPool(threadsCount);
}
+
+ @Override
+ public void addInterceptors(InterceptorRegistry registry) {
+ registry.addInterceptor(new LoggingInterceptor());
+ }
}
--- /dev/null
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 - 2019 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.logging;
+
+import org.apache.http.HttpRequest;
+import org.apache.http.HttpRequestInterceptor;
+import org.apache.http.protocol.HttpContext;
+
+public class ApacheClientMetricRequestInterceptor extends ApacheClientMetricInterceptor implements HttpRequestInterceptor {
+
+ @Override
+ public void process(HttpRequest request, HttpContext context) {
+ this.pre(request, request);
+ }
+}
--- /dev/null
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 - 2019 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.logging;
+
+import org.apache.http.HttpResponse;
+import org.apache.http.HttpResponseInterceptor;
+import org.apache.http.protocol.HttpContext;
+
+public class ApacheClientMetricResponseInterceptor extends ApacheClientMetricInterceptor implements HttpResponseInterceptor {
+
+ @Override
+ public void process(HttpResponse response, HttpContext context) {
+ this.post(null, response);
+ }
+}
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
+import org.onap.logging.ref.slf4j.ONAPLogConstants;
import org.onap.portalsdk.core.logging.aspect.EELFLoggerAdvice;
import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
import org.onap.portalsdk.core.service.AppService;
import org.onap.portalsdk.core.web.support.UserUtils;
import org.onap.vid.controller.ControllersUtils;
import org.onap.vid.utils.SystemPropertiesWrapper;
+import org.slf4j.MDC;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
Object[] passOnArgs = new Object[] {joinPoint.getSignature().getDeclaringType().getName(),joinPoint.getSignature().getName()};
Object[] returnArgs = advice.before(securityEventType, fabricateArgsWithNull(), passOnArgs);
- fixSetRequestBasedDefaultsIntoGlobalLoggingContext(httpServletRequestOrNull(joinPoint),
+ HttpServletRequest httpServletRequest = httpServletRequestOrNull(joinPoint);
+ fixSetRequestBasedDefaultsIntoGlobalLoggingContext(httpServletRequest,
joinPoint.getSignature().getDeclaringType().getName());
-
+ addRequestIdToMdcForMetricFilter(httpServletRequest);
fixServerFqdnInMDC();
//Execute the actual method
return result;
}
+ //prepare MDC for org.onap.logging.filter.base.AbstractMetricLogFilter
+ private void addRequestIdToMdcForMetricFilter(HttpServletRequest httpServletRequest) {
+ if (httpServletRequest!=null) {
+ String requestId = UserUtils.getRequestId(httpServletRequest);
+ MDC.put(ONAPLogConstants.MDCs.REQUEST_ID, requestId);
+ }
+ }
+
// Set the status code into MDC *before* the metrics log is written by advice.after()
private void fixStatusCodeInMDC(String restStatus) {
EELFLoggerDelegate.mdcPut(SystemProperties.STATUS_CODE, restStatus);
String loginId = controllersUtils.extractUserId(httpServletRequest);
logger.setRequestBasedDefaultsIntoGlobalLoggingContext(httpServletRequest, appName, requestId, loginId);
+
}
}
package org.onap.vid.mso;
-import static org.onap.vid.logging.Headers.INVOCATION_ID;
-import static org.onap.vid.logging.Headers.PARTNER_NAME;
-import static org.onap.vid.utils.Logging.ONAP_REQUEST_ID_HEADER_KEY;
-import static org.onap.vid.utils.Logging.REQUEST_ID_HEADER_KEY;
import static org.onap.vid.utils.Logging.getMethodCallerName;
import static org.onap.vid.utils.Logging.getMethodName;
import org.apache.commons.codec.binary.Base64;
import org.eclipse.jetty.util.security.Password;
import org.glassfish.jersey.client.ClientProperties;
+import org.onap.logging.filter.base.MetricLogClientFilter;
import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
import org.onap.vid.aai.util.HttpClientMode;
import org.onap.vid.aai.util.HttpsAuthClient;
MultivaluedHashMap<String, Object> commonHeaders = new MultivaluedHashMap();
commonHeaders.put("Authorization", Collections.singletonList(("Basic " + authStringEnc)));
- commonHeaders.put(PARTNER_NAME.getHeaderName(), Collections.singletonList(PARTNER_NAME.getHeaderValue()));
String requestIdValue = Logging.extractOrGenerateRequestId();
- commonHeaders.put(REQUEST_ID_HEADER_KEY, Collections.singletonList(requestIdValue));
- commonHeaders.put(ONAP_REQUEST_ID_HEADER_KEY, Collections.singletonList(requestIdValue));
- commonHeaders.put(INVOCATION_ID.getHeaderName(), Collections.singletonList(INVOCATION_ID.getHeaderValue()));
boolean useSsl = true;
if ( (mso_url != null) && ( !(mso_url.isEmpty()) ) ) {
if (client == null) {
try {
- if ( useSsl ) {
- client = httpsAuthClient.getClient(HttpClientMode.WITHOUT_KEYSTORE);
- }
+ if ( useSsl ) {
+ client = httpsAuthClient.getClient(HttpClientMode.WITHOUT_KEYSTORE);
+ registerClientToMetricLogClientFilter(client);
+ }
else {
client = HttpBasicClient.getClient();
+ registerClientToMetricLogClientFilter(client);
}
} catch (Exception e) {
logger.info(EELFLoggerDelegate.errorLogger,methodname + " Unable to get the SSL client");
return commonHeaders;
}
+ private void registerClientToMetricLogClientFilter(Client client) {
+ MetricLogClientFilter metricLogClientFilter = new MetricLogClientFilter();
+ client.register(metricLogClientFilter);
+ }
+
public <T> RestObject<T> GetForObject(String path, Class<T> clazz) {
final String methodName = getMethodName();
logger.debug(EELFLoggerDelegate.debugLogger, "start {}->{}({}, {})", getMethodCallerName(), methodName, path, clazz);
import static com.xebialabs.restito.semantics.Action.stringContent;
import static org.apache.http.client.config.RequestConfig.custom;
import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.Matchers.allOf;
import static org.hamcrest.Matchers.equalToIgnoringCase;
import static org.hamcrest.Matchers.is;
-import static org.hamcrest.Matchers.matchesPattern;
import static org.hamcrest.collection.IsIterableContainingInOrder.contains;
-import static org.hamcrest.collection.IsMapContaining.hasEntry;
import static org.hamcrest.collection.IsMapContaining.hasKey;
-import static org.hamcrest.core.IsEqual.equalTo;
import static org.junit.Assert.assertTrue;
import static org.mockito.Mockito.mock;
import static org.onap.vid.client.SyncRestClientInterface.HEADERS.X_ECOMP_INSTANCE_ID;
-import static org.onap.vid.utils.Logging.REQUEST_ID_HEADER_KEY;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.xebialabs.restito.semantics.Call;
public class SdcRestClientITTest {
- private static final String UUID_REGEX = "[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}";
private static final String[] SUPPORTED_SSL_VERSIONS = {"TLSv1", "TLSv1.2"};
private static StubServerUtil stubServer;
private static SdcRestClient sdcRestClient;
assertTrue(first.isPresent());
- assertThat(first.get().getHeaders(),
- allOf(
- hasEntry(equalToIgnoringCase(REQUEST_ID_HEADER_KEY), contains(matchesPattern(UUID_REGEX))),
- hasKey(equalToIgnoringCase(X_ECOMP_INSTANCE_ID)),
- hasEntry(equalToIgnoringCase("x-onap-partnerName"), contains(equalTo("VID.VID")))
- ));
+ assertThat(first.get().getHeaders(), hasKey(equalToIgnoringCase(X_ECOMP_INSTANCE_ID)));
}
private Service getExpectedService(String stringId) {
package org.onap.vid.mso;
import static org.assertj.core.api.Java6Assertions.assertThat;
+import static org.hamcrest.collection.IsCollectionWithSize.hasSize;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.when;
import io.joshworks.restclient.request.HttpRequest;
import java.io.IOException;
import java.security.GeneralSecurityException;
+import java.util.List;
import java.util.Optional;
import javax.ws.rs.client.Client;
import javax.ws.rs.client.Entity;
import javax.ws.rs.core.Response;
import org.glassfish.jersey.client.ClientProperties;
import org.glassfish.jersey.client.JerseyInvocation;
+import org.hamcrest.MatcherAssert;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.onap.vid.aai.util.HttpClientMode;
MultivaluedHashMap<String, Object> result = restMsoImplementation.initMsoClient();
// then
- assertThat(result).containsKeys("Authorization","X-ONAP-PartnerName");
+ List<Object> authorizationHeaders = result.get("Authorization");
+ MatcherAssert.assertThat(authorizationHeaders, hasSize(1));
+ assertThat((String) authorizationHeaders.get(0)).startsWith("Basic ");
assertThat(result).doesNotContainKey("notExistingKey");
}
).map(l -> ImmutableList.of(l).toArray()).collect(Collectors.toList()).toArray(new Object[][]{});
}
- @Test(dataProvider = "msoMethods")
- public void mso(Consumer<RestMsoImplementation> f) throws Exception {
- final TestUtils.JavaxRsClientMocks mocks = setAndGetMocksInsideRestImpl(restMsoImplementation);
-
- f.accept(restMsoImplementation);
- HeadersVerifier headersVerifier = new HeadersVerifier().verifyFirstCall(mocks.getFakeBuilder());
-
- assertThat((String) captureHeaderKeyAndReturnItsValue(mocks.getFakeBuilder(), "Authorization"), startsWith("Basic "));
-
- //verify requestId is same in next call but invocationId is different
-
- //given
- final TestUtils.JavaxRsClientMocks mocks2 = setAndGetMocksInsideRestImpl(restMsoImplementation);
-
- //when
- f.accept(restMsoImplementation);
- //then
- headersVerifier.verifySecondCall(mocks2.getFakeBuilder());
- }
-
-
-
@Test
public void whenProvideMsoRestCallUserId_builderHasXRequestorIDHeader() throws Exception {
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
- <artifactId>hamcrest-all</artifactId>
- <version>1.3</version>
+ <artifactId>java-hamcrest</artifactId>
+ <version>2.0.0.0</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
public Map<String, String> getRequestHeaders() {
Map<String, String> map = super.getRequestHeaders();
map.put("X-ONAP-PartnerName", "VID.VID");
+ map.put("X-ECOMP-RequestID", "[0-9a-fA-F]{8}\\-[0-9a-fA-F]{4}\\-[0-9a-fA-F]{4}\\-[0-9a-fA-F]{4}\\-[0-9a-fA-F]{12}");
return map;
}
}
public abstract class BaseSDCPreset extends BasePreset {
+ public static final String SDC_ROOT_PATH = "/sdc/v1/catalog/services";
+
@Override
protected String getRootPath() {
- return "/sdc/v1/catalog/services";
+ return SDC_ROOT_PATH;
}
@Override
public Map<String, String> getRequestHeaders() {
Map<String, String> map = super.getRequestHeaders();
map.put("X-ONAP-PartnerName", "VID.VID");
+ map.put("X-ONAP-InvocationID", "[0-9a-fA-F]{8}\\-[0-9a-fA-F]{4}\\-[0-9a-fA-F]{4}\\-[0-9a-fA-F]{4}\\-[0-9a-fA-F]{12}");
+ map.put("X-ONAP-RequestID", "[0-9a-fA-F]{8}\\-[0-9a-fA-F]{4}\\-[0-9a-fA-F]{4}\\-[0-9a-fA-F]{4}\\-[0-9a-fA-F]{12}");
return map;
}
package vid.automation.test.services;
+import static java.util.stream.Collectors.toList;
import static org.testng.Assert.assertEquals;
import static vid.automation.test.services.DropTestApiField.dropFieldCloudOwnerFromString;
import static vid.automation.test.services.DropTestApiField.dropTestApiFieldFromString;
public List<StringWrapper> values;
}
- public static class HttpRequest{
+ public static class HttpRequest {
public StringWrapper path;
public List<RecordedHeaders> headers;
}
+ public static class RecordedRequests {
+ public String path;
+ public Map<String, List<String>> headers;
+
+ public RecordedRequests(String path, Map<String, List<String>> headers) {
+ this.path = path;
+ this.headers = headers;
+ }
+
+ public RecordedRequests() {
+ }
+ }
+
private static final URI uri; //uri for registration
private static final URI simulationUri; //uri for getting simulated responses
private static final Client client;
public static void registerExpectationFromPresetsCollections(Collection<Collection<BasePreset>> presets, RegistrationStrategy registrationStrategy) {
registerExpectationFromPresets(presets.stream()
.flatMap(Collection::stream)
- .collect(Collectors.toList()), registrationStrategy);
+ .collect(toList()), registrationStrategy);
}
public static void registerExpectationFromPresets(Collection<BasePreset> presets, RegistrationStrategy registrationStrategy) {
The key of the map is a path, and the value is counter
*/
public static Map<String, Long> retrieveRecordedRequestsPathCounter() {
- List<HttpRequest> httpRequests = retrieveRecordedRequests();
+ List<HttpRequest> httpRequests = retrieveRecordedHttpRequests();
return httpRequests.stream().map(x->x.path.value).collect(
Collectors.groupingBy(Function.identity(), Collectors.counting()));
}
- public static List<HttpRequest> retrieveRecordedRequests() {
+ private static List<HttpRequest> retrieveRecordedHttpRequests() {
Response response = client.target(uri).path("retrieveRecordedRequests").request().get();
return response.readEntity(new GenericType<List<HttpRequest>>(){});
}
+ public static List<RecordedRequests> retrieveRecordedRequests() {
+ List<HttpRequest> rawRequests = retrieveRecordedHttpRequests();
+ return rawRequests.stream().map(request->new RecordedRequests(
+ request.path.value,
+ request.headers.stream().collect(
+ Collectors.toMap(
+ x->x.name.value,
+ x->x.values.stream().map(y->y.value).collect(toList())))
+ )).collect(toList());
+ }
+
private static void registerToSimulatorAndAssertSuccess(String name, Object content, RegistrationStrategy registrationStrategy) {
if (registrationStrategy == RegistrationStrategy.CLEAR_THEN_SET) {
clearRegistrations();
import org.onap.vid.model.aai.AaiResponse;
import org.onap.vid.model.mso.OperationalEnvironmentList;
import org.onap.vid.more.LoggerFormatTest;
+import org.onap.vid.more.LoggerFormatTest.LogName;
import org.springframework.core.ParameterizedTypeReference;
import org.springframework.http.HttpMethod;
import org.springframework.http.HttpStatus;
SimulatorApi.registerExpectationFromPreset(new PresetAAIGetSubscribersGet(), APPEND);
restTemplateErrorAgnostic.getForEntity(uri + "/aai_get_services", String.class);
- String logLines = LoggerFormatTest.getLogLines("error", 15, 0, restTemplate, uri);
+ String logLines = LoggerFormatTest.getLogLines(LogName.error, 15, 0, restTemplate, uri);
assertThat("not found in error log", logLines, containsString("Failed to parse aai response"));
assertThat("not found in error log", logLines, containsString(notAJson));
package org.onap.vid.api;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.containsString;
+import static org.testng.AssertJUnit.assertEquals;
+
import com.google.common.collect.ImmutableList;
+import java.util.UUID;
import org.onap.simulator.presetGenerator.presets.aai.PresetAAIGetSubscribersGet;
import org.onap.simulator.presetGenerator.presets.ecompportal_att.PresetGetSessionSlotCheckIntervalGet;
import org.onap.vid.more.LoggerFormatTest;
+import org.onap.vid.more.LoggerFormatTest.LogName;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
import vid.automation.test.services.SimulatorApi;
-import java.util.UUID;
-
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.Matchers.containsString;
-import static org.testng.AssertJUnit.assertEquals;
-
public class AsyncInfraApiTest extends BaseApiTest {
public static final String API_URL = "asyncForTests";
assertEquals(HttpStatus.INTERNAL_SERVER_ERROR, jobResult.getStatusCode());
assertThat(jobResult.getBody(), containsString("GenericUncheckedException"));
assertThat(jobResult.getBody(), containsString("dummy error"));
- String logLines = LoggerFormatTest.getLogLines("error", 15, 0, restTemplate, uri);
+ String logLines = LoggerFormatTest.getLogLines(LogName.error, 15, 0, restTemplate, uri);
assertThat(logLines, containsString("GenericUncheckedException"));
assertThat(logLines, containsString("dummy error"));
}
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.core.Is.is;
import static org.hamcrest.core.IsNot.not;
+import static org.onap.simulator.presetGenerator.presets.BasePresets.BaseSDCPreset.SDC_ROOT_PATH;
+import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertFalse;
import static vid.automation.test.services.SimulatorApi.RegistrationStrategy.APPEND;
import static vid.automation.test.services.SimulatorApi.RegistrationStrategy.CLEAR_THEN_SET;
import com.fasterxml.jackson.databind.JsonNode;
import com.google.common.collect.ImmutableList;
import org.onap.simulator.presetGenerator.presets.BasePresets.BasePreset;
+import org.onap.simulator.presetGenerator.presets.aai.PresetAAIGetSubscribersGet;
import org.onap.simulator.presetGenerator.presets.sdc.PresetSDCGetServiceMetadataGet;
import org.onap.simulator.presetGenerator.presets.sdc.PresetSDCGetServiceToscaModelGet;
+import org.onap.vid.more.LoggerFormatTest;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
-import org.testng.Assert;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
import vid.automation.test.infra.FeatureTogglingTest;
import vid.automation.test.infra.Features;
+import vid.automation.test.infra.ModelInfo;
public class SdcApiTest extends BaseApiTest {
public void getServiceModelALaCarteInstantiation() {
registerToSimulatorWithPresets(A_LA_CARTE_INSTANTIATION_TYPE_UUID, A_LA_CARTE_INSTANTIATION_TYPE_INVARIANT_UUID, A_LA_CARTE_INSTANTIATION_TYPE_FILE_PATH);
ResponseEntity<String> response = restTemplate.getForEntity(buildUri(SDC_GET_SERVICE_MODEL + A_LA_CARTE_INSTANTIATION_TYPE_UUID), String.class);
- Assert.assertEquals(response.getStatusCode(), HttpStatus.OK);
+ assertEquals(response.getStatusCode(), HttpStatus.OK);
String aLaCarteInstantiationTypeExpectedResponse = loadResourceAsString(A_LA_CARTE_INSTANTIATION_TYPE_EXPECTED_RESPONSE);
assertThat(response.getBody(), jsonEquals(aLaCarteInstantiationTypeExpectedResponse)
.when(IGNORING_ARRAY_ORDER)
public void getServiceModelMacroInstantiation() {
registerToSimulatorWithPresets(MACRO_INSTANTIATION_TYPE_UUID, MACRO_INSTANTIATION_TYPE_INVARIANT_UUID, MACRO_INSTANTIATION_TYPE_FILE_PATH);
ResponseEntity<String> response = restTemplate.getForEntity(buildUri(SDC_GET_SERVICE_MODEL + MACRO_INSTANTIATION_TYPE_UUID), String.class);
- Assert.assertEquals(response.getStatusCode(), HttpStatus.OK);
+ assertEquals(response.getStatusCode(), HttpStatus.OK);
String macroInstantiationTypeExpectedResponse = loadResourceAsString(MACRO_INSTANTIATION_TYPE_EXPECTED_RESPONSE);
assertThat(response.getBody(), jsonEquals(macroInstantiationTypeExpectedResponse)
.when(IGNORING_ARRAY_ORDER)
public void getServiceModelWithoutInstantiationType(){
registerToSimulatorWithPresets(MACRO_INSTANTIATION_TYPE_UUID, MACRO_INSTANTIATION_TYPE_INVARIANT_UUID, EMPTY_INSTANTIATION_TYPE_FILE_PATH);
ResponseEntity<String> response = restTemplate.getForEntity(buildUri(SDC_GET_SERVICE_MODEL + MACRO_INSTANTIATION_TYPE_UUID), String.class);
- Assert.assertEquals(response.getStatusCode(), HttpStatus.OK);
+ assertEquals(response.getStatusCode(), HttpStatus.OK);
String emptyInstantiationTypeExpectedResponse = loadResourceAsString(EMPTY_INSTANTIATION_TYPE_EXPECTED_RESPONSE);
assertThat("The response is in the format of JSON", response.getBody(), is(jsonStringEquals(turnOffInstantiationUI(emptyInstantiationTypeExpectedResponse))));
}
public void getServiceModelBothInstantiationType(){
registerToSimulatorWithPresets(MACRO_INSTANTIATION_TYPE_UUID, MACRO_INSTANTIATION_TYPE_INVARIANT_UUID, BOTH_INSTANTIATION_TYPE_FILE_PATH);
ResponseEntity<String> response = restTemplate.getForEntity(buildUri(SDC_GET_SERVICE_MODEL + MACRO_INSTANTIATION_TYPE_UUID), String.class);
- Assert.assertEquals(response.getStatusCode(), HttpStatus.OK);
+ assertEquals(response.getStatusCode(), HttpStatus.OK);
String macroInstantiationTypeExpectedResponse = loadResourceAsString(MACRO_INSTANTIATION_TYPE_EXPECTED_RESPONSE);
assertThat(response.getBody(), jsonEquals(macroInstantiationTypeExpectedResponse)
.when(IGNORING_ARRAY_ORDER)
public void getServiceModelWithGroupsAndCheckMinMaxInitialParams(){
registerToSimulatorWithPresets(MIN_MAX_INITIAL_UUID, MIN_MAX_INITIAL_INVARIANT_UUID, MIN_MAX_INITIAL_FILE_PATH);
ResponseEntity<String> response = restTemplate.getForEntity(buildUri(SDC_GET_SERVICE_MODEL + MIN_MAX_INITIAL_UUID), String.class);
- Assert.assertEquals(response.getStatusCode(), HttpStatus.OK);
+ assertEquals(response.getStatusCode(), HttpStatus.OK);
String minMaxInitialExpectedResponse = loadResourceAsString("sdcApiTest/minMaxInitialExpectedResponse.json");
assertThat("The response is in the format of JSON", response.getBody(), is(jsonStringEquals(turnOffInstantiationUI(minMaxInitialExpectedResponse))));
}
public void getServiceModelWithGroupsAndCheckMinMaxInitialParamsOldCsar(){
registerToSimulatorWithPresets(MIN_MAX_INITIAL_UUID_OLD_CSAR, MIN_MAX_INITIAL_INVARIANT_UUID_OLD_CSAR, MIN_MAX_INITIAL_FILE_PATH_OLD_CSAR);
ResponseEntity<String> response = restTemplate.getForEntity(buildUri(SDC_GET_SERVICE_MODEL + MIN_MAX_INITIAL_UUID_OLD_CSAR), String.class);
- Assert.assertEquals(response.getStatusCode(), HttpStatus.OK);
+ assertEquals(response.getStatusCode(), HttpStatus.OK);
String minMaxInitialExpectedResponseOldCsar = loadResourceAsString("sdcApiTest/minMaxInitialExpectedResponseOldCsar.json");
assertThat("The response is in the format of JSON", response.getBody(), is(jsonStringEquals(minMaxInitialExpectedResponseOldCsar)));
}
public void getServiceModelWithServiceRoleGrouping(){
registerToSimulatorWithPresets(GROUPING_SERVICE_ROLE_UUID, GROUPING_SERVICE_ROLE_INVARIANT_UUID, GROUPING_SERVICE_ROLE_FILE_PATH);
ResponseEntity<String> response = restTemplate.getForEntity(buildUri(SDC_GET_SERVICE_MODEL + GROUPING_SERVICE_ROLE_UUID), String.class);
- Assert.assertEquals(response.getStatusCode(), HttpStatus.OK);
+ assertEquals(response.getStatusCode(), HttpStatus.OK);
String groupingServiceRoleExpectedResponse = loadResourceAsString(GROUPING_SERVICE_ROLE_EXPECTED_RESPONSE);
assertThat("The response is in the format of JSON", response.getBody(), is(jsonStringEquals(groupingServiceRoleExpectedResponse)));
}
response.at(base + "/volumeGroups").size(), is(not(0)));
}
+
+ @Test
+ public void whenCallSdc_thenRequestRecordedInMetricsLog() {
+
+ ModelInfo modelInfo = ModelInfo.transportWithPnfsService;
+
+ registerExpectationFromPresets(ImmutableList.of(
+ new PresetSDCGetServiceToscaModelGet(modelInfo),
+ new PresetSDCGetServiceMetadataGet(modelInfo),
+ new PresetAAIGetSubscribersGet() //for read logs permissions
+ ), CLEAR_THEN_SET);
+
+ ResponseEntity<String> response = restTemplate.getForEntity(
+ buildUri(SDC_GET_SERVICE_MODEL + modelInfo.modelVersionId), String.class);
+
+ final String requestId = response.getHeaders().getFirst("X-ECOMP-RequestID-echo");
+
+ LoggerFormatTest.assertHeadersAndMetricLogs(restTemplate, uri, requestId, SDC_ROOT_PATH, 2);
+ }
+
}
--- /dev/null
+package org.onap.vid.more;
+
+import static org.hamcrest.CoreMatchers.containsString;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.allOf;
+import static org.hamcrest.Matchers.contains;
+import static org.hamcrest.Matchers.equalToIgnoringCase;
+import static org.hamcrest.Matchers.hasSize;
+import static org.hamcrest.collection.IsMapContaining.hasKey;
+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.registerExpectationFromPreset;
+
+import java.util.List;
+import java.util.function.Supplier;
+import org.onap.simulator.presetGenerator.presets.aai.PresetAAIGetVpnsByType;
+import org.onap.vid.api.BaseApiTest;
+import org.onap.vid.more.LoggerFormatTest.LogName;
+import org.springframework.http.ResponseEntity;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+import vid.automation.test.services.SimulatorApi;
+
+public class AuditLoggerTest extends BaseApiTest {
+
+ private final String ECOMP_REQUEST_ID_ECHO = "x-ecomp-requestid-echo";
+
+ @BeforeClass
+ public void login() {
+ super.login();
+ }
+
+ @BeforeMethod
+ public void resetPreset() {
+ SimulatorApi.registerExpectation("create_new_instance/aai_get_full_subscribers.json", CLEAR_THEN_SET);
+ }
+
+ @Test
+ public void aaiController2$GetVpnList_requestIdIsAuditedInEntryAndInExit() {
+ registerExpectationFromPreset(new PresetAAIGetVpnsByType(), APPEND);
+ String requestId = getRequestId(() -> restTemplate.getForEntity(buildUri("aai_get_vpn_list"), String.class));
+
+ assertThat("request id must be found in exactly two rows", getRequestLogLines(requestId),
+ contains(
+ allOf(containsString(requestId), containsString("Entering")),
+ allOf(containsString(requestId), containsString("Exiting"))
+ ));
+ }
+
+ private List<String> getRequestLogLines(String requestId) {
+ return LoggerFormatTest.getRequestLogLines(requestId, LogName.audit2019, restTemplate, uri);
+ }
+
+ private String getRequestId(Supplier<ResponseEntity<?>> request) {
+ ResponseEntity<?> response = request.get();
+
+ assertThat(response.getHeaders(), hasKey(equalToIgnoringCase(ECOMP_REQUEST_ID_ECHO)));
+ List<String> requestIds = response.getHeaders().get(ECOMP_REQUEST_ID_ECHO);
+
+ assertThat(requestIds, hasSize(1));
+ return requestIds.get(0);
+ }
+
+}
package org.onap.vid.more;
+import static java.util.Collections.reverse;
+import static java.util.stream.Collectors.toList;
+import static org.hamcrest.CoreMatchers.containsString;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.allOf;
+import static org.hamcrest.Matchers.contains;
+import static org.hamcrest.Matchers.containsInRelativeOrder;
import static org.hamcrest.Matchers.greaterThanOrEqualTo;
+import static org.hamcrest.Matchers.hasSize;
+import static vid.automation.test.services.SimulatorApi.retrieveRecordedRequests;
import com.fasterxml.jackson.databind.JsonNode;
import java.net.URI;
+import java.util.ArrayList;
+import java.util.Arrays;
import java.util.HashMap;
+import java.util.List;
import java.util.Map;
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager;
import org.testng.annotations.Test;
import vid.automation.test.infra.SkipTestUntil;
import vid.automation.test.services.SimulatorApi;
+import vid.automation.test.services.SimulatorApi.RecordedRequests;
public class LoggerFormatTest extends BaseApiTest {
private final static String logChecker = System.getProperty("EELF_LOG_CHECKER", "http://my-logchecker:8888/validate");
private final Logger logger = LogManager.getLogger(LoggerFormatTest.class);
+ public enum LogName {
+ audit, error, audit2019, metrics2019, metrics
+ }
+
@BeforeClass
public void login() {
super.login();
@SkipTestUntil("2019-09-24")
@Test
public void validateAuditLogsFormat() {
- validateLogsFormat("audit");
+ validateLogsFormat(LogName.audit);
}
@Test
public void validateAudit2019LogsFormat() {
- validateLogsFormat("audit2019", "audit-ELS-2019.11", 0);
+ validateLogsFormat(LogName.audit2019, "audit-ELS-2019.11", 0);
}
@Test(enabled = false) // no total-score is returned for error-log
public void validateErrorLogsFormat() {
- validateLogsFormat("error");
+ validateLogsFormat(LogName.error);
}
@SkipTestUntil("2019-09-24")
@Test
public void validateMetricsLogsFormat() {
- validateLogsFormat("metrics", "metric");
+ validateLogsFormat(LogName.metrics, "metric");
}
- private void validateLogsFormat(String logName) {
- validateLogsFormat(logName, logName);
+ private void validateLogsFormat(LogName logName) {
+ validateLogsFormat(logName, logName.name());
}
- private void validateLogsFormat(String logName, String logType) {
+ private void validateLogsFormat(LogName logName, String logType) {
validateLogsFormat(logName, logType, 0.95);
}
- private void validateLogsFormat(String logName, String logType, double score) {
+ private void validateLogsFormat(LogName logName, String logType, double score) {
String logLines = getLogLines(logName);
logger.info("logLines are: "+logLines);
}
- private String getLogLines(String logname) {
+ private String getLogLines(LogName logname) {
return getLogLines(logname, 5000, 30, restTemplate, uri);
}
- public static String getLogLines(String logname, int maxRows, int minRows, RestTemplate restTemplate, URI uri) {
- String logLines = restTemplate.getForObject(uri + "/logger/" + logname + "?limit={maxRows}", String.class, maxRows);
- assertThat("expecting at least " + minRows + " rows in " + logname,
+ public static String getLogLines(LogName logname, int maxRows, int minRows, RestTemplate restTemplate, URI uri) {
+ String logLines = restTemplate.getForObject(uri + "/logger/" + logname.name() + "?limit={maxRows}", String.class, maxRows);
+ assertThat("expecting at least " + minRows + " rows in " + logname.name(),
StringUtils.countMatches(logLines, '\n') + 1,
is(greaterThanOrEqualTo(minRows)));
return logLines;
}
+ /**
+ * @return Chronological-ordered list of recent log-lines of a given requestId
+ */
+ public static List<String> getRequestLogLines(String requestId, LogName logname, RestTemplate restTemplate, URI uri) {
+ String logLines = LoggerFormatTest.getLogLines(logname, 30, 1, restTemplate, uri);
+
+ // Split
+ List<String> lines = new ArrayList<>(Arrays.asList(logLines.split("(\\r?\\n)")));
+
+ // Filter
+ lines.removeIf(line -> !StringUtils.containsIgnoreCase(line, requestId));
+
+ // Reverse
+ reverse(lines);
+
+ return lines;
+ }
+
+ public static void assertHeadersAndMetricLogs(RestTemplate restTemplate, URI uri, String requestId, String path, int requestsSize) {
+ List<String> logLines =
+ getRequestLogLines(requestId, LogName.metrics2019, restTemplate, uri);
+
+ List<RecordedRequests> requests = retrieveRecordedRequests();
+ List<RecordedRequests> underTestRequests =
+ requests.stream().filter(x->x.path.startsWith(path)).collect(toList());
+
+ assertThat(underTestRequests, hasSize(requestsSize));
+
+ underTestRequests.forEach(request-> {
+ assertThat("X-ONAP-RequestID", request.headers.get("X-ONAP-RequestID"), contains(requestId));
+ assertThat("X-ECOMP-RequestID", request.headers.get("X-ECOMP-RequestID"), contains(requestId));
+ assertThat("X-ONAP-PartnerName", request.headers.get("X-ONAP-PartnerName"), contains("VID.VID"));
+ });
+
+ underTestRequests.forEach(request->{
+
+ List<String> invocationIds = request.headers.get("X-ONAP-InvocationID");
+ assertThat(invocationIds, hasSize(1));
+
+ String invocationId = invocationIds.get(0);
+ assertThat("request id and invocation id must be found in exactly two rows",
+ logLines,
+ containsInRelativeOrder(
+ allOf(
+ containsString("RequestID="+requestId),
+ containsString("InvocationID="+ invocationId),
+ containsString("Invoke")),
+ allOf(
+ containsString("RequestID="+requestId),
+ containsString("InvocationID="+ invocationId),
+ containsString("InvokeReturn"))
+ ));
+ });
+ }
+
private JsonNode getCheckerResults(String logtype, String logLines) {
Map<String, String> params = new HashMap<>();
params.put("format", "raw");
import static org.springframework.http.HttpHeaders.AUTHORIZATION;
import static vid.automation.test.services.SimulatorApi.RegistrationStrategy.APPEND;
-import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import java.util.List;
import java.util.UUID;
import org.onap.vid.api.BaseApiTest;
import org.onap.vid.api.OperationalEnvironmentControllerApiTest;
import org.onap.vid.api.ServiceInstanceMsoApiTest;
+import org.onap.vid.more.LoggerFormatTest.LogName;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpMethod;
}
@Test
- public void frontendApi_doGET_RequestIdReceived() throws InterruptedException {
+ public void frontendApi_doGET_RequestIdReceived() {
final Pair<HttpEntity, String> responseAndUuid = makeRequest(
HttpMethod.GET,
null,
OperationalEnvironmentControllerApiTest.GET_CLOUD_RESOURCES_REQUEST_STATUS
);
- assertThatUuidInResponseAndUuidIsInARecentLog(responseAndUuid);
+ assertThatUuidInResponseAndUuidIsInARecentLog(LogName.audit, responseAndUuid);
}
@Test
- public void frontendApi_doPOST_RequestIdReceived() throws InterruptedException {
+ public void frontendApi_doPOST_RequestIdReceived() {
final Pair<HttpEntity, String> responseAndUuid = makeRequest(
HttpMethod.POST,
"{}",
ServiceInstanceMsoApiTest.DEACTIVATE_OK_JSON
);
- assertThatUuidInResponseAndUuidIsInARecentLog(responseAndUuid);
+ assertThatUuidInResponseAndUuidIsInARecentLog(LogName.audit, responseAndUuid);
}
@Test
"/" + MSO_CREATE_CONFIGURATION,
"i'm not a json"
);
- assertThatUuidInResponseAndUuidIsInARecentLog(responseAndUuid);
+ assertThatUuidInResponseAndUuidIsInARecentLog(LogName.error, responseAndUuid);
}
@Test(groups = { "worksOnlyWithLocalhostVID" })
- public void mopOwningEntityApi_doGET_RequestIdReceived() throws InterruptedException {
+ public void mopOwningEntityApi_doGET_RequestIdReceived() {
final Pair<HttpEntity, String> responseAndUuid = makeRequest(
HttpMethod.GET,
"/" + MAINTENANCE_CATEGORY_PARAMETER + "?familyName=PARAMETER_STANDARDIZATION",
null
);
- assertThatUuidInResponseAndUuidIsInARecentLog(responseAndUuid);
+ assertThatUuidInResponseAndUuidIsInARecentLog(LogName.audit, responseAndUuid);
/*
test should be for:
}
@Test
- public void schedulerApi_doPOST_RequestIdReceived() throws InterruptedException {
+ public void schedulerApi_doPOST_RequestIdReceived() {
final String anyInstanceId = "any instance id";
SimulatorApi.registerExpectation(
"/change-management/workflow/" + anyInstanceId,
"{}"
);
- assertThatUuidInResponseAndUuidIsInARecentLog(responseAndUuid);
+ assertThatUuidInResponseAndUuidIsInARecentLog(LogName.audit, responseAndUuid);
}
final Pair<HttpEntity, String> responseAndUuid = makeRequest(
HttpMethod.GET, "/healthCheck", null
);
- assertThatUuidInResponseAndUuidIsInARecentLog(responseAndUuid);
+ assertThatUuidInResponseAndUuidIsInARecentLog(LogName.audit, responseAndUuid);
}
- private void assertThatUuidInResponseAndUuidIsInARecentLog(Pair<HttpEntity, String> responseAndUuid) {
+ private void assertThatUuidInResponseAndUuidIsInARecentLog(LogName logName, Pair<HttpEntity, String> responseAndUuid) {
assertThatResponseHasUuid(responseAndUuid.getLeft(), responseAndUuid.getRight());
- assertThatTermIsInARecentLog(responseAndUuid.getRight());
+ assertThatTermIsInARecentLog(logName, responseAndUuid.getRight());
}
private void assertThatResponseHasUuid(HttpEntity response, String uuid) {
// id" filter, which is great!
Assert.assertNotNull(response);
List<String> ecompRequestIdHeaderValues = response.getHeaders().get(ECOMP_REQUEST_ID_ECHO);
- Assert.assertThat(ecompRequestIdHeaderValues, hasItem(equalToIgnoringCase(uuid)));
+ assertThat(ecompRequestIdHeaderValues, hasItem(equalToIgnoringCase(uuid)));
}
- private void assertThatTermIsInARecentLog(String uuid) {
- final ImmutableList<String> logLines = ImmutableList.of(
- LoggerFormatTest.getLogLines("audit", 20, 0, restTemplate, uri),
- LoggerFormatTest.getLogLines("error", 20, 0, restTemplate, uri)
- );
+ private void assertThatTermIsInARecentLog(LogName logName, String uuid) {
+ final String logLines = LoggerFormatTest.getLogLines(logName, 20, 0, restTemplate, uri);
- // Assert that audit *OR* error has the uuid
- assertThat("uuid not found in any log", logLines, hasItem(containsString(uuid)));
+ assertThat("uuid not found in any log", logLines, containsString(uuid));
}
private Pair<HttpEntity, String> makeRequest(HttpMethod httpMethod, String url, String body) {
SimulatorApi.registerExpectation("ecompportal_getSessionSlotCheckInterval.json", APPEND);
HttpEntity entity = new HttpEntity<>(body, headers);
- ResponseEntity<String> response = null;
- response = restTemplateErrorAgnostic.exchange(uri + url,
- httpMethod, entity, String.class);
+ ResponseEntity<String> response =
+ restTemplateErrorAgnostic.exchange(uri + url, httpMethod, entity, String.class);
return Pair.of(response, uuid);
}
it(`service name should be mandatory : serviceEcompNaming = true`, ()=> {
- cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/basicService.json').then((res) => {
+ cy.readFile('cypress/support/jsonBuilders/mocks/jsons/basicService.json').then((res) => {
jsonBuilderAAIService.basicJson(res,
Cypress.config('baseUrl') + '/rest/models/services/' + SERVICE_ID,
200,
const rollbackOnFailure : string = "true";
const projectName : string = "WATKINS";
const instanceName : string = "serviceInstanceName";
- cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/emptyServiceRedux.json').then((res) => {
+ cy.readFile('cypress/support/jsonBuilders/mocks/jsons/emptyServiceRedux.json').then((res) => {
cy.setTestApiParamToGR();
res.service.serviceHierarchy['2f80c596-27e5-4ca9-b5bb-e03a7fd4c0fd'].service.vidNotions.instantiationType = 'ALaCarte';
it(`VNF a-la-carte`, ()=> {
- cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/emptyServiceRedux.json').then((res) => {
+ cy.readFile('cypress/support/jsonBuilders/mocks/jsons/emptyServiceRedux.json').then((res) => {
cy.setTestApiParamToGR();
res.service.serviceHierarchy['2f80c596-27e5-4ca9-b5bb-e03a7fd4c0fd'].service.vidNotions.instantiationType = 'ALaCarte';
res.service.serviceHierarchy['2f80c596-27e5-4ca9-b5bb-e03a7fd4c0fd'].service.inputs = null;
});
it(`Network a-la-carte`, ()=> {
- cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/emptyServiceRedux.json').then((res) => {
+ cy.readFile('cypress/support/jsonBuilders/mocks/jsons/emptyServiceRedux.json').then((res) => {
cy.setTestApiParamToGR();
res.service.serviceHierarchy['2f80c596-27e5-4ca9-b5bb-e03a7fd4c0fd'].service.vidNotions.instantiationType = 'ALaCarte';
res.service.serviceHierarchy['2f80c596-27e5-4ca9-b5bb-e03a7fd4c0fd'].service.inputs = null;
if (new Date() < timeBomb) {
return;
}
- cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/emptyServiceRedux.json').then((res) => {
+ cy.readFile('cypress/support/jsonBuilders/mocks/jsons/emptyServiceRedux.json').then((res) => {
cy.setTestApiParamToGR();
res.service.serviceHierarchy['2f80c596-27e5-4ca9-b5bb-e03a7fd4c0fd'].service.vidNotions.instantiationType = 'ALaCarte';
res.service.serviceHierarchy['2f80c596-27e5-4ca9-b5bb-e03a7fd4c0fd'].service.inputs = null;
win.sessionStorage.clear();
cy.setReduxState();
cy.preventErrorsOnLoading();
- jsonBuilderInstantiationBuilder.basicMock('/cypress/support/jsonBuilders/mocks/jsons/asyncInstantiation.json',
+ jsonBuilderInstantiationBuilder.basicMock('cypress/support/jsonBuilders/mocks/jsons/asyncInstantiation.json',
Cypress.config('baseUrl') + "/asyncInstantiation**");
cy.initAAIMock();
cy.initVidMock();
const MACRO_FOR_NEW_FLOW_ID: string = '74fa72dd-012b-49c3-800d-06b12bcaf1a0';
const CANCEL_BUTTON = "cancelButton";
- cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/bug616888/list-services.json').then((res) => {
+ cy.readFile('cypress/support/jsonBuilders/mocks/jsons/bug616888/list-services.json').then((res) => {
jsonBuilderAndMock.basicJson(res,
Cypress.config('baseUrl') + '/rest/models/services?distributionStatus=DISTRIBUTED',
200,
'list_services');
});
- cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/bug616888/service-with-configuration.json').then((res) => {
+ cy.readFile('cypress/support/jsonBuilders/mocks/jsons/bug616888/service-with-configuration.json').then((res) => {
jsonBuilderAndMock.basicJson(res,
Cypress.config('baseUrl') + '/rest/models/services/' + MACRO_WITH_NETWORK_ID,
200,
'MACRO_WITH_CONFIGURATION');
});
- cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/bug616888/Dror_service1806_Macro1.json').then((res) => {
+ cy.readFile('cypress/support/jsonBuilders/mocks/jsons/bug616888/Dror_service1806_Macro1.json').then((res) => {
jsonBuilderAndMock.basicJson(res,
Cypress.config('baseUrl') + '/rest/models/services/' + MACRO_FOR_NEW_FLOW_ID,
200,
it(`browse sdc of service without instantiationType open aLaCarte popup`, function () {
const VERY_OLD_SERVICE_UUID: string = "09c476c7-91ae-44b8-a731-04d8d8fa3695";
- const TEST_MOCKS_PATH="/cypress/support/jsonBuilders/mocks/jsons/bug_aLaCarteServiceWrongPopup/";
+ const TEST_MOCKS_PATH="cypress/support/jsonBuilders/mocks/jsons/bug_aLaCarteServiceWrongPopup/";
const CANCEL_BUTTON = "cancelButton";
cy.login();
cy.initAAIMock();
- cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/defect710619/aaiSubDetailsE2E.json').then((res) => {
+ cy.readFile('cypress/support/jsonBuilders/mocks/jsons/defect710619/aaiSubDetailsE2E.json').then((res) => {
jsonBuilderAAISubDetailsModel.basicJson(
res,
Cypress.config('baseUrl') + "/aai_sub_details/e433710f-9217-458d-a79d-1c7aff376d89**",
describe('duplicate', () => {
it('delete vf module reduce the number of vf modules ', function () {
- cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/emptyServiceRedux.json').then((res) => {
+ cy.readFile('cypress/support/jsonBuilders/mocks/jsons/emptyServiceRedux.json').then((res) => {
cy.setReduxState(<any>res);
cy.openIframe('app/ui/#/servicePlanning?serviceModelId=2f80c596-27e5-4ca9-b5bb-e03a7fd4c0fd');
cy.drawingBoardPressAddButtonByElementName('node-2017-488_PASQUALE-vPE 0').get('i').should('have.class', 'fa-plus-circle');
});
it('create new vf module update the number of vf modules ', () => {
- cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/emptyServiceRedux.json').then((res) => {
+ cy.readFile('cypress/support/jsonBuilders/mocks/jsons/emptyServiceRedux.json').then((res) => {
cy.setReduxState(<any>res);
cy.openIframe('app/ui/#/servicePlanning?serviceModelId=2f80c596-27e5-4ca9-b5bb-e03a7fd4c0fd');
cy.drawingBoardPressAddButtonByElementName('node-2017-488_PASQUALE-vPE 0').get('i').should('have.class', 'fa-plus-circle');
});
it('duplicate vnf multi - should update number of vf modules on left side and disable duplicate when created max', () => {
- cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/emptyServiceRedux.json').then((res) => {
+ cy.readFile('cypress/support/jsonBuilders/mocks/jsons/emptyServiceRedux.json').then((res) => {
cy.setReduxState(<any>res);
cy.openIframe('app/ui/#/servicePlanning?serviceModelId=2f80c596-27e5-4ca9-b5bb-e03a7fd4c0fd');
cy.drawingBoardPressAddButtonByElementName('node-2017-488_PASQUALE-vPE 0').get('i').should('have.class', 'fa-plus-circle')
});
xit('should display service model name', () => {
- cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/emptyServiceRedux.json').then((res) => {
+ cy.readFile('cypress/support/jsonBuilders/mocks/jsons/emptyServiceRedux.json').then((res) => {
cy.setReduxState(<any>res);
cy.openIframe('app/ui/#/servicePlanning?serviceModelId=2f80c596-27e5-4ca9-b5bb-e03a7fd4c0fd');
cy.get('#service-model-name').contains('action-data');
});
it('should display icon and message if no vnf and vnfModules', () => {
- cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/emptyServiceRedux.json').then((res) => {
+ cy.readFile('cypress/support/jsonBuilders/mocks/jsons/emptyServiceRedux.json').then((res) => {
res.global.drawingBoardStatus = "CREATE";
cy.setReduxState(<any>res);
cy.openIframe('app/ui/#/servicePlanning?serviceModelId=2f80c596-27e5-4ca9-b5bb-e03a7fd4c0fd');
});
it('should show alert on remove vnf with modules', () => {
- cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/serviceWithVnfAndVfModules.json').then((res) => {
+ cy.readFile('cypress/support/jsonBuilders/mocks/jsons/serviceWithVnfAndVfModules.json').then((res) => {
cy.setReduxState(<any>res);
cy.openIframe('app/ui/#/servicePlanning?serviceModelId=2f80c596-27e5-4ca9-b5bb-e03a7fd4c0fd');
cy.drawingBoardTreeOpenContextMenuByElementDataTestId('node-69e09f68-8b63-4cc9-b9ff-860960b5db09-2017-488_PASQUALE-vPE 0');
});
it('should not show alert on remove vnf without modules', () => {
- cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/serviceWithVnfAndVfModules.json').then((res) => {
+ cy.readFile('cypress/support/jsonBuilders/mocks/jsons/serviceWithVnfAndVfModules.json').then((res) => {
cy.setReduxState(<any>res);
cy.openIframe('app/ui/#/servicePlanning?serviceModelId=2f80c596-27e5-4ca9-b5bb-e03a7fd4c0fd');
cy.drawingBoardTreeOpenContextMenuByElementDataTestId('node-0903e1c0-8e03-4936-b5c2-260653b96413-2017-388_PASQUALE-vPE 1');
});
it('should show <Automatically Assigned> if ecomp is true', () => {
- cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/emptyServiceRedux.json').then((res) => {
+ cy.readFile('cypress/support/jsonBuilders/mocks/jsons/emptyServiceRedux.json').then((res) => {
cy.setReduxState(<any>res);
cy.openIframe('app/ui/#/servicePlanning?serviceModelId=2f80c596-27e5-4ca9-b5bb-e03a7fd4c0fd');
cy.drawingBoardPressAddButtonByElementName('node-2017-388_PASQUALE-vPE 0').click({force: true});
it('should show model name if ecomp is false', () => {
const vnfModelKey: string = '2017-488_PASQUALE-vPE 0',
vnfModelName: string = '2017-488_PASQUALE-vPE';
- cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/emptyServiceRedux.json').then((res) => {
+ cy.readFile('cypress/support/jsonBuilders/mocks/jsons/emptyServiceRedux.json').then((res) => {
res.service.serviceHierarchy['2f80c596-27e5-4ca9-b5bb-e03a7fd4c0fd'].vnfs[vnfModelKey].properties.ecomp_generated_naming = 'false';
cy.setReduxState(<any>res);
cy.openIframe('app/ui/#/servicePlanning?serviceModelId=2f80c596-27e5-4ca9-b5bb-e03a7fd4c0fd');
describe('add instance open a popup', () => {
it('should add vfModule with popup with empty required instance name', () => {
- cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/serviceWithVnfAndVfModules.json').then((res) => {
+ cy.readFile('cypress/support/jsonBuilders/mocks/jsons/serviceWithVnfAndVfModules.json').then((res) => {
res.service.serviceHierarchy["2f80c596-27e5-4ca9-b5bb-e03a7fd4c0fd"].vnfs["2017-488_PASQUALE-vPE 0"].properties.ecomp_generated_naming = "false";
res.service.serviceInstance["2f80c596-27e5-4ca9-b5bb-e03a7fd4c0fd"].vnfs["2017-488_PASQUALE-vPE 0"].vfModules = [];
cy.setReduxState(<any>res);
});
it('should add vfModule with popup if empty required dynamic input', () => {
- cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/serviceWithVnfAndVfModules.json').then((res) => {
+ cy.readFile('cypress/support/jsonBuilders/mocks/jsons/serviceWithVnfAndVfModules.json').then((res) => {
res.service.serviceHierarchy["2f80c596-27e5-4ca9-b5bb-e03a7fd4c0fd"].vnfs["2017-488_PASQUALE-vPE 0"].vfModules["2017488_pasqualevpe0..2017488PasqualeVpe..PASQUALE_vRE_BV..module-1"].inputs["pasqualevpe0_bandwidth"].default = '';
res.service.serviceInstance["2f80c596-27e5-4ca9-b5bb-e03a7fd4c0fd"].vnfs["2017-488_PASQUALE-vPE 0"].vfModules = [];
cy.setReduxState(<any>res);
describe('show warning and disable deploy button on vnf missing data', () => {
it('show warning on vnf, and disable button, remove warning and enable button after edit', () => {
- cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/serviceWithVnfAndVfModules.json').then((res) => {
+ cy.readFile('cypress/support/jsonBuilders/mocks/jsons/serviceWithVnfAndVfModules.json').then((res) => {
res.service.serviceInstance['2f80c596-27e5-4ca9-b5bb-e03a7fd4c0fd'].existingVNFCounterMap['0903e1c0-8e03-4936-b5c2-260653b96413'] = 1;
res.service.serviceInstance["2f80c596-27e5-4ca9-b5bb-e03a7fd4c0fd"].validationCounter = 1;
res.service.serviceInstance["2f80c596-27e5-4ca9-b5bb-e03a7fd4c0fd"].vnfs["2017-388_PASQUALE-vPE 1"] = {
describe('vnf should automatically displayed or not according its min value and its vf-modules min value', () => {
it('vnf with min_instances value > 0 without required VF modules, should be created automatically without children', () => {
- cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/basicRedux.json').then((res) => {
+ cy.readFile('cypress/support/jsonBuilders/mocks/jsons/basicRedux.json').then((res) => {
res.service.serviceHierarchy["2f80c596-27e5-4ca9-b5bb-e03a7fd4c0fd"].vnfs["2017-488_PASQUALE-vPE 0"].properties['min_instances'] = 1;
res.service.serviceHierarchy["2f80c596-27e5-4ca9-b5bb-e03a7fd4c0fd"].vnfs["2017-488_PASQUALE-vPE 0"].vfModules["2017488_pasqualevpe0..2017488PasqualeVpe..PASQUALE_base_vPE_BV..module-0"].properties['initialCount'] = 0;
res.service.serviceHierarchy["2f80c596-27e5-4ca9-b5bb-e03a7fd4c0fd"].vfModules["2017488_pasqualevpe0..2017488PasqualeVpe..PASQUALE_base_vPE_BV..module-0"].properties['initialCount'] = 0;
});
it('vnf with min_instances value > 1 with required VF modules, should be created automatically with children only once', () => {
- cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/basicRedux.json').then((res) => {
+ cy.readFile('cypress/support/jsonBuilders/mocks/jsons/basicRedux.json').then((res) => {
res.service.serviceHierarchy["2f80c596-27e5-4ca9-b5bb-e03a7fd4c0fd"].vnfs["2017-488_PASQUALE-vPE 0"].properties['min_instances'] = 3;
cy.setReduxState(<any>res);
cy.fillServicePopup().then(() => {
it('vnf with min_instances value = 0 with required VF modules should be created automatically with its children', () => {
- cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/basicRedux.json').then((res) => {
+ cy.readFile('cypress/support/jsonBuilders/mocks/jsons/basicRedux.json').then((res) => {
res.service.serviceHierarchy["2f80c596-27e5-4ca9-b5bb-e03a7fd4c0fd"].vnfs["2017-488_PASQUALE-vPE 0"].properties['min_instances'] = 0;
cy.setReduxState(<any>res);
cy.fillServicePopup().then(() => {
it('vnf without min_instances and without required VF modules, should not exist automatically in right side', () => {
- cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/basicRedux.json').then((res) => {
+ cy.readFile('cypress/support/jsonBuilders/mocks/jsons/basicRedux.json').then((res) => {
cy.setReduxState(<any>res);
cy.fillServicePopup().then(() => {
cy.visit("welcome.htm").then(() => {
cy.preventErrorsOnLoading();
cy.initAAIMock();
cy.initVidMock();
- jsonBuilderInstantiationBuilder.basicMock('/cypress/support/jsonBuilders/mocks/jsons/asyncInstantiation.json',
+ jsonBuilderInstantiationBuilder.basicMock('cypress/support/jsonBuilders/mocks/jsons/asyncInstantiation.json',
Cypress.config('baseUrl') + "/asyncInstantiation**",
(res: any) => {
asyncRes = res;
cy.get('.dropdown-menu').find('.disabled').find(`[data-tests-id='context-menu-hide']`).should('not.exist');
cy.get('.dropdown-menu').find('.disabled').find(`[data-tests-id='context-menu-audit-info']`).should('not.exist');
});
-
+
});
const SERVICE_INSTANCE_ID: string = "f8791436-8d55-4fde-b4d5-72dd2cf13cfb";
const SERVICE_MODEL_ID: string = '6b528779-44a3-4472-bdff-9cd15ec93450';
- cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/basicNetworkModel.json').then((res) => {
+ cy.readFile('cypress/support/jsonBuilders/mocks/jsons/basicNetworkModel.json').then((res) => {
jsonBuilderAndMock.basicJson(res,
Cypress.config('baseUrl') + '/rest/models/services/6b528779-44a3-4472-bdff-9cd15ec93450',
200,
'initServiceModel');
});
- cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/basicNetworkInstance.json').then((res) => {
+ cy.readFile('cypress/support/jsonBuilders/mocks/jsons/basicNetworkInstance.json').then((res) => {
jsonBuilderAndMock.basicJson(
res,
Cypress.config('baseUrl') + "/aai_get_service_instance_topology/e433710f-9217-458d-a79d-1c7aff376d89/TYLER SILVIA/f8791436-8d55-4fde-b4d5-72dd2cf13cfb",
cy.initDrawingBoardUserPermission(<any>{isEditPermitted : false});
- cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/serviceModels/ecompNamingFalseModel.json').then((res) => {
+ cy.readFile('cypress/support/jsonBuilders/mocks/jsons/serviceModels/ecompNamingFalseModel.json').then((res) => {
jsonBuilderAndMock.basicJson(
res,
Cypress.config('baseUrl') + "/rest/models/services/6b528779-44a3-4472-bdff-9cd15ec93450",
cy.initDrawingBoardUserPermission();
- cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/serviceModels/ecompNamingFalseModel.json').then((res) => {
+ cy.readFile('cypress/support/jsonBuilders/mocks/jsons/serviceModels/ecompNamingFalseModel.json').then((res) => {
jsonBuilderAndMock.basicJson(
res,
Cypress.config('baseUrl') + "/rest/models/services/6b528779-44a3-4472-bdff-9cd15ec93450",
let jsonBuilderAAISubDetailsModel: JsonBuilder<AAISubDetailsModel> = new JsonBuilder<AAISubDetailsModel>();
let jsonBuilderAaiServiceInstances: JsonBuilder<AaiServiceInstancesModel> = new JsonBuilder<AaiServiceInstancesModel>();
beforeEach(() => {
- cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/defect710619/serviceE2E.json').then((res) => {
+ cy.readFile('cypress/support/jsonBuilders/mocks/jsons/defect710619/serviceE2E.json').then((res) => {
jsonBuilderAAIService.basicJson(
res,
Cypress.config('baseUrl') + "/rest/models/services/**",
});
- cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/defect710619/aaiSubViewEditForServiceWithSomeVFModuleE2E.json').then((res) => {
+ cy.readFile('cypress/support/jsonBuilders/mocks/jsons/defect710619/aaiSubViewEditForServiceWithSomeVFModuleE2E.json').then((res) => {
jsonBuilderAAISubViewEditModel.basicJson(
res,
Cypress.config('baseUrl') + "/aai_sub_viewedit/**",
"aai-sub-view-edit")
});
- cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/defect710619/aaiSubDetailsE2E.json').then((res) => {
+ cy.readFile('cypress/support/jsonBuilders/mocks/jsons/defect710619/aaiSubDetailsE2E.json').then((res) => {
jsonBuilderAAISubDetailsModel.basicJson(
res,
Cypress.config('baseUrl') + "/aai_sub_details/**",
"aai-sub-details")
});
- cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/defect710619/aaiServiceInstancesE2E.json').then((res) => {
+ cy.readFile('cypress/support/jsonBuilders/mocks/jsons/defect710619/aaiServiceInstancesE2E.json').then((res) => {
jsonBuilderAaiServiceInstances.basicJson(
res,
Cypress.config('baseUrl') + "/search_service_instances**",
it(`Resume Defect 710619 - with flag FLAG_1810_CR_SOFT_DELETE_ALACARTE_VF_MODULE is OFF`, function () {
- cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/flags.json').then((res) => {
+ cy.readFile('cypress/support/jsonBuilders/mocks/jsons/flags.json').then((res) => {
cy.server()
.route({
method: 'GET',
.getElementByDataTestsId('tenant').should('be.visible').select("bae71557c5bb4d5aac6743a4e5f1d054");
cy.getElementByDataTestsId('confirmResumeDeleteButton').not('.button--inactive').click().then(()=> {
cy.wait('@actualResumeCall').then(xhr => {
- cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/defect710619/expectedResumeWithVGResults.json').then((expectedResult) => {
+ cy.readFile('cypress/support/jsonBuilders/mocks/jsons/defect710619/expectedResumeWithVGResults.json').then((expectedResult) => {
cy.deepCompare(xhr.request.body, expectedResult);
});
});
win.sessionStorage.clear();
cy.preventErrorsOnLoading();
cy.initAAIMock();
- jsonBuilderAndMock.basicMock('/cypress/support/jsonBuilders/mocks/jsons/serviceModels/ecompNamingFalseModel.json',
+ jsonBuilderAndMock.basicMock('cypress/support/jsonBuilders/mocks/jsons/serviceModels/ecompNamingFalseModel.json',
Cypress.config('baseUrl') + "/rest/models/services/6b528779-44a3-4472-bdff-9cd15ec93450");
cy.initVidMock();
cy.initZones();
res.vnfs["2017-488_PASQUALE-vPE 0"].vfModules["2017488_pasqualevpe0..2017488PasqualeVpe..PASQUALE_base_vPE_BV..module-0"]["2017488_pasqualevpe0..2017488PasqualeVpe..PASQUALE_base_vPE_BV..module-0uvfot"].isFailed = true;
res.vnfs["2017-488_PASQUALE-vPE 0"].vfModules["2017488_pasqualevpe0..2017488PasqualeVpe..PASQUALE_base_vPE_BV..module-0"]["2017488_pasqualevpe0..2017488PasqualeVpe..PASQUALE_base_vPE_BV..module-0uvfot"].action = 'Create';
- cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/responceForFailedInstance.json').then((res) => {
+ cy.readFile('cypress/support/jsonBuilders/mocks/jsons/responceForFailedInstance.json').then((res) => {
jsonBuilderAndMock.basicJson(
res,
Cypress.config('baseUrl') + "/asyncInstantiation/auditStatusForRetry**",
response: searchServiceInstancesResponse
}).as('search_service_instances');
- cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/serviceModels/serviceForNewViewEdit.json').then((res) => {
+ cy.readFile('cypress/support/jsonBuilders/mocks/jsons/serviceModels/serviceForNewViewEdit.json').then((res) => {
jsonBuilderAndMock.basicJson(
res,
Cypress.config('baseUrl') + `/rest/models/services/${SERVICE_MODEL_VERSION_ID}`,
});
it('a-la-carte service instantiation popup has all required fields ', function () {
- cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/emptyServiceRedux.json').then((res1) => {
+ cy.readFile('cypress/support/jsonBuilders/mocks/jsons/emptyServiceRedux.json').then((res1) => {
res1.service.serviceHierarchy["2f80c596-27e5-4ca9-b5bb-e03a7fd4c0fd"].service.vidNotions.instantiationType = 'ALaCarte';
cy.setReduxState(<any>res1);
cy.openIframe('/app/ui/#/servicePopup?serviceModelId=2f80c596-27e5-4ca9-b5bb-e03a7fd4c0fd&isCreate=true');
});
it('a-la-carte service instantiation popup has Instance name as required', function () {
- cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/emptyServiceRedux.json').then((res1) => {
+ cy.readFile('cypress/support/jsonBuilders/mocks/jsons/emptyServiceRedux.json').then((res1) => {
res1.service.serviceHierarchy["2f80c596-27e5-4ca9-b5bb-e03a7fd4c0fd"].service.vidNotions.instantiationType = 'ALaCarte';
let isEcompNaming = false;
res1.service.serviceHierarchy["2f80c596-27e5-4ca9-b5bb-e03a7fd4c0fd"].service.serviceEcompNaming = isEcompNaming.toString();
it('should display error when api return empty data', function () {
cy.initCategoryParameter(<any>{});
- cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/emptyServiceRedux.json').then((res1) => {
+ cy.readFile('cypress/support/jsonBuilders/mocks/jsons/emptyServiceRedux.json').then((res1) => {
res1.service.categoryParameters.owningEntityList = [];
cy.setReduxState(<any>res1);
cy.openIframe('/app/ui/#/servicePopup?serviceModelId=2f80c596-27e5-4ca9-b5bb-e03a7fd4c0fd&isCreate=true');
describe('View Edit Page', function () {
describe('test view service with network', () => {
var jsonBuilderAAIService : JsonBuilder<ServiceModel> = new JsonBuilder<ServiceModel>();
- const presetsPrefix : string = '/cypress/support/jsonBuilders/mocks/jsons/';
+ const presetsPrefix : string = 'cypress/support/jsonBuilders/mocks/jsons/';
var jsonBuilderAAISubViewEditModel: JsonBuilder<AAISubViewEditModel> = new JsonBuilder<AAISubViewEditModel>();
var jsonBuilderAAISubDetailsModel: JsonBuilder<AAISubDetailsModel> = new JsonBuilder<AAISubDetailsModel>();
var jsonBuilderAaiServiceInstances: JsonBuilder<AaiServiceInstancesModel> = new JsonBuilder<AaiServiceInstancesModel>();
var jsonBuilderEmpty: JsonBuilder<Object> = new JsonBuilder<Object>();
beforeEach(() => {
- cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/basicService.json').then((res) => {
+ cy.readFile('cypress/support/jsonBuilders/mocks/jsons/basicService.json').then((res) => {
jsonBuilderAAIService.basicJson(
res,
Cypress.config('baseUrl') + "/rest/models/services/6e59c5de-f052-46fa-aa7e-2fca9d674c44",
});
- cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/aaiSubViewEditForComplexService.json').then((res) => {
+ cy.readFile('cypress/support/jsonBuilders/mocks/jsons/aaiSubViewEditForComplexService.json').then((res) => {
jsonBuilderAAISubViewEditModel.basicJson(
res,
Cypress.config('baseUrl') + "/aai_sub_viewedit/**/**/**/3f93c7cb-2fd0-4557-9514-e189b7b04f9d",
"aai-sub-view-edit")
});
- cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/aaiSubDetails.json').then((res) => {
+ cy.readFile('cypress/support/jsonBuilders/mocks/jsons/aaiSubDetails.json').then((res) => {
jsonBuilderAAISubDetailsModel.basicJson(
res,
Cypress.config('baseUrl') + "/aai_sub_details/**",
"aai-sub-details")
});
- cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/aaiServiceInstances.json').then((res) => {
+ cy.readFile('cypress/support/jsonBuilders/mocks/jsons/aaiServiceInstances.json').then((res) => {
jsonBuilderAaiServiceInstances.basicJson(
res,
Cypress.config('baseUrl') + "/search_service_instances**",
var jsonBuilderAAISubDetailsModel: JsonBuilder<AAISubDetailsModel> = new JsonBuilder<AAISubDetailsModel>();
var jsonBuilderAaiServiceInstances: JsonBuilder<AaiServiceInstancesModel> = new JsonBuilder<AaiServiceInstancesModel>();
beforeEach(() => {
- cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/basicService.json').then((res) => {
+ cy.readFile('cypress/support/jsonBuilders/mocks/jsons/basicService.json').then((res) => {
jsonBuilderAAIService.basicJson(
res,
Cypress.config('baseUrl') + "/rest/models/services/6e59c5de-f052-46fa-aa7e-2fca9d674c44",
});
- cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/aaiSubViewEditForServiceWithSomeVFModule.json').then((res) => {
+ cy.readFile('cypress/support/jsonBuilders/mocks/jsons/aaiSubViewEditForServiceWithSomeVFModule.json').then((res) => {
jsonBuilderAAISubViewEditModel.basicJson(
res,
Cypress.config('baseUrl') + "/aai_sub_viewedit/**/**/**/3f93c7cb-2fd0-4557-9514-e189b7b04f9d",
"aai-sub-view-edit")
});
- cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/aaiSubDetails.json').then((res) => {
+ cy.readFile('cypress/support/jsonBuilders/mocks/jsons/aaiSubDetails.json').then((res) => {
jsonBuilderAAISubDetailsModel.basicJson(
res,
Cypress.config('baseUrl') + "/aai_sub_details/**",
"aai-sub-details")
});
- cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/aaiServiceInstances.json').then((res) => {
+ cy.readFile('cypress/support/jsonBuilders/mocks/jsons/aaiServiceInstances.json').then((res) => {
jsonBuilderAaiServiceInstances.basicJson(
res,
Cypress.config('baseUrl') + "/search_service_instances**",
it(`Resume button display in orch status - pendingactivation, assigned - feature FLAG_VF_MODULE_RESUME_STATUS_CREATE - is OFF`, function () {
- cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/flags.json').then(() => {
+ cy.readFile('cypress/support/jsonBuilders/mocks/jsons/flags.json').then(() => {
cy.server()
.route({
method: 'GET',
it(`Soft delete button display with partial homing data from AAI`, function () {
- cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/aaiGetHomingData.json').then((res) => {
+ cy.readFile('cypress/support/jsonBuilders/mocks/jsons/aaiGetHomingData.json').then((res) => {
jsonBuilderAaiServiceInstances.basicJson(
res,
Cypress.config('baseUrl') + "/aai_get_homing_by_vfmodule/c015cc0f-0f37-4488-aabf-53795fd93cd3/a231a99c-7e75-4d6d-a0fb-5c7d26f30f77",
cy.window().then((win) => {
win.sessionStorage.clear();
});
- cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/basicService.json').then((res) => {
+ cy.readFile('cypress/support/jsonBuilders/mocks/jsons/basicService.json').then((res) => {
jsonBuilderAAIService.basicJson(
res,
Cypress.config('baseUrl') + "/rest/models/services/" + commonUuid,
changeServiceModel)
});
- cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/basicFabricConfigService.json').then((res) => {
+ cy.readFile('cypress/support/jsonBuilders/mocks/jsons/basicFabricConfigService.json').then((res) => {
jsonBuilderAAIService.basicJson(
res,
Cypress.config('baseUrl') + "/rest/models/services/6e59c5de-f052-46fa-aa7e-2fca9d671234",
"service-FabricConfig", changeFabric)
});
- cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/activeFabricConfigService.json').then((res) => {
+ cy.readFile('cypress/support/jsonBuilders/mocks/jsons/activeFabricConfigService.json').then((res) => {
jsonBuilderAAIService.basicJson(
res,
Cypress.config('baseUrl') + "/rest/models/services/6e59c5de-f052-46fa-aa7e-2fca9d675678",
"service-FabricConfig", changeFabric)
});
- cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/createdFabricConfigService.json').then((res) => {
+ cy.readFile('cypress/support/jsonBuilders/mocks/jsons/createdFabricConfigService.json').then((res) => {
jsonBuilderAAIService.basicJson(
res,
Cypress.config('baseUrl') + "/rest/models/services/6e59c5de-f052-46fa-aa7e-2fca9d679000",
"service-FabricConfig", changeFabric)
});
- cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/deactivatedFabricConfigService.json').then((res) => {
+ cy.readFile('cypress/support/jsonBuilders/mocks/jsons/deactivatedFabricConfigService.json').then((res) => {
jsonBuilderAAIService.basicJson(
res,
Cypress.config('baseUrl') + "/rest/models/services/6e59c5de-f052-46fa-aa7e-2fca9d671000",
"service-FabricConfig", changeFabric)
});
- cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/aaiSubViewEditForComplexService.json').then((res) => {
+ cy.readFile('cypress/support/jsonBuilders/mocks/jsons/aaiSubViewEditForComplexService.json').then((res) => {
jsonBuilderAAISubViewEditModel.basicJson(
res,
Cypress.config('baseUrl') + "/aai_sub_viewedit/**/**/**/3f93c7cb-2fd0-4557-9514-e189b7b04f9d",
"aai-sub-view-edit")
});
- cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/aaiSubViewEditForFabricConfigService.json').then((res) => {
+ cy.readFile('cypress/support/jsonBuilders/mocks/jsons/aaiSubViewEditForFabricConfigService.json').then((res) => {
jsonBuilderAAISubViewEditModel.basicJson(
res,
Cypress.config('baseUrl') + "/aai_sub_viewedit/**/**/**/c187e9fe-40c3-4862-b73e-84ff056205f61234",
"aai-sub-view-edit")
});
- cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/aaiSubViewEditForActiveFabricConfigService.json').then((res) => {
+ cy.readFile('cypress/support/jsonBuilders/mocks/jsons/aaiSubViewEditForActiveFabricConfigService.json').then((res) => {
jsonBuilderAAISubViewEditModel.basicJson(
res,
Cypress.config('baseUrl') + "/aai_sub_viewedit/**/**/**/c187e9fe-40c3-4862-b73e-84ff056205f65678",
"aai-sub-view-edit")
});
- cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/aaiSubViewEditForCreatedFabricConfigService.json').then((res) => {
+ cy.readFile('cypress/support/jsonBuilders/mocks/jsons/aaiSubViewEditForCreatedFabricConfigService.json').then((res) => {
jsonBuilderAAISubViewEditModel.basicJson(
res,
Cypress.config('baseUrl') + "/aai_sub_viewedit/**/**/**/c187e9fe-40c3-4862-b73e-84ff056205f69000",
"aai-sub-view-edit")
});
- cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/aaiSubViewEditForDeactivatedFabricConfigService.json').then((res) => {
+ cy.readFile('cypress/support/jsonBuilders/mocks/jsons/aaiSubViewEditForDeactivatedFabricConfigService.json').then((res) => {
jsonBuilderAAISubViewEditModel.basicJson(
res,
Cypress.config('baseUrl') + "/aai_sub_viewedit/**/**/**/c187e9fe-40c3-4862-b73e-84ff056205f61000",
"aai-sub-view-edit")
});
- cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/aaiSubDetails.json').then((res) => {
+ cy.readFile('cypress/support/jsonBuilders/mocks/jsons/aaiSubDetails.json').then((res) => {
jsonBuilderAAISubDetailsModel.basicJson(
res,
Cypress.config('baseUrl') + "/aai_sub_details/**",
"aai-sub-details")
});
- cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/aaiServiceInstancePnfs.json').then((res) => {
+ cy.readFile('cypress/support/jsonBuilders/mocks/jsons/aaiServiceInstancePnfs.json').then((res) => {
jsonBuilderPNF.basicJson(
res,
Cypress.config('baseUrl') + "/aai_get_service_instance_pnfs/**",
"aai-get-service-instance-pnfs")
});
- cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/aaiServiceInstances.json').then((res) => {
+ cy.readFile('cypress/support/jsonBuilders/mocks/jsons/aaiServiceInstances.json').then((res) => {
jsonBuilderAaiServiceInstances.basicJson(
res,
Cypress.config('baseUrl') + "/search_service_instances**",
"aai-get-service-instances")
});
- cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/emptyObjectResponse.json').then((res) => {
+ cy.readFile('cypress/support/jsonBuilders/mocks/jsons/emptyObjectResponse.json').then((res) => {
jsonBuilderEmpty.basicJson(
res,
Cypress.config('baseUrl') + "/aai_getPortMirroringConfigsData**",
"aai_getPortMirroringConfigsDate - empty response")
});
- cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/emptyObjectResponse.json').then((res) => {
+ cy.readFile('cypress/support/jsonBuilders/mocks/jsons/emptyObjectResponse.json').then((res) => {
jsonBuilderEmpty.basicJson(
res,
Cypress.config('baseUrl') + "/aai_getPortMirroringSourcePorts**",
const SERVICE_INSTANCE_ID: string = "f8791436-8d55-4fde-b4d5-72dd2cf13cfb";
const SERVICE_MODEL_ID: string = '6b528779-44a3-4472-bdff-9cd15ec93450';
- cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/serviceModels/ecompNamingFalseModel.json').then((res) => {
+ cy.readFile('cypress/support/jsonBuilders/mocks/jsons/serviceModels/ecompNamingFalseModel.json').then((res) => {
jsonBuilderInstantiationBuilder.basicJson(
res,
Cypress.config('baseUrl') + "/rest/models/services/6b528779-44a3-4472-bdff-9cd15ec93450",
const SERVICE_INSTANCE_ID: string = "f8791436-8d55-4fde-b4d5-72dd2cf13cfb";
const SERVICE_MODEL_ID: string = '6b528779-44a3-4472-bdff-9cd15ec93450';
- cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/serviceModels/ecompNamingFalseModel.json').then((res) => {
+ cy.readFile('cypress/support/jsonBuilders/mocks/jsons/serviceModels/ecompNamingFalseModel.json').then((res) => {
jsonBuilderAndMock.basicJson(
res,
Cypress.config('baseUrl') + "/rest/models/services/6b528779-44a3-4472-bdff-9cd15ec93450",
});
it('should display min/max', function () {
- cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/emptyServiceRedux.json').then((res) => {
+ cy.readFile('cypress/support/jsonBuilders/mocks/jsons/emptyServiceRedux.json').then((res) => {
res.service.serviceHierarchy['2f80c596-27e5-4ca9-b5bb-e03a7fd4c0fd'].vnfs['2017-488_PASQUALE-vPE 0'].properties.min_instances = 100;
res.service.serviceHierarchy['2f80c596-27e5-4ca9-b5bb-e03a7fd4c0fd'].vnfs['2017-488_PASQUALE-vPE 0'].properties.max_instances = 200;
cy.setReduxState(<any>res);
});
it('should display default values for undefined min/max', function () {
- cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/emptyServiceRedux.json').then((res) => {
+ cy.readFile('cypress/support/jsonBuilders/mocks/jsons/emptyServiceRedux.json').then((res) => {
res.service.serviceHierarchy['2f80c596-27e5-4ca9-b5bb-e03a7fd4c0fd'].vnfs['2017-488_PASQUALE-vPE 0'].properties.min_instances = null;
res.service.serviceHierarchy['2f80c596-27e5-4ca9-b5bb-e03a7fd4c0fd'].vnfs['2017-488_PASQUALE-vPE 0'].properties.max_instances = null;
cy.setReduxState(<any>res);
});
it('fill all fields of vnf popup', function () {
- cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/emptyServiceRedux.json').then((res) => {
+ cy.readFile('cypress/support/jsonBuilders/mocks/jsons/emptyServiceRedux.json').then((res) => {
res.service.serviceHierarchy['2f80c596-27e5-4ca9-b5bb-e03a7fd4c0fd'].vnfs['2017-488_PASQUALE-vPE 0'].min = null;
res.service.serviceHierarchy['2f80c596-27e5-4ca9-b5bb-e03a7fd4c0fd'].vnfs['2017-488_PASQUALE-vPE 0'].max = null;
cy.setReduxState(<any>res);
response: "[]",
}).as("expectedPostAsyncInstantiation");
- cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/serviceModels/ecompNamingFalseModel.json').then((res) => {
+ cy.readFile('cypress/support/jsonBuilders/mocks/jsons/serviceModels/ecompNamingFalseModel.json').then((res) => {
res.service.vidNotions.instantiationType = 'ALaCarte';
jsonBuilderAndMock.basicJson(
res,
serviceModel = res;
});
- cy.readFile('./cypress/support/jsonBuilders/mocks/jsons/vnfGroupBasicServiceInstance.json').then((res) => {
+ cy.readFile('cypress/support/jsonBuilders/mocks/jsons/vnfGroupBasicServiceInstance.json').then((res) => {
basicServiceInstance = res;
});
- cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/emptyServiceRedux.json').then((reduxRes) => {
+ cy.readFile('cypress/support/jsonBuilders/mocks/jsons/emptyServiceRedux.json').then((reduxRes) => {
reduxRes.service.serviceHierarchy[SERVICE_MODEL_ID] = serviceModel;
reduxRes.service.serviceInstance[SERVICE_MODEL_ID] = basicServiceInstance;
serviceModel = res;
});
- cy.readFile('./cypress/support/jsonBuilders/mocks/jsons/vnfGroupBasicServiceInstance.json').then((res) => {
+ cy.readFile('cypress/support/jsonBuilders/mocks/jsons/vnfGroupBasicServiceInstance.json').then((res) => {
basicServiceInstance = res;
});
- cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/emptyServiceRedux.json').then((reduxRes) => {
+ cy.readFile('cypress/support/jsonBuilders/mocks/jsons/emptyServiceRedux.json').then((reduxRes) => {
reduxRes.service.serviceHierarchy[SERVICE_MODEL_ID] = serviceModel;
reduxRes.service.serviceInstance[SERVICE_MODEL_ID] = basicServiceInstance;
)
});
- cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/emptyServiceRedux.json').then((reduxRes) => {
+ cy.readFile('cypress/support/jsonBuilders/mocks/jsons/emptyServiceRedux.json').then((reduxRes) => {
reduxRes.service.serviceHierarchy[SERVICE_MODEL_ID] = serviceModel;
it(`verifying VID version"`, function () {
const APP_VERSION = "1902.1948";
- cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/version.json').then((res) => {
+ cy.readFile('cypress/support/jsonBuilders/mocks/jsons/version.json').then((res) => {
jsonBuilderAndMock.basicJson(res,
Cypress.config('baseUrl') + '/version',
200,
it('error should display on api error', function () {
// adding call with delay of 2000 sec
- cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/asyncInstantiation.json').then((res) => {
+ cy.readFile('cypress/support/jsonBuilders/mocks/jsons/asyncInstantiation.json').then((res) => {
jsonBuilderInstantiationBuilder.basicJson(res, Cypress.config('baseUrl') + "/asyncInstantiation**", 500,0, "error 500 asyncInstantiation");
cy.openIframe('app/ui/#/instantiationStatus');
const timeBomb:Date = new Date(2018,6,10,0,0,0); //month 6 is July
if (new Date(Date.now()) > timeBomb) {
- cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/asyncInstantiation.json').then((res) => {
+ cy.readFile('cypress/support/jsonBuilders/mocks/jsons/asyncInstantiation.json').then((res) => {
jsonBuilderInstantiationBuilder.basicJson(res,
Cypress.config('baseUrl') + "/asyncInstantiation**",
Type to input with id some text
*********************************/
function setReduxState(state?: string) : void {
- cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/basicRedux.json').then((res) => {
+ cy.readFile('cypress/support/jsonBuilders/mocks/jsons/basicRedux.json').then((res) => {
cy.window().then((win) => {
win.sessionStorage.setItem('reduxState', JSON.stringify(state ? state : res));
});
}
function initGetSubscribers(response? : JSON) : void {
- cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/subscribers.json').then((res) => {
+ cy.readFile('cypress/support/jsonBuilders/mocks/jsons/subscribers.json').then((res) => {
cy.server()
.route({
method: 'GET',
}
function initAaiGetFullSubscribers(response? : JSON) : void {
- cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/subscribers.json').then((res) => {
+ cy.readFile('cypress/support/jsonBuilders/mocks/jsons/subscribers.json').then((res) => {
cy.server()
.route({
method: 'GET',
}
function initGetAAISubDetails(response? : JSON) : void {
- cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/aaiSubDetails.json').then((res) => {
+ cy.readFile('cypress/support/jsonBuilders/mocks/jsons/aaiSubDetails.json').then((res) => {
cy.server()
.route({
method: 'GET',
}
function initAlaCarteService(response? : JSON) : void {
- cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/a-la-carteService.json').then((res) => {
+ cy.readFile('cypress/support/jsonBuilders/mocks/jsons/a-la-carteService.json').then((res) => {
cy.server()
.route({
method: 'GET',
function initTenants(response? : JSON) : void {
- cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/tenants.json').then((res) => {
+ cy.readFile('cypress/support/jsonBuilders/mocks/jsons/tenants.json').then((res) => {
cy.server()
.route({
method: 'GET',
}
function initAAIServices(response? : JSON) : void {
- cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/aaiServices.json').then((res) => {
+ cy.readFile('cypress/support/jsonBuilders/mocks/jsons/aaiServices.json').then((res) => {
cy.server()
.route({
method: 'GET',
}
function initZones(response? : JSON) : void {
- cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/zones.json').then((res) => {
+ cy.readFile('cypress/support/jsonBuilders/mocks/jsons/zones.json').then((res) => {
cy.server()
.route({
method: 'GET',
}
function initActiveVPNs(response? : JSON) : void {
- cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/aaiActiveVPNs.json').then((res) => {
+ cy.readFile('cypress/support/jsonBuilders/mocks/jsons/aaiActiveVPNs.json').then((res) => {
cy.server()
.route({
method: 'GET',
}
function initGetToMenuInfo(response? : JSON) : void {
- cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/topMenuInfo.json').then((res) => {
+ cy.readFile('cypress/support/jsonBuilders/mocks/jsons/topMenuInfo.json').then((res) => {
cy.server()
.route({
method: 'GET',
function initCategoryParameter(response? : JSON) : void {
- cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/categoryParametres.json').then((res) => {
+ cy.readFile('cypress/support/jsonBuilders/mocks/jsons/categoryParametres.json').then((res) => {
cy.server()
.route({
method: 'GET',
}
function initFlags(response? : JSON, delay?: number, status?: number) : void {
- cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/flags.json').then((res) => {
+ cy.readFile('cypress/support/jsonBuilders/mocks/jsons/flags.json').then((res) => {
cy.server()
.route({
method: 'GET',
}
function initAuditInfoVID(response? : JSON, delay?: number, status?: number) : void {
- cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/auditInfoVid.json').then((res) => {
+ cy.readFile('cypress/support/jsonBuilders/mocks/jsons/auditInfoVid.json').then((res) => {
cy.server()
.route({
method: 'GET',
}
function initAuditInfoMSO(response? : JSON, delay?: number, status?: number) : void {
- cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/auditInfoMSO.json').then((res) => {
+ cy.readFile('cypress/support/jsonBuilders/mocks/jsons/auditInfoMSO.json').then((res) => {
cy.server()
.route({
method: 'GET',
}
function initAsyncInstantiation(response? : JSON, delay?: number, status?: number) : void {
- cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/basicAsyncInstantiation.json').then((res) => {
+ cy.readFile('cypress/support/jsonBuilders/mocks/jsons/basicAsyncInstantiation.json').then((res) => {
cy.server()
.route({
method: 'GET',