-
Notifications
You must be signed in to change notification settings - Fork 3
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
Add functionnal tests to JShellAPI ? #30
Comments
Hello folks! This is a recap about the work in my PR #50, it was a long journey 😄 ! While it has not been merged yet, I believe it is currently ready as all reviews have been resolved now. Acknowledgment : I’d like to thank @Alathreon and @surajkumar who provided me with good hints before I start. Also for their trust and assistance during development and PR review process. Work Done
test {
dependsOn taskBuildDockerImage
finalizedBy taskRemoveDockerImage
} 👉 Currently, these tasks were integrated only for testing. NOTE: Some Gradle knowledge was required here. Contributors unfamiliar with Gradle should consult Gradle's documentation before proceeding.
@ContextConfiguration(classes = Main.class)
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
public class JShellApiTests {
// class body
}
@Test
@DisplayName("More concise and explicit description about the test")
public void myTest() { }
testImplementation('org.springframework.boot:spring-boot-starter-test') {
exclude group: 'ch.qos.logback', module: 'logback-classic'
}
this.webTestClient.mutate()
.responseTimeout(Duration.ofSeconds(appConfig.evalTimeoutSeconds()))
.build()
.post()
.uri(endpoint)
.bodyValue(codeInput)
.exchange()
.expectStatus()
.isOk()
.expectBody(JShellResult.class)
.value((JShellResult evalResult) -> assertThat(evalResult).isNotNull())
.returnResult()
.getResponseBody();
Thanks for reading and see you in the next integration test ! |
While the wrapper is tested, the REST API isn't, which can cause some problems, because of the sheer number of moving pieces.
So adding tests that verify that the REST API works would be very useful.
Only problem, the REST API needs docker.
The text was updated successfully, but these errors were encountered: