X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=models-provider%2Fsrc%2Ftest%2Fjava%2Forg%2Fonap%2Fpolicy%2Fmodels%2Fprovider%2Fimpl%2FDummyBadProviderImpl.java;h=a1339e4fd7fab6e2bb1bb283c54e452d959d4265;hb=938005505883cf7a636a8840e20e3dc8a0ad9176;hp=2ee210c138763fc5f00c4c4cca7bfefa83f70d82;hpb=fbed360c0acdc127fdf56a99401c1aea691ce57e;p=policy%2Fmodels.git diff --git a/models-provider/src/test/java/org/onap/policy/models/provider/impl/DummyBadProviderImpl.java b/models-provider/src/test/java/org/onap/policy/models/provider/impl/DummyBadProviderImpl.java index 2ee210c13..a1339e4fd 100644 --- a/models-provider/src/test/java/org/onap/policy/models/provider/impl/DummyBadProviderImpl.java +++ b/models-provider/src/test/java/org/onap/policy/models/provider/impl/DummyBadProviderImpl.java @@ -1,6 +1,8 @@ /*- * ============LICENSE_START======================================================= - * Copyright (C) 2019 Nordix Foundation. + * Copyright (C) 2019-2023 Nordix Foundation. + * Modifications Copyright (C) 2019, 2021 AT&T Intellectual Property. All rights reserved. + * Modifications Copyright (C) 2020, 2022 Bell Canada. 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. @@ -20,21 +22,28 @@ package org.onap.policy.models.provider.impl; +import jakarta.ws.rs.core.Response; +import java.util.Collection; +import java.util.Collections; +import java.util.List; import java.util.Map; - -import javax.ws.rs.core.Response; - import lombok.NonNull; - -import org.onap.policy.models.base.PfConceptKey; import org.onap.policy.models.base.PfModelException; import org.onap.policy.models.base.PfModelRuntimeException; -import org.onap.policy.models.pdp.concepts.PdpGroups; +import org.onap.policy.models.pdp.concepts.Pdp; +import org.onap.policy.models.pdp.concepts.PdpGroup; +import org.onap.policy.models.pdp.concepts.PdpGroupFilter; +import org.onap.policy.models.pdp.concepts.PdpPolicyStatus; +import org.onap.policy.models.pdp.concepts.PdpSubGroup; import org.onap.policy.models.provider.PolicyModelsProvider; -import org.onap.policy.models.tosca.legacy.concepts.LegacyGuardPolicyInput; -import org.onap.policy.models.tosca.legacy.concepts.LegacyGuardPolicyOutput; -import org.onap.policy.models.tosca.legacy.concepts.LegacyOperationalPolicy; -import org.onap.policy.models.tosca.simple.concepts.JpaToscaServiceTemplate; +import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifierOptVersion; +import org.onap.policy.models.tosca.authorative.concepts.ToscaEntityFilter; +import org.onap.policy.models.tosca.authorative.concepts.ToscaEntityKey; +import org.onap.policy.models.tosca.authorative.concepts.ToscaNodeTemplate; +import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicy; +import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicyType; +import org.onap.policy.models.tosca.authorative.concepts.ToscaServiceTemplate; +import org.onap.policy.models.tosca.authorative.concepts.ToscaTypedEntityFilter; /** * Dummy implementation of {@link PolicyModelsProvider} with bad constructor. @@ -47,116 +56,195 @@ public class DummyBadProviderImpl implements PolicyModelsProvider { } @Override - public void close() throws Exception {} + public void close() { + // do nothing + } + + @Override + public void init() { + // do nothing + } + + @Override + public List getFilteredServiceTemplateList( + @NonNull ToscaEntityFilter filter) { + return null; + } @Override - public void init() throws PfModelException {} + public ToscaServiceTemplate createServiceTemplate(@NonNull ToscaServiceTemplate serviceTemplate) { + return null; + } @Override - public JpaToscaServiceTemplate getPolicyTypes(@NonNull PfConceptKey policyTypeKey) throws PfModelException { + public ToscaServiceTemplate updateServiceTemplate(@NonNull ToscaServiceTemplate serviceTemplate) { return null; } @Override - public JpaToscaServiceTemplate createPolicyTypes(@NonNull JpaToscaServiceTemplate serviceTemplate) - throws PfModelException { + public ToscaServiceTemplate deleteServiceTemplate(@NonNull String name, @NonNull String version) { return null; } @Override - public JpaToscaServiceTemplate updatePolicyTypes(@NonNull JpaToscaServiceTemplate serviceTemplate) - throws PfModelException { + public ToscaServiceTemplate getPolicyTypes(final String name, final String version) { return null; } @Override - public JpaToscaServiceTemplate deletePolicyTypes(@NonNull PfConceptKey policyTypeKey) throws PfModelException { + public ToscaServiceTemplate createPolicyTypes(@NonNull ToscaServiceTemplate serviceTemplate) { return null; } @Override - public JpaToscaServiceTemplate getPolicies(@NonNull PfConceptKey policyKey) throws PfModelException { + public ToscaServiceTemplate updatePolicyTypes(@NonNull ToscaServiceTemplate serviceTemplate) { return null; } @Override - public JpaToscaServiceTemplate createPolicies(@NonNull JpaToscaServiceTemplate serviceTemplate) - throws PfModelException { + public ToscaServiceTemplate deletePolicyType(final String name, final String version) { return null; } @Override - public JpaToscaServiceTemplate updatePolicies(@NonNull JpaToscaServiceTemplate serviceTemplate) - throws PfModelException { + public ToscaServiceTemplate getPolicies(final String name, final String version) { return null; } @Override - public JpaToscaServiceTemplate deletePolicies(@NonNull PfConceptKey policyKey) throws PfModelException { + public ToscaServiceTemplate createPolicies(@NonNull ToscaServiceTemplate serviceTemplate) { return null; } @Override - public LegacyOperationalPolicy getOperationalPolicy(@NonNull String policyId) throws PfModelException { + public ToscaServiceTemplate updatePolicies(@NonNull ToscaServiceTemplate serviceTemplate) { return null; } @Override - public LegacyOperationalPolicy createOperationalPolicy(@NonNull LegacyOperationalPolicy legacyOperationalPolicy) - throws PfModelException { + public ToscaServiceTemplate deletePolicy(final String name, final String version) { return null; } @Override - public LegacyOperationalPolicy updateOperationalPolicy(@NonNull LegacyOperationalPolicy legacyOperationalPolicy) - throws PfModelException { + public ToscaServiceTemplate createToscaNodeTemplates(@NonNull ToscaServiceTemplate serviceTemplate) { return null; } @Override - public LegacyOperationalPolicy deleteOperationalPolicy(@NonNull String policyId) throws PfModelException { + public ToscaServiceTemplate updateToscaNodeTemplates(@NonNull ToscaServiceTemplate serviceTemplate) + throws PfModelRuntimeException { return null; } @Override - public Map getGuardPolicy(@NonNull String policyId) throws PfModelException { + public ToscaServiceTemplate deleteToscaNodeTemplate(@NonNull String name, @NonNull String version) { return null; } @Override - public Map createGuardPolicy(@NonNull LegacyGuardPolicyInput legacyGuardPolicy) - throws PfModelException { + public List>> getNodeTemplateMetadataSets(@NonNull String name, + @NonNull String version) { + return null; + } + + @Override + public List getToscaNodeTemplate(final String name, final String version) { + return null; + } + + @Override + public List getPdpGroups(String name) { + return Collections.emptyList(); + } + + @Override + public List createPdpGroups(@NonNull List pdpGroups) { + return Collections.emptyList(); + } + + @Override + public List updatePdpGroups(@NonNull List pdpGroups) { + return Collections.emptyList(); + } + + @Override + public void updatePdp(@NonNull String pdpGroupName, @NonNull String pdpSubGroup, @NonNull Pdp pdp) { + // do nothing + } + + @Override + public PdpGroup deletePdpGroup(@NonNull String name) { return null; } @Override - public Map updateGuardPolicy(@NonNull LegacyGuardPolicyInput legacyGuardPolicy) - throws PfModelException { + public List getPolicyTypeList(String name, String version) { + return Collections.emptyList(); + } + + @Override + public ToscaServiceTemplate getFilteredPolicyTypes(@NonNull ToscaEntityFilter filter) { return null; } @Override - public Map deleteGuardPolicy(@NonNull String policyId) throws PfModelException { + public List getFilteredPolicyTypeList(@NonNull ToscaEntityFilter filter) { + return Collections.emptyList(); + } + + @Override + public List getPolicyList(String name, String version) { + return Collections.emptyList(); + } + + @Override + public ToscaServiceTemplate getFilteredPolicies(@NonNull ToscaTypedEntityFilter filter) { return null; } @Override - public PdpGroups getPdpGroups(@NonNull String pdpGroupFilter) throws PfModelException { + public List getFilteredPolicyList(@NonNull ToscaTypedEntityFilter filter) { + return Collections.emptyList(); + } + + @Override + public List getFilteredPdpGroups(@NonNull PdpGroupFilter filter) { + return Collections.emptyList(); + } + + @Override + public void updatePdpSubGroup(@NonNull String pdpGroupName, @NonNull PdpSubGroup pdpSubGroup) { + // do nothing + } + + @Override + public List getAllPolicyStatus() { + // Not implemented return null; } @Override - public PdpGroups createPdpGroups(@NonNull PdpGroups pdpGroups) throws PfModelException { + public List getAllPolicyStatus(@NonNull ToscaConceptIdentifierOptVersion policy) { + // Not implemented return null; } @Override - public PdpGroups updatePdpGroups(@NonNull PdpGroups pdpGroups) throws PfModelException { + public List getGroupPolicyStatus(@NonNull String groupName) { + // Not implemented return null; } @Override - public PdpGroups deletePdpGroups(@NonNull String pdpGroupFilter) throws PfModelException { + public void cudPolicyStatus(Collection createObjs, Collection updateObjs, + Collection deleteObjs) { + // Not implemented + } + + @Override + public List getServiceTemplateList(String name, String version) { + // Not implemented return null; } }