Configuration implements ConfigurationOptionKeys { public String getName() { return getStringValue(name, generateAnnotation.name()); } Configuration(String sourceElementName, SourceVersion targetSourceVersion, VALJOGenerate annotation, Locale optDefaultLocale, Map<String, String> options);  Configuration(String sourceElementName, SourceVersion targetSourceVersion, VALJOGenerate annotation,	VALJOConfigure configureAnnotation, Locale optDefaultLocale, Map<String, String> options); SourceVersion getTargetSourceVersion(); boolean isTargetSourceVersionJava6OrHigher(); boolean isTargetSourceVersionJava7OrHigher(); boolean isTargetSourceVersionJava8OrHigher(); String getSourceElementName(); Date getExecutionDate(); String getLocaleTag(); Locale getLocale(); int getLineWidth(); EnumSet<Modifier> getClazzModifiers(); Mutability getMutability(); DataConversion getDataConversion(); boolean isFinalMembersAndParametersEnabled(); boolean isFinalMethodsEnabled(); boolean isStaticFactoryMethodEnabled(); boolean isEnsureNotNullEnabled(); boolean isSynchronizedAccessEnabled(); boolean isMalformedPropertiesIgnored(); String getPackage(); String getName(); String[] getImportClasses(); String[] getExtraInterfaces(); String[] getGetterPrefixes(); String[] getSetterPrefixes(); boolean isThisAsImmutableSetterReturnTypeEnabled(); String getBaseClazzName(); String[] getBaseClazzConstructors(); String getSuggestedVariablesPrefix(); long getSerialVersionUID(); boolean getSerialVersionUIDSpecified(); boolean isEqualsEnabled(); boolean isHashEnabled(); String[] getComparableMembers(); boolean isToStringEnabled(); boolean isInsertInheritDocOnMethodsEnabled(); String getHeaderFileName(); String getCustomJavaTemplateFileName(); String getClazzJavaDoc(); String[] getClazzAnnotations(); List<KeyValuePair<String, String>> getMethodAnnotations(); List<KeyValuePair<String, String>> getMethodAnnotations(Predicate<String> overloadNameFilter); List<KeyValuePair<String, String>> getMemberAnnotations(); List<KeyValuePair<String, String>> getMemberAnnotations(Predicate<String> overloadNameFilter); boolean isWarningAboutSynthesisedNamesEnabled(); Level getLogLevel(); boolean isDebugStringTemplatesEnabled(); String getComment(); String getSourcePath(); String getLogFile(); @Override String toString();  }
@Test public void checkConfigurationOptionKeysCorrespondToAnnotationMethods() throws NoSuchMethodException, SecurityException { Class<VALJOConfigure> configureAnnotation = VALJOConfigure.class; Class<VALJOGenerate> generateAnnotation = VALJOGenerate.class; Set<String> configureAnnotationMethodsString = concat(Arrays.stream(configureAnnotation.getMethods()) .filter(m -> m.getDeclaringClass().equals(configureAnnotation)) .map(m -> m.getName()), Arrays.stream(generateAnnotation.getMethods()) .filter(m -> m.getDeclaringClass().equals(generateAnnotation)) .map(m -> m.getName())) .collect(toSet()); for (Field f : ConfigurationOptionKeys.class.getFields()) { String optionName = f.getName(); boolean optionOnly = optionName.toUpperCase().endsWith(optionName); if (!optionOnly) { boolean found = (configureAnnotationMethodsString.contains(optionName)); Assert.assertTrue("Option ConfigurationOptionKeys."+optionName+" must correspond with attribute method on either "+configureAnnotation.getSimpleName()+" or "+generateAnnotation.getSimpleName(), found); } } }
@Test public void checkConfigurationOptionKeysHasCorrectValues() throws Exception { Class<?> optionClass = ConfigurationOptionKeys.class; Field[] fields = optionClass.getFields(); for (int i=0; i<fields.length; ++i) { Field f = fields[i]; Assert.assertEquals("All field of "+optionClass.getName()+" should be static and public", java.lang.reflect.Modifier.STATIC, f.getModifiers() & java.lang.reflect.Modifier.STATIC); String key = f.getName(); String value = (String) f.get(null); Assert.assertEquals("Field names and values of "+optionClass.getName()+" should be equal", key, value); } }