X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=webapp-frontend%2Fsrc%2Fapp%2Finterceptor.mock.ts;h=25439aecfadd52744312e989b99a3bdd37e08f95;hb=095fb8c5c7ef690bc6f4317338f0716a8b7c6cb9;hp=e22c99d572571b48755ddc39c2c34a8a0ea55c4e;hpb=36be929b28929a1f52d7e3653ab04dff953842e8;p=portal%2Fnonrtric-controlpanel.git diff --git a/webapp-frontend/src/app/interceptor.mock.ts b/webapp-frontend/src/app/interceptor.mock.ts index e22c99d..25439ae 100644 --- a/webapp-frontend/src/app/interceptor.mock.ts +++ b/webapp-frontend/src/app/interceptor.mock.ts @@ -1,34 +1,94 @@ +/*- + * ========================LICENSE_START================================= + * O-RAN-SC + * %% + * Copyright (C) 2021 Nordix Foundation + * %% + * 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=================================== + */ + import { HttpEvent, HttpHandler, HttpInterceptor, HttpRequest, HttpResponse } from '@angular/common/http'; import { Injectable, Injector } from '@angular/core'; import { Observable, of } from 'rxjs'; - +import * as policyinstances1 from './mock/policy-instance-1.json'; +import * as policies from './mock/policies.json'; +import * as policyinstances2 from './mock/policy-instance-2.json'; +import * as policyinstances1Status from './mock/policy-instance-1-status.json'; +import * as policyinstances2Status from './mock/policy-instance-2-status.json'; import * as eijobs from './mock/ei-jobs.json'; import * as eiproducers from './mock/ei-producers.json'; -import * as nopolicyinstances from './mock/nopolicyinstances.json'; -import * as policytypes from './mock/policytypes.json'; +import * as policyinstanceNoType from './mock/policy-instance-notype.json'; +import * as policytypesList from './mock/policy-types.json'; +import * as policytypes1 from './mock/policy-type1.json'; import * as policyinstanceedit from './mock/policy-instance-edit.json'; -import * as policyinstances from './mock/policy-instance.json'; import * as rics from './mock/rics.json'; const urls = [ { - url: 'api/policy/policytypes', - json: policytypes + url: 'v2/policy-types', + json: policytypesList + }, + { + url: 'v2/policy-types/', + json: policytypes1 + }, + { + url: 'v2/policy-types/1', + json: policytypes1 + }, + { + url: 'v2/policies?policytype_id=', + json: policies + }, + { + url: 'v2/policies?policytype_id=1', + json: policies + }, + { + url: 'v2/policies/2000', + json: policyinstances1 }, { - url: 'api/policy/policies?type=1', - json: policyinstances + url: 'v2/policies/2100', + json: policyinstances2 }, { - url: 'api/policy/policies?type=2', - json: nopolicyinstances + url: 'v2/policies/2000/status', + json: policyinstances1Status + }, + { + url: 'v2/policies/2100/status', + json: policyinstances2Status + }, + { + url: 'v2/policies/2000?type=', + json: policyinstanceedit + }, + { + url: 'v2/policies/2100?type=', + json: policyinstanceedit + }, + { + url: 'v2/policies/2000?type=1', + json: policyinstanceedit }, { - url: 'api/policy/policies/2000?type=1', + url: 'v2/policies/2100?type=1', json: policyinstanceedit }, { - url: 'api/policy/policies/2000?ric=ric1&type=1', + url: 'v2/policies/2000?ric=ric1&type=1', json: '' }, {