+ @Test
+ public void routedRpcRegisteredUsingGlobalAsDefaultInstance() throws Exception {
+ OpendaylightTestRoutedRpcService def = Mockito.mock(OpendaylightTestRoutedRpcService.class);
+ rpcRegistry.addRpcImplementation(OpendaylightTestRoutedRpcService.class, def);
+ RpcRouter<OpendaylightTestRoutedRpcService> router = rpcRegistry.getRpcRouter(OpendaylightTestRoutedRpcService.class);
+ assertEquals(def, router.getDefaultService());
+ }
+
+ @Test
+ public void nonRoutedRegisteredAsRouted() {
+ OpendaylightTestRpcServiceService one = Mockito.mock(OpendaylightTestRpcServiceService.class);
+ try {
+ rpcRegistry.addRoutedRpcImplementation(OpendaylightTestRpcServiceService.class, one);
+ fail("RpcIsNotRoutedException should be thrown");
+ } catch (RpcIsNotRoutedException e) {
+ assertNotNull(e.getMessage());
+ } catch (Exception e) {
+ fail("RpcIsNotRoutedException should be thrown");
+ }
+
+ }
+