Hi
I am running some integration test and I have noticed some behaviour that I do
not understand.
1. The following is the output from running the "mvn clean install"
command. The test seems to pass but then I am getting the following error.
This is the method called from the test,
public final List<Card> listAll() {
return allInstances(Card.class);
}
8 Scenarios (8 passed)
24 Steps (24 passed)
0m5.731s
Tests run: 32, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 10.852 sec
Running integration.tests.smoke.EnterTopUpDetailsTest
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.14 sec <<<
FAILURE!
Results :
Tests in error:
listAll(integration.tests.smoke.EnterTopUpDetailsTest): Method
'allInstances' being invoked does not correspond to any of the object's fields
or actions.
In the same class file I am injecting the DomainObjectContainer object with
name container. If I modify the return statement to the following, then I get
a different error.
public final List<Card> listAll() {
return container.allInstances(Card.class);
}
8 Scenarios (1 failed, 7 passed)
24 Steps (1 failed, 2 skipped, 21 passed)
0m5.221s
java.lang.NullPointerException
at net.atos.tfgm.services.CardService.listAll(CardService.java:88)
at
integration.glue.simple.EnterTopUpDetailsGlue$1.<init>(EnterTopUpDetailsGlue.java:74)
at
integration.glue.simple.EnterTopUpDetailsGlue.There_are_initially_Smartis_cards(EnterTopUpDetailsGlue.java:72)
at ?.Given There are initially 3 Smartis
cards(integration/specs/simple/EnterTopUpDetailsSpec_listAllAndCreate.feature:28)
2. The second issue I have seen in the console output is that the fixtures
are getting called 3 times for everything, i.e. create table, inserts and
selects. I am not sure if there is something in configuration file that needs
changing?
10:40:59,946 [Native main DEBUG] INSERT INTO "Card"
("expiryDate","cardId","category","type","cardNumber","status","version")
VALUES (<2014-03-03>,<633597111>,<'ITSO'>,<null>,<'123456789111'>,<'Live'>,<1>)
10:40:59,946 [Native main DEBUG] INSERT INTO "Card"
("expiryDate","cardId","category","type","cardNumber","status","version")
VALUES (<2014-03-03>,<633597111>,<'ITSO'>,<null>,<'123456789111'>,<'Live'>,<1>)
10:40:59,946 [Native main DEBUG] INSERT INTO "Card"
("expiryDate","cardId","category","type","cardNumber","status","version")
VALUES (<2014-03-03>,<633597111>,<'ITSO'>,<null>,<'123456789111'>,<'Live'>,<1>)
1
Thanks
Dharmesh