Search in sources :

Example 1 with MockNature

use of org.spockframework.mock.MockNature in project spock by spockframework.

the class SpockMockFactoryBean method getObject.

@Override
@SuppressWarnings("unchecked")
public T getObject() throws Exception {
    if (instance == null) {
        MockNature nature = MockNature.valueOf(mockNature.toUpperCase(Locale.ROOT));
        instance = new DetachedMockFactory().createMock(name, targetClass, nature, Collections.<String, Object>emptyMap());
    }
    return instance;
}
Also used : MockNature(org.spockframework.mock.MockNature) DetachedMockFactory(spock.mock.DetachedMockFactory)

Aggregations

MockNature (org.spockframework.mock.MockNature)1 DetachedMockFactory (spock.mock.DetachedMockFactory)1