Browse Source

Polishing

pull/24871/head
Sam Brannen 5 years ago
parent
commit
dc5ddffd03
  1. 11
      spring-test/src/main/java/org/springframework/test/context/transaction/TestContextTransactionUtils.java

11
spring-test/src/main/java/org/springframework/test/context/transaction/TestContextTransactionUtils.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2019 the original author or authors.
* Copyright 2002-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.
@ -205,14 +205,11 @@ public abstract class TestContextTransactionUtils { @@ -205,14 +205,11 @@ public abstract class TestContextTransactionUtils {
"Only one TransactionManagementConfigurer may exist in the ApplicationContext");
if (configurers.size() == 1) {
TransactionManager tm = configurers.values().iterator().next().annotationDrivenTransactionManager();
if (tm instanceof PlatformTransactionManager) {
Assert.state(tm instanceof PlatformTransactionManager, () ->
"Transaction manager specified via TransactionManagementConfigurer " +
"is not a PlatformTransactionManager: " + tm);
return (PlatformTransactionManager) tm;
}
else {
throw new IllegalStateException(
"Specified transaction manager is not a PlatformTransactionManager: " + tm);
}
}
}
// look up by type and default name

Loading…
Cancel
Save