Functional test is not working with evolutions and fake application

18 views
Skip to first unread message

Hawk

unread,
Jan 22, 2018, 1:31:52 AM1/22/18
to Play Framework
Hello,

This took me few days in vain. I am trying to run the following simple test:


public class ManagerTest {

@Before
public void start(){
    Application fakeApp = fakeApplication();
}

@Test
public void
onboard() {
   
ObjectNode properJson = Json.newObject();
    properJson
.put("material_number","xxxxx");
    properJson
.put("serial_number","xxxxxxxxx");
    properJson
.put("idtype","TID");


   
Result result = route(fakeRequest("POST", "/v1/onbaord").bodyJson(properJson));
   
assertEquals(OK, result.status());
}

@After
public void stopApp() throws Exception {
        Helpers.stop(application);
}

}


My application has evolutions. Every time I run this test, I get the error: 

Invalid SQL type: sqlKind = UNINITIALIZED [ERROR:17439, SQLSTATE:99999]

I do not get this error when I run the application for development. Only when I run the test. 



Hawk

unread,
Jan 22, 2018, 1:34:07 AM1/22/18
to Play Framework
Using Play 2.5.9. ebean 3.0.1
Reply all
Reply to author
Forward
0 new messages