From 28a9b67eb907a2a19b999ae7504931846cf83c23 Mon Sep 17 00:00:00 2001 From: Robert Varga Date: Mon, 29 Jan 2024 00:53:43 +0100 Subject: [PATCH] Remove SchemaServiceStub We have FixedDOMSchemaService, use that instead of brewing our own. Change-Id: Ib1cf5a7ac2f9417865d98b73228a2b7b6c4281d9 Signed-off-by: Robert Varga --- .../AbstractNetconfOperationTest.java | 3 +- .../mdsal/operations/SchemaServiceStub.java | 36 ------------------- 2 files changed, 2 insertions(+), 37 deletions(-) delete mode 100644 plugins/netconf-server-mdsal/src/test/java/org/opendaylight/netconf/server/mdsal/operations/SchemaServiceStub.java diff --git a/plugins/netconf-server-mdsal/src/test/java/org/opendaylight/netconf/server/mdsal/operations/AbstractNetconfOperationTest.java b/plugins/netconf-server-mdsal/src/test/java/org/opendaylight/netconf/server/mdsal/operations/AbstractNetconfOperationTest.java index c6b59d34db..ccf3402137 100644 --- a/plugins/netconf-server-mdsal/src/test/java/org/opendaylight/netconf/server/mdsal/operations/AbstractNetconfOperationTest.java +++ b/plugins/netconf-server-mdsal/src/test/java/org/opendaylight/netconf/server/mdsal/operations/AbstractNetconfOperationTest.java @@ -37,6 +37,7 @@ import org.mockito.junit.MockitoJUnitRunner; import org.opendaylight.mdsal.common.api.LogicalDatastoreType; import org.opendaylight.mdsal.dom.api.DOMSchemaService; import org.opendaylight.mdsal.dom.broker.SerializedDOMDataBroker; +import org.opendaylight.mdsal.dom.spi.FixedDOMSchemaService; import org.opendaylight.mdsal.dom.spi.store.DOMStore; import org.opendaylight.mdsal.dom.store.inmemory.InMemoryDOMDataStoreFactory; import org.opendaylight.netconf.api.xml.XmlUtil; @@ -87,7 +88,7 @@ public abstract class AbstractNetconfOperationTest { XMLUnit.setIgnoreWhitespace(true); XMLUnit.setIgnoreAttributeOrder(true); - final DOMSchemaService schemaService = new SchemaServiceStub(SCHEMA_CONTEXT); + final DOMSchemaService schemaService = new FixedDOMSchemaService(SCHEMA_CONTEXT); final DOMStore operStore = InMemoryDOMDataStoreFactory.create("DOM-OPER", schemaService); final DOMStore configStore = InMemoryDOMDataStoreFactory.create("DOM-CFG", schemaService); diff --git a/plugins/netconf-server-mdsal/src/test/java/org/opendaylight/netconf/server/mdsal/operations/SchemaServiceStub.java b/plugins/netconf-server-mdsal/src/test/java/org/opendaylight/netconf/server/mdsal/operations/SchemaServiceStub.java deleted file mode 100644 index 013c846e0b..0000000000 --- a/plugins/netconf-server-mdsal/src/test/java/org/opendaylight/netconf/server/mdsal/operations/SchemaServiceStub.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) 2018 Cisco Systems, Inc. and others. All rights reserved. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0 which accompanies this distribution, - * and is available at http://www.eclipse.org/legal/epl-v10.html - */ -package org.opendaylight.netconf.server.mdsal.operations; - -import static java.util.Objects.requireNonNull; - -import java.util.function.Consumer; -import org.opendaylight.mdsal.dom.api.DOMSchemaService; -import org.opendaylight.yangtools.concepts.Registration; -import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext; - -final class SchemaServiceStub implements DOMSchemaService { - private final EffectiveModelContext schemaContext; - - SchemaServiceStub(final EffectiveModelContext schemaContext) { - this.schemaContext = requireNonNull(schemaContext); - } - - @Override - public EffectiveModelContext getGlobalContext() { - return schemaContext; - } - - @Override - public Registration registerSchemaContextListener(final Consumer listener) { - listener.accept(schemaContext); - return () -> { - // No-op - }; - } -} -- 2.36.6