Enforces static imports for JUnit 4 assertions and assumptions

This commit configures Checkstyle to enforces static imports for JUnit 4
assertions and assumptions.

See gh-22932
This commit is contained in:
Sam Brannen
2019-05-12 15:13:07 +02:00
parent deecab6311
commit 73dbd06361
16 changed files with 56 additions and 53 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2016 the original author or authors.
* Copyright 2002-2019 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.
@@ -16,13 +16,14 @@
package org.springframework.cache.config;
import org.junit.Assert;
import org.junit.Test;
import org.springframework.cache.interceptor.CacheInterceptor;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.support.GenericXmlApplicationContext;
import static org.junit.Assert.assertSame;
/**
* @author Costin Leau
* @author Chris Beams
@@ -38,7 +39,7 @@ public class CacheAdviceNamespaceTests extends AbstractCacheAnnotationTests {
@Test
public void testKeyStrategy() throws Exception {
CacheInterceptor bean = this.ctx.getBean("cacheAdviceClass", CacheInterceptor.class);
Assert.assertSame(this.ctx.getBean("keyGenerator"), bean.getKeyGenerator());
assertSame(this.ctx.getBean("keyGenerator"), bean.getKeyGenerator());
}
}