Hide utility class constructors

Update all utility classes so that they have a private constructor. This
prevents users from accidentally creating an instance, when they should
just use the static methods directly.

Issue gh-8945
This commit is contained in:
Phillip Webb
2020-07-29 15:15:15 -07:00
committed by Rob Winch
parent 8559447357
commit 01d90c9881
61 changed files with 213 additions and 52 deletions

View File

@@ -28,8 +28,6 @@ public class Base64Tests {
@Test
public void isBase64ReturnsTrueForValidBase64() {
new Base64(); // unused
assertThat(Base64.isBase64(new byte[] { (byte) 'A', (byte) 'B', (byte) 'C', (byte) 'D' })).isTrue();
}

View File

@@ -26,7 +26,10 @@ import org.junit.AssumptionViolatedException;
import org.springframework.security.crypto.encrypt.AesBytesEncryptor.CipherAlgorithm;
public class CryptoAssumptions {
public final class CryptoAssumptions {
private CryptoAssumptions() {
}
public static void assumeGCMJCE() {
assumeAes256(CipherAlgorithm.GCM);