@Test
  public void testRegisterSpringBeanRemoteOnClient_RegisterHttpInvokerURL() {
    new MockUp<RemoteInvokerRegister>() {
      @Mock
      public RootBeanDefinition newClientRemoteInvokerBeanDefinition(
          final String beanID,
          final String serviceUrl,
          final Class serviceInterface,
          SpringBeanRemoteType type) {
        want.string(beanID).isEqualTo("httpinvoker/bean");
        want.string(serviceUrl).isEqualTo("${springbean.remote.baseurl}/httpinvoker/bean");
        want.object(type).isEqualTo(SpringBeanRemoteType.httpinvoker);
        return new RootBeanDefinition();
      }
    };
    new MockUp<AbstractApplicationContext>() {
      @Mock
      public Object getBean(String name) throws BeansException {
        want.string(name).isEqualTo("httpinvoker/bean");
        return null;
      }
    };

    RemoteInvokerRegister.registerSpringBeanRemoteOnClient(
        new DefaultListableBeanFactory(),
        RemoteInvokerRegisterTest_OnClientHelper.RegisterHttpInvoker.class);

    RemoteInvokerRegister.injectSpringBeanRemote(
        new StaticWebApplicationContext(),
        new RemoteInvokerRegisterTest_OnClientHelper.RegisterHttpInvoker());
  }
  @Test
  public void testRegisterSpringBeanRemoteOnClient_RegisterBoth() {
    final boolean[] newBean_visited = new boolean[] {false, false};
    final boolean[] getBean_Visited = new boolean[] {false, false};
    new MockUp<RemoteInvokerRegister>() {

      @Mock
      public RootBeanDefinition newClientRemoteInvokerBeanDefinition(
          final String beanID,
          final String serviceUrl,
          final Class serviceInterface,
          SpringBeanRemoteType type) {

        if (beanID.equals("httpinvoker/bean")) {
          newBean_visited[0] = true;
          want.string(serviceUrl).isEqualTo("${springbean.remote.baseurl}/httpinvoker/bean");
          want.object(type).isEqualTo(SpringBeanRemoteType.httpinvoker);
        } else if (beanID.equals("hessian/bean")) {
          newBean_visited[1] = true;
          want.string(serviceUrl).isEqualTo("${springbean.remote.baseurl}/hessian/bean");
          want.object(type).isEqualTo(SpringBeanRemoteType.hessian);
        }
        return new RootBeanDefinition();
      }
    };

    new MockUp<AbstractApplicationContext>() {
      @Mock
      public Object getBean(String name) throws BeansException {
        if (name.equals("httpinvoker/bean")) {
          getBean_Visited[0] = true;
        } else if (name.equals("hessian/bean")) {
          getBean_Visited[1] = true;
        }
        return null;
      }
    };
    RemoteInvokerRegister.registerSpringBeanRemoteOnClient(
        new DefaultListableBeanFactory(),
        RemoteInvokerRegisterTest_OnClientHelper.RegisterBoth.class);

    RemoteInvokerRegister.injectSpringBeanRemote(
        new StaticWebApplicationContext(),
        new RemoteInvokerRegisterTest_OnClientHelper.RegisterBoth());

    want.array(newBean_visited).isEqualTo(new Boolean[] {true, true});
    want.array(getBean_Visited).isEqualTo(new Boolean[] {true, true});
  }