Skip to content

Commit

Permalink
docs: minor Quarkus quickstart fixes (#1296)
Browse files Browse the repository at this point in the history
Fix bad import and unnecessarily vague testing example.

---------
Co-authored-by: Lukáš Petrovický <[email protected]>
  • Loading branch information
tomashauser authored Jan 7, 2025
1 parent 6271534 commit 40384e1
Showing 1 changed file with 7 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ public class TimetableResource {
SolverManager<Timetable, UUID> solverManager;
@POST
@Path("/solve")
public Timetable solve(Timetable problem) {
UUID problemId = UUID.randomUUID();
// Submit the problem to start solving
Expand Down Expand Up @@ -144,10 +143,6 @@ class TimetableResource {
private final var solverManager: SolverManager<Timetable, String>?
@POST
@Consumes(
MediaType.APPLICATION_JSON
)
@Produces(MediaType.TEXT_PLAIN)
fun solve(problem: Timetable?): Timetable {
val problemId = UUID.randomUUID()
// Submit the problem to start solving
Expand Down Expand Up @@ -265,7 +260,7 @@ Add the subsequent dependencies to your `build.gradle`:
--
====
include::../shared/constrainttests.adoc
include::../shared/constrainttests.adoc[]
==== Test the solver
Expand Down Expand Up @@ -311,13 +306,16 @@ import io.restassured.http.ContentType;
class TimetableResourceTest {
@Test
void solveDemoDataUntilFeasible() {
Timetable testTimetable = // setup test data
void solveDemoDataUntilFeasible() throws IOException {
// Provide the same input data shown in the text above.
Timetable testTimetable = new ObjectMapper()
.findAndRegisterModules()
.readValue(new File("src/test/resources/testing-timetable.json"), Timetable.class);
Timetable solution = given()
.contentType(ContentType.JSON)
.body(testTimetable)
.expect().contentType(ContentType.TEXT)
.expect().contentType(ContentType.JSON)
.when().post("/timetables")
.then()
.statusCode(200)
Expand Down

0 comments on commit 40384e1

Please sign in to comment.