@CliCommand(value = "test unit", help = "Creates a unit test class with a basic structure and with the " + "necessary testing components, for the specified class.") public void newMockTest( @CliOption( key = "class", mandatory = true, optionContext = UPDATE_PROJECT, help = "The name of the project class which this unit test class is targeting. If you consider " + "it necessary, you can also specify the package. Ex.: `--class ~.model.MyClass` (where " + "`~` is the base package). When working with multiple modules, you should specify the name" + " of the class and the module where it is. Ex.: `--class model:~.MyClass`. If the module " + "is not specified, it is assumed that the class is in the module which has the focus. ") final JavaType type, @CliOption(key = "permitReservedWords", mandatory = false, unspecifiedDefaultValue = "false", specifiedDefaultValue = "true", help = "Indicates whether reserved words are ignored by Roo. " + "Default if option present: `true`; default if option not present: `false`.") final boolean permitReservedWords) { if (!permitReservedWords) { ReservedWords.verifyReservedWordsNotPresent(type); } Validate .isTrue( BeanInfoUtils.isEntityReasonablyNamed(type), "Cannot create an integration test for an entity named 'Test' or 'TestCase' under any circumstances"); testOperations.createUnitTest(type); }
BeanInfoUtils.isEntityReasonablyNamed(klass), "Cannot create an integration test for an entity named 'Test' or 'TestCase' under any circumstances");
if (!BeanInfoUtils.isEntityReasonablyNamed(name)) { if (!permitReservedWords) { throw new IllegalArgumentException(
BeanInfoUtils.isEntityReasonablyNamed(klass), "Cannot create an integration test for an entity named 'Test' or 'TestCase' under any circumstances");
if (!BeanInfoUtils.isEntityReasonablyNamed(name)) { if (!permitReservedWords) { throw new IllegalArgumentException(