Yet another stupid day.
Now that I know how to launch an app in Play framework, I thought, well, my test will launch the "fakeApplication", the one with mocks. No way. The application obviously does not start. In principle, the app should consist of a server, but in this stupid framework "server" is a member of the app. What else is there, I've no clue. Components. And the server does not start.
So I started looking at other projects having the same scala version. One after another, none of them was launching the server. It was just macking receiving the requests. Could as well call the method from the test.
Eventually found an app where the server launches! (Port 19002 is opened, according to lsof). But where is it? Play framework does not call methods. It sends messages. Via Akka. So Thread.dumpStack does not help. Somebody called someone, that's it.
And then suddenly I found, in "scalatestplay" a class that launches the server. Creates it and launches. Takes the data from the application. Why does not it do it in my project? Because I don't inherit that trait. If you do, it has an `override final def run(...)` that is called when `run` in the main test class is called, and it is called in `BeforeAndAfterAll` trait.
Ok. big deal, I'll inherit this trait.
That's where the hell rose. Because I was using (obviously) a wrong version of Scala Play. The one in that project did have the sever and launched it. The one I have in mine - does not. The difference is: one is version 2.6.3, and another is 2.6.5. Mine is 2.6.5.
So I spent the rest of the day rolling back all those stupid dependencies to the same versions as Mahesh and Qian use. These two guys write not only nicely-looking code, but also nice-looking build scripts. I appreciate it a lot.
But I ended the day when the things was almost starting. Except that some tool could not find a method in class Object.
That's when I decided to delay it till Monday. I already had some shit with Scala compiler (it was crashing, over a week ago), with tests not compiling in intellij (so I had to run it in sbt only). Now what, now some troubles with Java Native.
I bet when you read all this, you will decide never to use Scala. I'd suggest never to use Play. Ok, and I'm becoming more pessimistic about ScalaTest. I know, Bill (the author of ScalaTest) has problems at home, his father is very sick, but could not it be left alone for a while? Or is it that his two crazy women, twins, pro-Palestinian, are destryoing ScalaTest? Who knows.
So, the only reason I do all this is because, well, I don't have anything else to do. I do make some hints to the management, asking, maybe we have something more important? But it seems like no, nothing there. So I proceed.