Search in sources :

Example 6 with ControllerContext

use of org.opendaylight.netconf.sal.restconf.impl.ControllerContext in project netconf by opendaylight.

the class RestPutListDataTest method initialize.

@Before
public void initialize() throws FileNotFoundException {
    final ControllerContext controllerContext = TestRestconfUtils.newControllerContext(schemaContextTestModule);
    brokerFacade = mock(BrokerFacade.class);
    restconfImpl = RestconfImpl.newInstance(brokerFacade, controllerContext);
    final PutResult result = mock(PutResult.class);
    when(brokerFacade.commitConfigurationDataPut(any(EffectiveModelContext.class), any(YangInstanceIdentifier.class), any(NormalizedNode.class), Mockito.anyString(), Mockito.anyString())).thenReturn(result);
    when(result.getFutureOfPutData()).thenReturn(mock(FluentFuture.class));
    when(result.getStatus()).thenReturn(Status.OK);
}
Also used : FluentFuture(com.google.common.util.concurrent.FluentFuture) ControllerContext(org.opendaylight.netconf.sal.restconf.impl.ControllerContext) NormalizedNode(org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode) PutResult(org.opendaylight.netconf.sal.restconf.impl.PutResult) YangInstanceIdentifier(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier) BrokerFacade(org.opendaylight.netconf.sal.restconf.impl.BrokerFacade) EffectiveModelContext(org.opendaylight.yangtools.yang.model.api.EffectiveModelContext) Before(org.junit.Before)

Aggregations

ControllerContext (org.opendaylight.netconf.sal.restconf.impl.ControllerContext)6 ResourceConfig (org.glassfish.jersey.server.ResourceConfig)3 JsonNormalizedNodeBodyReader (org.opendaylight.netconf.sal.rest.impl.JsonNormalizedNodeBodyReader)3 NormalizedNodeJsonBodyWriter (org.opendaylight.netconf.sal.rest.impl.NormalizedNodeJsonBodyWriter)3 NormalizedNodeXmlBodyWriter (org.opendaylight.netconf.sal.rest.impl.NormalizedNodeXmlBodyWriter)3 RestconfDocumentedExceptionMapper (org.opendaylight.netconf.sal.rest.impl.RestconfDocumentedExceptionMapper)3 XmlNormalizedNodeBodyReader (org.opendaylight.netconf.sal.rest.impl.XmlNormalizedNodeBodyReader)3 BrokerFacade (org.opendaylight.netconf.sal.restconf.impl.BrokerFacade)3 EffectiveModelContext (org.opendaylight.yangtools.yang.model.api.EffectiveModelContext)3 Before (org.junit.Before)2 YangInstanceIdentifier (org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier)2 FluentFuture (com.google.common.util.concurrent.FluentFuture)1 Test (org.junit.Test)1 DOMMountPoint (org.opendaylight.mdsal.dom.api.DOMMountPoint)1 DOMSchemaService (org.opendaylight.mdsal.dom.api.DOMSchemaService)1 FixedDOMSchemaService (org.opendaylight.mdsal.dom.spi.FixedDOMSchemaService)1 JSONRestconfServiceImpl (org.opendaylight.netconf.sal.restconf.impl.JSONRestconfServiceImpl)1 PutResult (org.opendaylight.netconf.sal.restconf.impl.PutResult)1 NodeIdentifierWithPredicates (org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates)1 PathArgument (org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument)1