I'm using mockejb framework to mock entity beans in memory, I make a lookup, mockejb brings me a proxy for the real entity. That's working.

But I needed to get a Session Bean from the container JNDI to "understand" that. I mean, when the Session Bean make a lookup to the Entity Bean, I want it to receive the bean I've mocked, not a bean from the database.

I can't mock this Session Bean because inside the method I'm trying to mock, there's a lookup to the entity bean so, I need this method to execute normally but to receive the mocked bean when lookup.

Can anybody help me?