X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=restconf%2Fsal-rest-connector%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fsal%2Frestconf%2Fimpl%2Ftest%2FRestPutConfigTest.java;h=6f61f743a2496d640a2071b6018d30f6f01c8640;hb=8e02a3899e5069ce40ad3c070a911402c78fe24e;hp=79374d029f43585d48a4ea6f5cbcb1487cec08e0;hpb=d434f750405b4509121900b677a80402c077b422;p=netconf.git diff --git a/restconf/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/test/RestPutConfigTest.java b/restconf/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/test/RestPutConfigTest.java index 79374d029f..6f61f743a2 100644 --- a/restconf/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/test/RestPutConfigTest.java +++ b/restconf/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/test/RestPutConfigTest.java @@ -1,4 +1,4 @@ -/** +/* * Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved. * * This program and the accompanying materials are made available under the @@ -36,16 +36,6 @@ import org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode; import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode; import org.opendaylight.yangtools.yang.model.api.SchemaContext; -/** - * sal-rest-connector - * org.opendaylight.controller.sal.restconf.impl.test - * - * - * - * @author Vaclav Demcak - * - * Created: May 14, 2015 - */ @RunWith(MockitoJUnitRunner.class) public class RestPutConfigTest { @@ -72,7 +62,8 @@ public class RestPutConfigTest { final MapEntryNode data = Mockito.mock(MapEntryNode.class); final QName qName = QName.create("urn:ietf:params:xml:ns:yang:test-interface", "2014-07-01", "interface"); final QName qNameKey = QName.create("urn:ietf:params:xml:ns:yang:test-interface", "2014-07-01", "name"); - final NodeIdentifierWithPredicates identWithPredicates = new NodeIdentifierWithPredicates(qName, qNameKey, "key"); + final NodeIdentifierWithPredicates identWithPredicates = + new NodeIdentifierWithPredicates(qName, qNameKey, "key"); Mockito.when(data.getNodeType()).thenReturn(qName); Mockito.when(data.getIdentifier()).thenReturn(identWithPredicates); final NormalizedNodeContext payload = new NormalizedNodeContext(iiCx, data); @@ -93,7 +84,8 @@ public class RestPutConfigTest { final MapEntryNode data = Mockito.mock(MapEntryNode.class); final QName qName = QName.create("urn:ietf:params:xml:ns:yang:test-interface", "2014-07-01", "sub-interface"); final QName qNameSubKey = QName.create("urn:ietf:params:xml:ns:yang:test-interface", "2014-07-01", "sub-name"); - final NodeIdentifierWithPredicates identWithPredicates = new NodeIdentifierWithPredicates(qName, qNameSubKey, "subkey"); + final NodeIdentifierWithPredicates identWithPredicates = + new NodeIdentifierWithPredicates(qName, qNameSubKey, "subkey"); Mockito.when(data.getNodeType()).thenReturn(qName); Mockito.when(data.getIdentifier()).thenReturn(identWithPredicates); final NormalizedNodeContext payload = new NormalizedNodeContext(iiCx, data); @@ -107,20 +99,21 @@ public class RestPutConfigTest { this.restconfService.updateConfigurationData(identifier, payload, uriInfo); } - @Test(expected=RestconfDocumentedException.class) + @Test(expected = RestconfDocumentedException.class) public void testPutConfigDataMissingUriKey() { final String identifier = "test-interface:interfaces/interface"; this.controllerCx.toInstanceIdentifier(identifier); } - @Test(expected=RestconfDocumentedException.class) + @Test(expected = RestconfDocumentedException.class) public void testPutConfigDataDiferentKey() { final String identifier = "test-interface:interfaces/interface/key"; final InstanceIdentifierContext iiCx = this.controllerCx.toInstanceIdentifier(identifier); final MapEntryNode data = Mockito.mock(MapEntryNode.class); final QName qName = QName.create("urn:ietf:params:xml:ns:yang:test-interface", "2014-07-01", "interface"); final QName qNameKey = QName.create("urn:ietf:params:xml:ns:yang:test-interface", "2014-07-01", "name"); - final NodeIdentifierWithPredicates identWithPredicates = new NodeIdentifierWithPredicates(qName, qNameKey, "notSameKey"); + final NodeIdentifierWithPredicates identWithPredicates = + new NodeIdentifierWithPredicates(qName, qNameKey, "notSameKey"); Mockito.when(data.getNodeType()).thenReturn(qName); Mockito.when(data.getIdentifier()).thenReturn(identWithPredicates); final NormalizedNodeContext payload = new NormalizedNodeContext(iiCx, data); @@ -136,7 +129,8 @@ public class RestPutConfigTest { private void mockingBrokerPut(final YangInstanceIdentifier yii, final NormalizedNode data) { final PutResult result = Mockito.mock(PutResult.class); - final CheckedFuture checkedFuture = Futures.immediateCheckedFuture(null); + final CheckedFuture checkedFuture = + Futures.immediateCheckedFuture(null); Mockito.when(this.brokerFacade.commitConfigurationDataPut(this.schemaCx, yii, data, null, null)) .thenReturn(result); Mockito.when(result.getFutureOfPutData()).thenReturn(checkedFuture);