- Remove unused imports.
- Fix some deprecations in boot 2.x
This commit is contained in:
Janne Valkealahti
2017-10-29 16:36:53 +00:00
parent 9a4f48708e
commit be57d1a42e
5 changed files with 12 additions and 13 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2016 the original author or authors.
* Copyright 2016-2017 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.
@@ -24,7 +24,7 @@ import java.util.List;
import org.junit.After;
import org.junit.Test;
import org.springframework.boot.test.util.EnvironmentTestUtils;
import org.springframework.boot.test.util.TestPropertyValues;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.Configuration;
import org.springframework.statemachine.StateMachine;
@@ -64,7 +64,7 @@ public class StateMachineAutoConfigurationTests {
@Test
public void testMonitorDisabled() throws Exception {
context = new AnnotationConfigApplicationContext();
EnvironmentTestUtils.addEnvironment(context, "spring.statemachine.monitor.enabled:false");
TestPropertyValues.of("spring.statemachine.monitor.enabled=false").applyTo(context);
context.register(StateMachineAutoConfiguration.class);
context.refresh();
assertThat(context.containsBean("bootStateMachineMonitor"), is(false));

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2016 the original author or authors.
* Copyright 2016-2017 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.
@@ -23,7 +23,7 @@ import org.junit.Test;
import org.springframework.boot.autoconfigure.data.jpa.JpaRepositoriesAutoConfiguration;
import org.springframework.boot.autoconfigure.jdbc.EmbeddedDataSourceConfiguration;
import org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration;
import org.springframework.boot.test.util.EnvironmentTestUtils;
import org.springframework.boot.test.util.TestPropertyValues;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.Configuration;
import org.springframework.statemachine.boot.autoconfigure.StateMachineJpaRepositoriesAutoConfiguration;
@@ -58,7 +58,7 @@ public class StateMachineJpaRepositoriesAutoConfigurationTests {
@Test
public void testJpaDisabled() throws Exception {
context = new AnnotationConfigApplicationContext();
EnvironmentTestUtils.addEnvironment(context, "spring.statemachine.data.jpa.repositories.enabled:false");
TestPropertyValues.of("spring.statemachine.data.jpa.repositories.enabled=false").applyTo(context);
context.register(StateMachineJpaRepositoriesAutoConfiguration.class);
context.refresh();
assertThat(context.containsBean("jpaStateRepository"), is(false));

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2016 the original author or authors.
* Copyright 2016-2017 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.
@@ -23,7 +23,7 @@ import org.junit.Test;
import org.springframework.boot.autoconfigure.data.mongo.MongoDataAutoConfiguration;
import org.springframework.boot.autoconfigure.data.mongo.MongoRepositoriesAutoConfiguration;
import org.springframework.boot.autoconfigure.mongo.MongoAutoConfiguration;
import org.springframework.boot.test.util.EnvironmentTestUtils;
import org.springframework.boot.test.util.TestPropertyValues;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.Configuration;
import org.springframework.statemachine.boot.autoconfigure.StateMachineMongoDbRepositoriesAutoConfiguration;
@@ -59,7 +59,7 @@ public class StateMachineMongoDbRepositoriesAutoConfigurationTests {
@Test
public void testMongoDisabled() throws Exception {
context = new AnnotationConfigApplicationContext();
EnvironmentTestUtils.addEnvironment(context, "spring.statemachine.data.redis.repositories.enabled:false");
TestPropertyValues.of("spring.statemachine.data.redis.repositories.enabled=false").applyTo(context);
context.register(StateMachineRedisRepositoriesAutoConfiguration.class);
context.refresh();
assertThat(context.containsBean("mongoDbStateRepository"), is(false));

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2016 the original author or authors.
* Copyright 2016-2017 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.
@@ -22,7 +22,7 @@ import org.junit.After;
import org.junit.Test;
import org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration;
import org.springframework.boot.autoconfigure.data.redis.RedisRepositoriesAutoConfiguration;
import org.springframework.boot.test.util.EnvironmentTestUtils;
import org.springframework.boot.test.util.TestPropertyValues;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.Configuration;
import org.springframework.statemachine.boot.autoconfigure.StateMachineRedisRepositoriesAutoConfiguration;
@@ -56,7 +56,7 @@ public class StateMachineRedisRepositoriesAutoConfigurationTests {
@Test
public void testRedisDisabled() throws Exception {
context = new AnnotationConfigApplicationContext();
EnvironmentTestUtils.addEnvironment(context, "spring.statemachine.data.redis.repositories.enabled:false");
TestPropertyValues.of("spring.statemachine.data.redis.repositories.enabled=false").applyTo(context);
context.register(StateMachineRedisRepositoriesAutoConfiguration.class);
context.refresh();
assertThat(context.containsBean("redisStateRepository"), is(false));

View File

@@ -17,7 +17,6 @@ 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;
import static org.hamcrest.Matchers.containsString;