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%2FRestGetOperationTest.java;h=1bcfa8fae05d269363f3604bfb8903513ac4c593;hb=a4270b5d2b45a8c9120b39a46377bb322d36ecf9;hp=d5fd89777b0157641fe2abf2637a44e6504ac6ec;hpb=43b95227901a7d8aa4ed081bc11f9462f5321f9b;p=netconf.git diff --git a/restconf/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/test/RestGetOperationTest.java b/restconf/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/test/RestGetOperationTest.java index d5fd89777b..1bcfa8fae0 100644 --- a/restconf/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/test/RestGetOperationTest.java +++ b/restconf/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/test/RestGetOperationTest.java @@ -46,6 +46,7 @@ import org.glassfish.jersey.test.JerseyTest; import org.junit.BeforeClass; import org.junit.Ignore; import org.junit.Test; +import org.mockito.Mockito; import org.mockito.invocation.InvocationOnMock; import org.mockito.stubbing.Answer; import org.opendaylight.controller.md.sal.dom.api.DOMMountPoint; @@ -172,7 +173,8 @@ public class RestGetOperationTest extends JerseyTest { @SuppressWarnings("unchecked") @Test public void getDataWithUrlMountPoint() throws UnsupportedEncodingException, URISyntaxException, ParseException { - when(brokerFacade.readConfigurationData(any(DOMMountPoint.class), any(YangInstanceIdentifier.class))).thenReturn( + when(brokerFacade.readConfigurationData(any(DOMMountPoint.class), any(YangInstanceIdentifier.class), + Mockito.anyString())).thenReturn( prepareCnDataForMountPointTest(false)); final DOMMountPoint mountInstance = mock(DOMMountPoint.class); when(mountInstance.getSchemaContext()).thenReturn(schemaContextTestModule); @@ -202,8 +204,8 @@ public class RestGetOperationTest extends JerseyTest { @Test public void getDataWithSlashesBehindMountPoint() throws Exception { final YangInstanceIdentifier awaitedInstanceIdentifier = prepareInstanceIdentifierForList(); - when(brokerFacade.readConfigurationData(any(DOMMountPoint.class), eq(awaitedInstanceIdentifier))).thenReturn( - prepareCnDataForSlashesBehindMountPointTest()); + when(brokerFacade.readConfigurationData(any(DOMMountPoint.class), eq(awaitedInstanceIdentifier), + Mockito.anyString())).thenReturn(prepareCnDataForSlashesBehindMountPointTest()); final DOMMountPoint mountInstance = mock(DOMMountPoint.class); when(mountInstance.getSchemaContext()).thenReturn(schemaContextTestModule); final DOMMountPointService mockMountService = mock(DOMMountPointService.class); @@ -238,7 +240,8 @@ public class RestGetOperationTest extends JerseyTest { @Test public void getDataMountPointIntoHighestElement() throws UnsupportedEncodingException, URISyntaxException, ParseException { - when(brokerFacade.readConfigurationData(any(DOMMountPoint.class), any(YangInstanceIdentifier.class))).thenReturn( + when(brokerFacade.readConfigurationData(any(DOMMountPoint.class), any(YangInstanceIdentifier.class), + Mockito.anyString())).thenReturn( prepareCnDataForMountPointTest(true)); final DOMMountPoint mountInstance = mock(DOMMountPoint.class); when(mountInstance.getSchemaContext()).thenReturn(schemaContextTestModule); @@ -270,7 +273,7 @@ public class RestGetOperationTest extends JerseyTest { .withChild(ImmutableNodes.leafNode(newTestModuleQName("type"), newTestModuleQName("test-identity"))) .withChild(ImmutableNodes.leafNode(newTestModuleQName("name"), "foo")) .withChild(ImmutableNodes.leafNode(newTestModuleQName("data"), "bar")).build()).build(); - when(brokerFacade.readConfigurationData(iid)).thenReturn(data); + when(brokerFacade.readConfigurationData(iid, null)).thenReturn(data); final String uri = "/config/test-module:modules/module/test-module:test-identity/foo"; assertEquals(200, get(uri, MediaType.APPLICATION_XML)); @@ -670,7 +673,8 @@ public class RestGetOperationTest extends JerseyTest { @SuppressWarnings("unchecked") private void mockReadConfigurationDataMethod() { - when(brokerFacade.readConfigurationData(any(YangInstanceIdentifier.class))).thenReturn(answerFromGet); + when(brokerFacade.readConfigurationData(any(YangInstanceIdentifier.class), Mockito.anyString())) + .thenReturn(answerFromGet); } @SuppressWarnings("rawtypes")