diff --git a/build.gradle b/build.gradle index 8d124444..1e1514f4 100644 --- a/build.gradle +++ b/build.gradle @@ -256,8 +256,6 @@ project('spring-statemachine-autoconfigure') { testRuntime 'com.h2database:h2' testCompile 'org.springframework.boot:spring-boot-test' testCompile 'org.springframework:spring-test' - testCompile 'org.hamcrest:hamcrest-core' - testCompile 'org.hamcrest:hamcrest-library' testCompile("org.junit.jupiter:junit-jupiter-api") testCompile("org.junit.jupiter:junit-jupiter-engine") } diff --git a/spring-statemachine-autoconfigure/src/test/java/org/springframework/statemachine/boot/StateMachineAutoConfigurationTests.java b/spring-statemachine-autoconfigure/src/test/java/org/springframework/statemachine/boot/StateMachineAutoConfigurationTests.java index 2934b11d..19b1c292 100644 --- a/spring-statemachine-autoconfigure/src/test/java/org/springframework/statemachine/boot/StateMachineAutoConfigurationTests.java +++ b/spring-statemachine-autoconfigure/src/test/java/org/springframework/statemachine/boot/StateMachineAutoConfigurationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2016-2017 the original author or authors. + * Copyright 2016-2020 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,10 +15,7 @@ */ package org.springframework.statemachine.boot; -import static org.hamcrest.Matchers.instanceOf; -import static org.hamcrest.Matchers.is; -import static org.hamcrest.Matchers.notNullValue; -import static org.hamcrest.MatcherAssert.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import java.util.List; @@ -58,7 +55,7 @@ public class StateMachineAutoConfigurationTests { context = new AnnotationConfigApplicationContext(); context.register(StateMachineAutoConfiguration.class); context.refresh(); - assertThat(context.containsBean("bootStateMachineMonitor"), is(true)); + assertThat(context.containsBean("bootStateMachineMonitor")).isTrue(); } @Test @@ -67,7 +64,7 @@ public class StateMachineAutoConfigurationTests { TestPropertyValues.of("spring.statemachine.monitor.enabled=false").applyTo(context); context.register(StateMachineAutoConfiguration.class); context.refresh(); - assertThat(context.containsBean("bootStateMachineMonitor"), is(false)); + assertThat(context.containsBean("bootStateMachineMonitor")).isFalse(); } @Test @@ -79,9 +76,9 @@ public class StateMachineAutoConfigurationTests { Object compositeStateMachineMonitor = TestUtils.readField("stateMachineMonitor", stateMachine); Object orderedCompositeItem = TestUtils.readField("items", compositeStateMachineMonitor); List list = TestUtils.readField("list", orderedCompositeItem); - assertThat(list, notNullValue()); - assertThat(list.size(), is(1)); - assertThat(list.get(0), instanceOf(BootStateMachineMonitor.class)); + assertThat(list).isNotNull(); + assertThat(list.size()).isEqualTo(1); + assertThat(list.get(0)).isInstanceOf(BootStateMachineMonitor.class); } @Configuration diff --git a/spring-statemachine-autoconfigure/src/test/java/org/springframework/statemachine/boot/StateMachineJpaRepositoriesAutoConfigurationTests.java b/spring-statemachine-autoconfigure/src/test/java/org/springframework/statemachine/boot/StateMachineJpaRepositoriesAutoConfigurationTests.java index 4e98c38b..c7005b5a 100644 --- a/spring-statemachine-autoconfigure/src/test/java/org/springframework/statemachine/boot/StateMachineJpaRepositoriesAutoConfigurationTests.java +++ b/spring-statemachine-autoconfigure/src/test/java/org/springframework/statemachine/boot/StateMachineJpaRepositoriesAutoConfigurationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2016-2017 the original author or authors. + * Copyright 2016-2020 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,8 +15,7 @@ */ package org.springframework.statemachine.boot; -import static org.hamcrest.Matchers.is; -import static org.hamcrest.MatcherAssert.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Test; @@ -52,7 +51,7 @@ public class StateMachineJpaRepositoriesAutoConfigurationTests { StateMachineJpaRepositoriesAutoConfiguration.class); context.refresh(); - assertThat(context.containsBean("jpaStateRepository"), is(true)); + assertThat(context.containsBean("jpaStateRepository")).isTrue(); } @Test @@ -61,7 +60,7 @@ public class StateMachineJpaRepositoriesAutoConfigurationTests { TestPropertyValues.of("spring.statemachine.data.jpa.repositories.enabled=false").applyTo(context); context.register(StateMachineJpaRepositoriesAutoConfiguration.class); context.refresh(); - assertThat(context.containsBean("jpaStateRepository"), is(false)); + assertThat(context.containsBean("jpaStateRepository")).isFalse(); } @Configuration diff --git a/spring-statemachine-autoconfigure/src/test/java/org/springframework/statemachine/boot/StateMachineMongoDbRepositoriesAutoConfigurationTests.java b/spring-statemachine-autoconfigure/src/test/java/org/springframework/statemachine/boot/StateMachineMongoDbRepositoriesAutoConfigurationTests.java index 1e69748f..89bb5232 100644 --- a/spring-statemachine-autoconfigure/src/test/java/org/springframework/statemachine/boot/StateMachineMongoDbRepositoriesAutoConfigurationTests.java +++ b/spring-statemachine-autoconfigure/src/test/java/org/springframework/statemachine/boot/StateMachineMongoDbRepositoriesAutoConfigurationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2016-2017 the original author or authors. + * Copyright 2016-2020 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,8 +15,7 @@ */ package org.springframework.statemachine.boot; -import static org.hamcrest.Matchers.is; -import static org.hamcrest.MatcherAssert.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Test; @@ -53,7 +52,7 @@ public class StateMachineMongoDbRepositoriesAutoConfigurationTests { StateMachineMongoDbRepositoriesAutoConfiguration.class); context.refresh(); - assertThat(context.containsBean("mongoDbStateRepository"), is(true)); + assertThat(context.containsBean("mongoDbStateRepository")).isTrue(); } @Test @@ -62,7 +61,7 @@ public class StateMachineMongoDbRepositoriesAutoConfigurationTests { TestPropertyValues.of("spring.statemachine.data.redis.repositories.enabled=false").applyTo(context); context.register(StateMachineRedisRepositoriesAutoConfiguration.class); context.refresh(); - assertThat(context.containsBean("mongoDbStateRepository"), is(false)); + assertThat(context.containsBean("mongoDbStateRepository")).isFalse(); } @Configuration diff --git a/spring-statemachine-autoconfigure/src/test/java/org/springframework/statemachine/boot/StateMachineRedisRepositoriesAutoConfigurationTests.java b/spring-statemachine-autoconfigure/src/test/java/org/springframework/statemachine/boot/StateMachineRedisRepositoriesAutoConfigurationTests.java index 39835634..a175d989 100644 --- a/spring-statemachine-autoconfigure/src/test/java/org/springframework/statemachine/boot/StateMachineRedisRepositoriesAutoConfigurationTests.java +++ b/spring-statemachine-autoconfigure/src/test/java/org/springframework/statemachine/boot/StateMachineRedisRepositoriesAutoConfigurationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2016-2017 the original author or authors. + * Copyright 2016-2020 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,8 +15,7 @@ */ package org.springframework.statemachine.boot; -import static org.hamcrest.Matchers.is; -import static org.hamcrest.MatcherAssert.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Test; @@ -50,7 +49,7 @@ public class StateMachineRedisRepositoriesAutoConfigurationTests { StateMachineRedisRepositoriesAutoConfiguration.class); context.refresh(); - assertThat(context.containsBean("redisStateRepository"), is(true)); + assertThat(context.containsBean("redisStateRepository")).isTrue(); } @Test @@ -59,7 +58,7 @@ public class StateMachineRedisRepositoriesAutoConfigurationTests { TestPropertyValues.of("spring.statemachine.data.redis.repositories.enabled=false").applyTo(context); context.register(StateMachineRedisRepositoriesAutoConfiguration.class); context.refresh(); - assertThat(context.containsBean("redisStateRepository"), is(false)); + assertThat(context.containsBean("redisStateRepository")).isFalse(); } @Configuration