Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TINF-324: Integration Test #151

Merged
merged 28 commits into from
May 6, 2020
Merged

Conversation

jstsddg
Copy link
Contributor

@jstsddg jstsddg commented Apr 30, 2020

Hallo zusammen, ich habe mich mal daran versucht einen Integration Test zu schreiben. Es funktioniert und nur die Token Validation Methode ist gemockt. Ich habe auch ein paar Hilfsmethoden geschrieben, bin aber mit dem Test noch nicht zufrieden, weil der einfach Gigantisch ist... Habt ihr Ideen?

Wichtig: Dieser PR implementiert noch nicht direkt TINF-342, da er auf develop und nicht auf story/TINF-243gemergt werden soll :)

@jstsddg jstsddg requested a review from a team April 30, 2020 15:53
@jstsddg jstsddg self-assigned this Apr 30, 2020
@jstsddg jstsddg added the feature Feature label Apr 30, 2020
@jstsddg jstsddg marked this pull request as draft April 30, 2020 22:29
@jstsddg
Copy link
Contributor Author

jstsddg commented Apr 30, 2020

Okay... Jetzt bin ich gerade überfragt.. Lokal kann es compilieren und die Tests laufen durch...

@jstsddg jstsddg changed the title TINF-XX: Integration Test TINF-324: Integration Test May 1, 2020
@jstsddg
Copy link
Contributor Author

jstsddg commented May 1, 2020

MockMvc ist wohl nicht "the way to go":
spring-projects/spring-boot#5574 (comment)

@jstsddg
Copy link
Contributor Author

jstsddg commented May 2, 2020

Ich habe rest-assured nicht zum laufen bekommen:

ava.lang.AbstractMethodError: Receiver class io.restassured.internal.ResponseParserRegistrar does not define or inherit an implementation of the resolved method 'abstract java.lang.Object getProperty(java.lang.String)' of interface groovy.lang.GroovyObject.
	at de.sakpaas.backend.v2.controller.LocationControllerGetLocationByIdTest.testRestAssured(LocationControllerGetLocationByIdTest.java:31)

@jstsddg
Copy link
Contributor Author

jstsddg commented May 2, 2020

Auch WebTestClient habe ich nicht hinbekommen.

Dann bleibt es beim MockMvc, der einzige Nachteil ist hier, dass die Error Antworten nicht getestet werden können. Wenn es dennoch jemand schafft, nur zu!

@@ -53,11 +53,6 @@
<artifactId>reactor-spring</artifactId>
<version>1.0.1.RELEASE</version>
</dependency>
<dependency>
<groupId>org.json</groupId>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kommt dann diese Info Meldung bei den Tests nicht mehr?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Das haben wir sowieso nie gebraucht, es kam nur immer eine Warnung dass es zweimal definiert ist und zu Problemen führen kann 😂

@jstsddg
Copy link
Contributor Author

jstsddg commented May 5, 2020

@SAKPaaS/backend
Die Tests schlagen fehl weil der DELETE /v2/users/self/favorites/{id} Endpoint im Ergebnis die favorite-Flag nicht auf false setzt. Hat da jemand eine Idee wieso?

@jstsddg jstsddg marked this pull request as ready for review May 5, 2020 14:10
@DavidSchmidt00
Copy link
Member

Sieht auf den ersten Blick gesund aus ^^
Aber nur zum Verständnis, die werden nur in der Int-Umgebung ausgeführt oder wie? Weil die ja auf die DB zugreifen

@DavidSchmidt00
Copy link
Member

Und nochmal die altbekannte Frage: Loht sich dieser Aufwand für unser kleines kack-projekt? ^^

@jstsddg
Copy link
Contributor Author

jstsddg commented May 6, 2020

@DavidSchmidt00
Diese Integration Tests laufen in einer Datenbank die für jeden Test erstellt wird, also die laufen in keiner Umgebung.

Und naja, ab jetzt ist es ja einfach nur kopieren, man lernt ja auch etwas dabei :P

@jstsddg jstsddg requested a review from a team May 6, 2020 07:52
Copy link
Member

@DavidSchmidt00 DavidSchmidt00 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ich check zwar nicht alles alles, aber lief

Copy link
Member

@benfu99 benfu99 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sieht gut aus

@r-franzke r-franzke merged commit cd02fa0 into develop May 6, 2020
@r-franzke r-franzke deleted the feature/TINF-XX-endpoint-tests branch May 6, 2020 10:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants