Skip to content

Commit

Permalink
test: fix expected engine version in the test case
Browse files Browse the repository at this point in the history
  • Loading branch information
saig0 committed Jul 11, 2023
1 parent a9c7511 commit 0df91f5
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@
*/
package org.camunda.feel.playground;

import static org.assertj.core.api.Assertions.assertThat;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;

import org.camunda.feel.FeelEngine;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
Expand All @@ -25,8 +27,13 @@ public final class VersionApiTest {

@Test
void shouldReturnVersion() throws Exception {
var expectedVersion = FeelEngine.class.getPackage().getImplementationVersion();
assertThat(expectedVersion)
.describedAs("The version should match the pattern `x.y.z`")
.matches("(\\d+).(\\d+).(\\d+)");

mvc.perform(get("/api/v1/version"))
.andExpect(status().isOk())
.andExpect(content().json("{'feelEngineVersion': '1.16.0'}"));
.andExpect(content().json("{'feelEngineVersion': '" + expectedVersion + "'}"));
}
}

0 comments on commit 0df91f5

Please sign in to comment.