ColdBox Framework Forums Notification: Post to Using getPlugin() in cfcUnit creates error with coldbox controller (coldspring)

Title: Using getPlugin() in cfcUnit creates error with coldbox controller (coldspring)
Thread: Using getPlugin() in cfcUnit creates error with coldbox controller (coldspring)
Forum: Need Help?
Conference: ColdBox
User: prentice I ran into a wall today writing a unit test (very new at this!), and I wasn't
sure if there is something I am doing wrong here.

I have an application that
I am passing the coldbox controller to my gateway/service so that I can access
the datasource bean and other plugins. To do this, I am following the coldbox
guide and using the coldbox factory to create the coldbox controller, like so:
<code>
  <!-- base coldbox factory definition -->
  <bean id="ColdBoxFactory"
class="oppdb_coldbox_2_5_2.coldbox.system.extras.ColdboxFactory" />

  <!--
coldbox controller -->
  <bean id="ColdBoxController"
factory-bean="ColdboxFactory" factory-method="getColdBox" />
</code>

Then
in my unit test, I am doing this:

<code>
service =
getController().getPlugin("ioc").getBean("someService");
</code>

When I
call the getPlugin() method in my unit test, it's reading the coldspring
definitions, and then throws up this error in my unit test:

Message: Bean
creation exception in coldbox.system.extras.ColdboxFactory

Detail: ColdBox
controller does not exist:The coldbox controller does not exist in application
scope. Most likely the application has not been initialized.

The question
I am wondering is this: how do I initiate the app so that my coldspring
definition would work on unit tests?
http://forums.coldboxframework.com/index.cfm?event=ehMessages.dspMessages&threadid=8A6EC886-FF65-CEF6-65606CFA2E50F4BA