mirror of
https://github.com/google/nomulus
synced 2026-04-25 10:40:49 +00:00
Remove remnants of JUnit 4 rules (#1336)
<!-- Reviewable:start --> This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/google/nomulus/1336) <!-- Reviewable:end -->
This commit is contained in:
@@ -48,7 +48,7 @@ public class AppEngineEnvironment implements Closeable {
|
||||
|
||||
public AppEngineEnvironment(String appId) {
|
||||
isPlaceHolderNeeded = ApiProxy.getCurrentEnvironment() == null;
|
||||
// isPlaceHolderNeeded may be true when we are invoked in a test with AppEngineRule.
|
||||
// isPlaceHolderNeeded may be true when we are invoked in a test with AppEngineExtension.
|
||||
if (isPlaceHolderNeeded) {
|
||||
ApiProxy.setEnvironmentForCurrentThread(createAppEngineEnvironment(appId));
|
||||
}
|
||||
|
||||
@@ -20,11 +20,11 @@ import java.lang.reflect.Proxy;
|
||||
* A dummy implementation for {@link JpaTransactionManager} which throws exception when any of its
|
||||
* method is invoked.
|
||||
*
|
||||
* <p>This is used to initialize the {@link TransactionManagerFactory#jpaTm} when running unit
|
||||
* <p>This is used to initialize the {@link TransactionManagerFactory#jpaTm()} when running unit
|
||||
* tests, because obviously we cannot connect to the actual Cloud SQL backend in a unit test.
|
||||
*
|
||||
* <p>If a unit test needs to access the Cloud SQL database, it must add JpaTransactionManagerRule
|
||||
* as a JUnit rule in the test class.
|
||||
* <p>If a unit test needs to access the Cloud SQL database, it must add {@code
|
||||
* JpaTransactionManagerExtension} as a JUnit extension in the test class.
|
||||
*/
|
||||
public class DummyJpaTransactionManager {
|
||||
|
||||
@@ -37,7 +37,7 @@ public class DummyJpaTransactionManager {
|
||||
(proxy, method, args) -> {
|
||||
throw new UnsupportedOperationException(
|
||||
"JpaTransactionManager was not initialized as the runtime is detected as"
|
||||
+ " Unittest. Add JpaTransactionManagerRule in the unit test for"
|
||||
+ " Unittest. Add JpaTransactionManagerExtension in the unit test for"
|
||||
+ " initialization.");
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user