summary |
shortlog |
log |
commit | commitdiff |
review |
tree
raw |
patch |
inline | side by side (from parent 1:
b4bf557)
YangTextSchemaSource uses ListenableFuture only, hence we can
remove use of deprecated Futures.immediate(Failed)CheckedFuture().
Change-Id: I40e571441894c49bbea7a8c11a3854505147af3d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
* 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.controller.cluster.schema.provider.impl;
import static org.junit.Assert.assertArrayEquals;
package org.opendaylight.controller.cluster.schema.provider.impl;
import static org.junit.Assert.assertArrayEquals;
YangTextSchemaSource schemaSource = YangTextSchemaSource.delegateForByteSource(
ID, ByteSource.wrap(source.getBytes()));
Mockito.when(mockedLocalRepository.getSchemaSource(ID, YangTextSchemaSource.class)).thenReturn(
YangTextSchemaSource schemaSource = YangTextSchemaSource.delegateForByteSource(
ID, ByteSource.wrap(source.getBytes()));
Mockito.when(mockedLocalRepository.getSchemaSource(ID, YangTextSchemaSource.class)).thenReturn(
- Futures.immediateCheckedFuture(schemaSource));
+ Futures.immediateFuture(schemaSource));
Future<YangTextSchemaSourceSerializationProxy> retrievedSourceFuture =
remoteRepository.getYangTextSchemaSource(ID);
Future<YangTextSchemaSourceSerializationProxy> retrievedSourceFuture =
remoteRepository.getYangTextSchemaSource(ID);
@Test(expected = SchemaSourceException.class)
public void testGetNonExistentYangTextSchemaSource() throws Exception {
Mockito.when(mockedLocalRepository.getSchemaSource(ID, YangTextSchemaSource.class)).thenReturn(
@Test(expected = SchemaSourceException.class)
public void testGetNonExistentYangTextSchemaSource() throws Exception {
Mockito.when(mockedLocalRepository.getSchemaSource(ID, YangTextSchemaSource.class)).thenReturn(
- Futures.immediateFailedCheckedFuture(
- new SchemaSourceException("Source is not provided")));
+ Futures.immediateFailedFuture(new SchemaSourceException("Source is not provided")));
Future<YangTextSchemaSourceSerializationProxy> retrievedSourceFuture =
remoteRepository.getYangTextSchemaSource(ID);
Future<YangTextSchemaSourceSerializationProxy> retrievedSourceFuture =
remoteRepository.getYangTextSchemaSource(ID);