-
Notifications
You must be signed in to change notification settings - Fork 951
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7fb216e
commit abdde44
Showing
1 changed file
with
35 additions
and
0 deletions.
There are no files selected for viewing
35 changes: 35 additions & 0 deletions
35
...ls-test-suite-uber/src/test/groovy/grails/test/mixin/AddToAndServiceInjectionTests.groovy
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,35 @@ | ||
package grails.test.mixin | ||
|
||
import spock.lang.Specification | ||
import grails.persistence.Entity | ||
import org.junit.Test | ||
import org.junit.Ignore | ||
|
||
/** | ||
*/ | ||
|
||
@TestFor(Ship) | ||
@Mock(Pirate) | ||
class AddToAndServiceInjectionTests { | ||
|
||
@Test | ||
@Ignore // TODO: remove when upgrading to datastore 1.0.9 | ||
void testAddTo() { | ||
def pirate = new Pirate(name: 'Billy') | ||
def ship = new Ship() | ||
ship.addToPirates(pirate) | ||
assert 1 == ship.pirates.size() | ||
} | ||
} | ||
|
||
@Entity | ||
class Pirate { | ||
String name | ||
def pirateShipService | ||
} | ||
|
||
|
||
@Entity | ||
class Ship { | ||
static hasMany = [pirates: Pirate] | ||
} |