2 * This file is part of memoization.java. It is subject to the license terms in the LICENSE file found in the top-level
3 * directory of this distribution and at http://creativecommons.org/publicdomain/zero/1.0/. No part of memoization.java,
4 * including this file, may be copied, modified, propagated, or distributed except according to the terms contained
7 package de
.xn__ho_hia
.memoization
.jcache
;
9 import java
.lang
.reflect
.Constructor
;
10 import java
.lang
.reflect
.InvocationTargetException
;
11 import java
.lang
.reflect
.Modifier
;
13 import org
.junit
.Assert
;
14 import org
.junit
.Test
;
16 import de
.xn__ho_hia
.quality
.suppression
.CompilerWarnings
;
21 @SuppressWarnings({ CompilerWarnings
.NLS
, CompilerWarnings
.STATIC_METHOD
})
22 public class JCacheMemoizeTest
{
25 * @throws NoSuchMethodException
27 * @throws IllegalAccessException
29 * @throws InvocationTargetException
31 * @throws InstantiationException
35 public void shouldDeclarePrivateConstructor()
36 throws NoSuchMethodException
, IllegalAccessException
, InvocationTargetException
, InstantiationException
{
38 final Constructor
<JCacheMemoize
> constructor
= JCacheMemoize
.class.getDeclaredConstructor();
41 final boolean isPrivate
= Modifier
.isPrivate(constructor
.getModifiers());
44 Assert
.assertTrue("Constructor is not private", isPrivate
);
45 constructor
.setAccessible(true);
46 constructor
.newInstance();