SystemCommanderClientFactory { public SystemCommanderClient create(final JmxParameters jmxParameters) { return new SystemCommanderClient( jmxConnectorFactory.createJmxConnector(jmxParameters), mBeanConnector); }  SystemCommanderClient create(final JmxParameters jmxParameters);  }
@Test public void shouldCreateSystemCommanderClient() throws Exception { final JmxParameters jmxParameters = mock(JmxParameters.class); final JMXConnector jmxConnector = mock(JMXConnector.class); when(jmxConnectorFactory.createJmxConnector(jmxParameters)).thenReturn(jmxConnector); final SystemCommanderClient systemCommanderClient = systemCommanderClientFactory.create(jmxParameters); assertThat(getValueOfField(systemCommanderClient, "jmxConnector", JMXConnector.class), is(jmxConnector)); assertThat(getValueOfField(systemCommanderClient, "mBeanConnector", MBeanConnector.class), is(mBeanConnector)); }