mardi 28 mars 2023

Why is this JsonServerTest to access a domain via reflection isn't working?

We've implementing a class AutoRouterReflect that has the following method: public static Stream autorouterReflect(Object controller), where "controller" represents the DomainController we are receiving. We are filtering the methods with a specific annotation. We already implemented the Unit Tests but we also need the JsonServerTest, which we based on a StudentController already given. We addapted the code so it works, but it is exploding with the following error:

An established connection was aborted by software on the hosted computer java.net.SocketException: An established connection was aborted by software on the hosted computer at java.base/sun.nio.ch.NioSocketImpl.implRead(NioSocketImpl.java:325) ... at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1589) at TestUtilsKt.put(TestUtils.kt:17) -> this.inputStream.bufferedReader().readText() at JsonServerTestForCinema$insert_film_in_cinema$1.invoke(JsonServerTestForCinema.kt:54) -> .put(""""{"id":"4","name":"Movie Name","room":"D","duration":"102","score":"4"}""")

I would aprecciate if anybody could help or give any ideias, we are getting crazy already.

We checked the amount of parameters that the domain constructor needs and it matchs, we also tried to change the amount of parameters and it says the wrong amount of parameters passed, so it knows the amount is correct but keeps not working and we can't justify or explain why, we already analize the code back and forth and we are only reaching dead ends.





Aucun commentaire:

Enregistrer un commentaire