### Question:
JNDIConnectionFactoryProvider extends AbstractControllerService implements JMSConnectionFactoryProviderDefinition { @Override public ConnectionFactory getConnectionFactory() { if (this.configured) { return this.connectionFactory; } throw new IllegalStateException("ConnectionFactory can not be obtained unless " + "this ControllerService is configured. See onConfigure(ConfigurationContext) method."); }  @Override ConnectionFactory getConnectionFactory(); @OnEnabled void enable(ConfigurationContext context); @OnDisabled void disable();  }### Answer:
@Test(expected = IllegalStateException.class) public void validateGetConnectionFactoryFailureIfServiceNotConfigured() throws Exception { new JNDIConnectionFactoryProvider().getConnectionFactory(); }