-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added create-service command - grails/grails-core#11342
- Loading branch information
1 parent
f6f401f
commit 67c2a02
Showing
3 changed files
with
44 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
description: | ||
- Creates a Service | ||
- usage: 'create-service [service name]' | ||
- completer: org.grails.cli.interactive.completers.DomainClassCompleter | ||
- argument: "Service Name" | ||
description: "The name of the service" | ||
- flag: force | ||
description: Whether to override existing files | ||
steps: | ||
- command: render | ||
template: templates/artifacts/Service.groovy | ||
destination: grails-app/services/@artifact.package.path@/@artifact.name@Service.groovy | ||
convention: Service | ||
- command: render | ||
template: templates/testing/Service.groovy | ||
destination: src/test/groovy/@artifact.package.path@/@artifact.name@ServiceSpec.groovy | ||
convention: Service |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
@artifact.package@ | ||
import grails.gorm.transactions.Transactional | ||
|
||
@Transactional | ||
class @artifact.name@Service { | ||
|
||
def serviceMethod() { | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
@artifact.package@ | ||
import grails.testing.services.ServiceUnitTest | ||
import spock.lang.Specification | ||
|
||
class @artifact.name@ServiceSpec extends Specification implements ServiceUnitTest<@artifact.name@Service>{ | ||
|
||
def setup() { | ||
} | ||
|
||
def cleanup() { | ||
} | ||
|
||
void "test something"() { | ||
expect:"fix me" | ||
true == false | ||
} | ||
} |