use of org.easymock.MockControl in project maven-archetype by apache.
the class DefaultArchetypeSelectorTest method testArchetypeNotInRequestDefaultsInBatchMode.
public void testArchetypeNotInRequestDefaultsInBatchMode() throws PrompterException, IOException, UnknownGroup, ArchetypeSelectionFailure, UnknownArchetype, ArchetypeNotDefined {
ArchetypeGenerationRequest request = new ArchetypeGenerationRequest();
MockControl control = MockControl.createControl(ArchetypeSelectionQueryer.class);
ArchetypeSelectionQueryer queryer = (ArchetypeSelectionQueryer) control.getMock();
// expect it to not be called
control.replay();
selector.setArchetypeSelectionQueryer(queryer);
selector.selectArchetype(request, Boolean.FALSE, "");
control.verify();
assertEquals(DefaultArchetypeSelector.DEFAULT_ARCHETYPE_GROUPID, request.getArchetypeGroupId());
assertEquals(DefaultArchetypeSelector.DEFAULT_ARCHETYPE_ARTIFACTID, request.getArchetypeArtifactId());
assertEquals(DefaultArchetypeSelector.DEFAULT_ARCHETYPE_VERSION, request.getArchetypeVersion());
}
Aggregations