private ConnectionContext prepareConnectionContext() {
   ConnectionContext mockedConnectionContext = mock(ConnectionContext.class);
   FeaturesReply mockedFeaturesReply = mock(FeaturesReply.class);
   when(mockedFeaturesReply.getAuxiliaryId()).thenReturn(DUMMY_AUXILIARY_ID);
   when(mockedConnectionContext.getFeatures()).thenReturn(mockedFeaturesReply);
   return mockedConnectionContext;
 }
  @Test
  public void registerServiceTest() {

    final RpcContext mockedRpcContext = mock(RpcContext.class);
    final DeviceContext mockedDeviceContext = mock(DeviceContext.class);
    final ConnectionContext mockedConnectionContext = mock(ConnectionContext.class);

    final FeaturesReply mockedFeatures = mock(FeaturesReply.class);
    when(mockedConnectionContext.getFeatures()).thenReturn(mockedFeatures);

    final BigInteger mockedDataPathId = mock(BigInteger.class);
    when(mockedFeatures.getDatapathId()).thenReturn(mockedDataPathId);

    when(mockedDeviceContext.getPrimaryConnectionContext()).thenReturn(mockedConnectionContext);
    MdSalRegistratorUtils.registerServices(mockedRpcContext, mockedDeviceContext);
    verify(mockedRpcContext, times(NUMBER_OF_RPC_SERVICE_REGISTRATION))
        .registerRpcServiceImplementation(any(RpcService.class.getClass()), any(RpcService.class));
  }