coldbox mxunit autowire question

Im using MXunit and theres a service object that gets autowired by
coldbox. How, in the test, do I tell coldbox "autowire the object and
give it to me"?

Can you expand your question, what are you trying to do and where?

I have an MXUnit test. I want to test the service object. The service
object uses ColdBox autowiring to set various things.
AFAIK this prevents me from using createobject in the MXUnit test as I
normally would.
In the Handler it looks like simply putting "<cfproperty
name="ServiceObject="model:ServiceObject" /> is enough to make Coldbox
create it w/the autowiring. If I put that line in my MXUnit file I get
an error "Element CBCONTROLLER is undefined in APPLICATION" . So my
question is how to I get access to an autowired object in my MXUnit
BTW the MXUnit object extends


Are you wanting to test the object without its dependencies, thus mocking it’s dependencies?

Or do you want to test it with its dependencies and wirings?

This is key in to what approach you take!!

ColdBox supports both with the introduction of MockBox. I myself usually test my model objects without external dependencies, and if they need some then I use MockBox to mock them to make my testing easier and nicer.

I would give MockBox a shot. You can easily install it via Daily Build on coldbox 3.0.

Also, the base test cases, have a getModel() method that can give you the object for testing. 3.0 really capitulizes on unit testing and will have even more support for this. Most of it is already on SVN for testing.

This way, you can test with or without loading the virtual application.

Thanks Luis, getModel() in the mxunit test worked like a charm.