Fix combatibility with boot 2.x

- Change test runtime deps for RedisRule not to fail.
- Fix metrics tests to align changes in boot's
  new micrometrics.
- Fixes #410
- Fixes #418
This commit is contained in:
Janne Valkealahti
2017-10-29 15:55:24 +00:00
parent 43121435f9
commit 9a4f48708e
2 changed files with 9 additions and 3 deletions

View File

@@ -24,6 +24,8 @@ project('spring-statemachine-data-redis') {
optional "org.eclipse.persistence:javax.persistence"
testCompile project(path:":spring-statemachine-data-common", configuration:"testArtifacts")
testCompile "org.springframework.boot:spring-boot-starter-test"
testRuntime "org.apache.commons:commons-pool2"
testRuntime "redis.clients:jedis"
testRuntime "org.springframework.boot:spring-boot-starter-data-redis"
testRuntime "org.springframework.boot:spring-boot-starter-web"
}

View File

@@ -16,6 +16,7 @@
package demo.monitoring;
import static org.hamcrest.CoreMatchers.hasItems;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.CoreMatchers.notNullValue;
import static org.hamcrest.Matchers.allOf;
import static org.hamcrest.Matchers.containsInAnyOrder;
@@ -84,9 +85,12 @@ public class MonitoringTests {
perform(get("/application/metrics")).
andExpect(jsonPath("$.names", hasItems("ssm.transition.duration", "ssm.transition.transit")));
mvc.
perform(get("/application/metrics/ssm.transition.duration")).
andDo(print()).
andExpect(jsonPath("$['ssmTransitionDuration.transitionname.INITIAL_S1']", notNullValue()));
perform(get("/application/metrics/ssm.transition.transit")).
andDo(print()).
andExpect(jsonPath("$.name", is("ssm.transition.transit"))).
andExpect(jsonPath("$.measurements[0].value", is(2.0))).
andExpect(jsonPath("$.availableTags[0].tag", is("transitionName"))).
andExpect(jsonPath("$.availableTags[0].values", hasItems("EXTERNAL_S1_S2","INITIAL_S1")));
}
@Test