Skip to content

Commit

Permalink
Merge 6e1154c into 35acebb
Browse files Browse the repository at this point in the history
  • Loading branch information
tduehr committed Jan 24, 2019
2 parents 35acebb + 6e1154c commit 77abea0
Show file tree
Hide file tree
Showing 870 changed files with 4,074 additions and 7,820 deletions.
@@ -1,9 +1,9 @@
package org.apereo.cas.authentication;

import lombok.val;
import org.junit.Test;
import org.junit.jupiter.api.Test;

import static org.junit.Assert.*;
import static org.junit.jupiter.api.Assertions.*;

/**
* @since 5.3.0
Expand Down
Expand Up @@ -7,37 +7,30 @@
import lombok.extern.slf4j.Slf4j;
import lombok.val;
import org.apache.commons.lang3.StringUtils;
import org.junit.ClassRule;
import org.junit.Rule;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.aop.AopAutoConfiguration;
import org.springframework.boot.configurationmetadata.ConfigurationMetadataProperty;
import org.springframework.boot.context.properties.source.ConfigurationPropertyName;
import org.springframework.boot.context.properties.source.InvalidConfigurationPropertyNameException;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.core.io.Resource;
import org.springframework.core.io.ResourceLoader;
import org.springframework.test.context.junit4.rules.SpringClassRule;
import org.springframework.test.context.junit4.rules.SpringMethodRule;

import java.io.IOException;
import java.util.Set;

import static org.junit.Assert.*;
import static org.junit.jupiter.api.Assertions.*;

/**
* Test additional metadata validity.
*
* @since 6.0
*/
@SpringBootTest(classes = AopAutoConfiguration.class)
@Slf4j
public class AdditionalMetadataVerificationTests {

@ClassRule
public static final SpringClassRule SPRING_CLASS_RULE = new SpringClassRule();

@Rule
public final SpringMethodRule springMethodRule = new SpringMethodRule();

@Autowired
private ResourceLoader resourceLoader;

Expand All @@ -50,7 +43,9 @@ public class AdditionalMetadataVerificationTests {
*/
@Test
public void verifyMetaData() throws IOException {
val additionalMetadataJsonFile = resourceLoader.getResource("META-INF/additional-spring-configuration-metadata.json");
val additionalMetadataJsonFile = resourceLoader.getResource(
CasConfigurationProperties.class.getClassLoader().getResource("META-INF/additional-spring-configuration-metadata.json").toString()
);
val additionalProps = getProperties(additionalMetadataJsonFile);
for (val prop : additionalProps) {
try {
Expand All @@ -69,6 +64,7 @@ public void verifyMetaData() throws IOException {
}
}

@SuppressWarnings("unchecked")
private Set<ConfigurationMetadataProperty> getProperties(final Resource jsonFile) throws IOException {
val mapper = new ObjectMapper().findAndRegisterModules();
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
Expand All @@ -78,7 +74,6 @@ private Set<ConfigurationMetadataProperty> getProperties(final Resource jsonFile
val values = new TypeReference<Set<ConfigurationMetadataProperty>>() {
};
val reader = mapper.readerFor(values);
val jsonSet = (Set) reader.readValue(propertiesNode);
return jsonSet;
return (Set<ConfigurationMetadataProperty>) reader.readValue(propertiesNode);
}
}
7 changes: 0 additions & 7 deletions api/cas-server-core-api-test-category/build.gradle

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

@@ -1,9 +1,9 @@
package org.apereo.cas;

import lombok.val;
import org.junit.Test;
import org.junit.jupiter.api.Test;

import static org.junit.Assert.*;
import static org.junit.jupiter.api.Assertions.*;

/**
* This is {@link DistributedCacheObjectTests}.
Expand Down
11 changes: 4 additions & 7 deletions build.gradle
Expand Up @@ -352,7 +352,10 @@ subprojects {
if (!Boolean.getBoolean("skipCheckstyle")) {
checkstyle {
configFile new File(rootDir, "style/checkstyle-rules.xml")
configProperties = ["checkstyle.suppressions.file": new File(rootDir, "style/checkstyle-suppressions.xml")]
configProperties = [
"checkstyle.suppressions.file": new File(rootDir, "style/checkstyle-suppressions.xml"),
"checkstyle.importcontrol.file": new File(rootDir, "style/import-control.xml")
]
ignoreFailures false
showViolations true
toolVersion "${checkstyleVersion}"
Expand Down Expand Up @@ -425,12 +428,6 @@ subprojects {
testImplementation libraries.log4j
compileOnly libraries.findbugsannotations
}

if (project.name != 'cas-server-core-api-test-category') {
dependencies {
testImplementation project(path: ":api:cas-server-core-api-test-category", configuration: "tests")
}
}
}

wrapper {
Expand Down
Expand Up @@ -2,11 +2,11 @@

import lombok.val;
import org.apereo.inspektr.audit.AuditActionContext;
import org.junit.Test;
import org.junit.jupiter.api.Test;

import java.util.Date;

import static org.junit.Assert.*;
import static org.junit.jupiter.api.Assertions.*;

/**
* This is {@link AuditActionContextJsonSerializerTests}.
Expand Down
Expand Up @@ -4,17 +4,15 @@
import org.apereo.cas.audit.spi.resource.ServiceResourceResolverTests;
import org.apereo.cas.audit.spi.resource.TicketAsFirstParameterResourceResolverTests;

import org.junit.runner.RunWith;
import org.junit.runners.Suite;
import org.junit.platform.suite.api.SelectClasses;

/**
* This is {@link CoreAuditTestsSuite}.
*
* @author Misagh Moayyed
* @since 6.0.0
*/
@RunWith(Suite.class)
@Suite.SuiteClasses({
@SelectClasses({
AuditActionContextJsonSerializerTests.class,
ServiceResourceResolverTests.class,
TicketAsFirstParameterResourceResolverTests.class,
Expand Down
Expand Up @@ -3,11 +3,11 @@
import org.apereo.cas.services.RegisteredServiceTestUtils;

import lombok.val;
import org.junit.Test;
import org.junit.jupiter.api.Test;

import java.util.ArrayList;

import static org.junit.Assert.*;
import static org.junit.jupiter.api.Assertions.*;

/**
* This is {@link ChainingAuditPrincipalIdProviderTests}.
Expand Down

0 comments on commit 77abea0

Please sign in to comment.