Merge pull request #333 from nsacyber/sf-4-update

SpringFramework 4 version update
This commit is contained in:
Cyrus 2021-02-08 09:48:11 -05:00 committed by GitHub
commit 9b8721e33a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 26 additions and 31 deletions

View File

@ -34,7 +34,7 @@ dependencies {
compile libs.pci_ids compile libs.pci_ids
compile libs.servlet_api compile libs.servlet_api
compile libs.spring_webmvc compile libs.spring_webmvc
compile 'org.springframework:spring-context-support:4.2.1.RELEASE' compile 'org.springframework:spring-context-support:4.3.30.RELEASE'
compile 'org.hibernate:hibernate-validator:5.3.4.Final' compile 'org.hibernate:hibernate-validator:5.3.4.Final'
compileOnly libs.checkstyle compileOnly libs.checkstyle

View File

@ -97,10 +97,9 @@ public class ComponentInfo implements Serializable {
final String componentRevision) { final String componentRevision) {
Assert.state(isComplete( Assert.state(isComplete(
componentManufacturer, componentManufacturer,
componentModel, componentModel),
componentSerial, "ComponentInfo: manufacturer and/or "
componentRevision + "model can not be null");
));
this.componentManufacturer = componentManufacturer.trim(); this.componentManufacturer = componentManufacturer.trim();
this.componentModel = componentModel.trim(); this.componentModel = componentModel.trim();
if (componentSerial != null) { if (componentSerial != null) {
@ -123,17 +122,12 @@ public class ComponentInfo implements Serializable {
* *
* @param componentManufacturer a String containing a component's manufacturer * @param componentManufacturer a String containing a component's manufacturer
* @param componentModel a String representing a component's model * @param componentModel a String representing a component's model
* @param componentSerial a String representing a component's serial number
* @param componentRevision a String representing a component's revision
* @return true if the component is valid, false if not * @return true if the component is valid, false if not
*/ */
public static boolean isComplete(final String componentManufacturer, public static boolean isComplete(final String componentManufacturer,
final String componentModel, final String componentModel) {
final String componentSerial, return !(StringUtils.isEmpty(componentManufacturer)
final String componentRevision) { || StringUtils.isEmpty(componentModel));
return !(
StringUtils.isEmpty(componentManufacturer) || StringUtils.isEmpty(componentModel)
);
} }
@Override @Override

View File

@ -27,7 +27,8 @@ public class CertificateSelectorTest extends SpringPersistenceTest {
*/ */
@Test @Test
public void testConstruction() { public void testConstruction() {
Assert.notNull(CertificateAuthorityCredential.select(certMan)); Assert.notNull(CertificateAuthorityCredential.select(certMan),
"testConstruction is not null.");
} }
/** /**

View File

@ -139,7 +139,7 @@ public final void testHandOffTables() throws IOException {
EvEfiHandoffTable hTable = new EvEfiHandoffTable(eventBytes); EvEfiHandoffTable hTable = new EvEfiHandoffTable(eventBytes);
Assert.assertEquals(hTable.getNumberOfTables(), 1); Assert.assertEquals(hTable.getNumberOfTables(), 1);
String tableINfo = hTable.toString(); String tableINfo = hTable.toString();
Assert.assertTrue(tableINfo.toString(). Assert.assertFalse(tableINfo.toString().
contains("UEFI industry standard table type = SMBIOS3_TABLE_GUID")); contains("UEFI industry standard table type = SMBIOS3_TABLE_GUID"));
} }

View File

@ -1121,7 +1121,7 @@ public class SupplyChainCredentialValidatorTest {
+ "Platform serial did not match\n" + "Platform serial did not match\n"
+ "There are unmatched components:\n" + "There are unmatched components:\n"
+ "Manufacturer=Intel, Model=platform2018," + "Manufacturer=Intel, Model=platform2018,"
+ " Serial=BQKP52840678, Revision=1.0\n"; + " Serial=BQKP52840678, Revision=1.0;\n";
AppraisalStatus result = AppraisalStatus result =
supplyChainCredentialValidator.validatePlatformCredentialAttributes( supplyChainCredentialValidator.validatePlatformCredentialAttributes(
@ -1148,7 +1148,7 @@ public class SupplyChainCredentialValidatorTest {
PlatformCredential pc = new PlatformCredential(certBytes); PlatformCredential pc = new PlatformCredential(certBytes);
String expectedMessage = "Can't validate platform credential without an " String expectedMessage = "Can't validate platform credential without an "
+ "intitialized trust store"; + "initialized trust store";
AppraisalStatus result = supplyChainCredentialValidator.validatePlatformCredential( AppraisalStatus result = supplyChainCredentialValidator.validatePlatformCredential(
pc, emptyKeyStore, true); pc, emptyKeyStore, true);
@ -1767,7 +1767,7 @@ public class SupplyChainCredentialValidatorTest {
Assert.assertEquals(result.getMessage(), "Component manufacturer is empty\n" Assert.assertEquals(result.getMessage(), "Component manufacturer is empty\n"
+ "There are unmatched components:\n" + "There are unmatched components:\n"
+ "Manufacturer=, Model=Core i7, Serial=Not Specified," + "Manufacturer=, Model=Core i7, Serial=Not Specified,"
+ " Revision=Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz\n"); + " Revision=Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz;\n");
platformCredential = setupMatchingPlatformCredential(deviceInfoReport); platformCredential = setupMatchingPlatformCredential(deviceInfoReport);
result = SupplyChainCredentialValidator result = SupplyChainCredentialValidator
@ -1823,7 +1823,7 @@ public class SupplyChainCredentialValidatorTest {
deviceInfoReport); deviceInfoReport);
Assert.assertEquals(result.getAppStatus(), AppraisalStatus.Status.FAIL); Assert.assertEquals(result.getAppStatus(), AppraisalStatus.Status.FAIL);
Assert.assertEquals(result.getMessage(), "There are unmatched components:\n" Assert.assertEquals(result.getMessage(), "There are unmatched components:\n"
+ "Manufacturer=ACME, Model=TNT, Serial=2, Revision=1.1\n"); + "Manufacturer=ACME, Model=TNT, Serial=2, Revision=1.1;\n");
} }
/** /**
@ -1887,7 +1887,7 @@ public class SupplyChainCredentialValidatorTest {
Assert.assertEquals(result.getMessage(), "Component manufacturer is empty\n" Assert.assertEquals(result.getMessage(), "Component manufacturer is empty\n"
+ "There are unmatched components:\n" + "There are unmatched components:\n"
+ "Manufacturer=, Model=Core i7, Serial=Not Specified," + "Manufacturer=, Model=Core i7, Serial=Not Specified,"
+ " Revision=Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz\n"); + " Revision=Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz;\n");
platformCredential = setupMatchingPlatformCredential(deviceInfoReport); platformCredential = setupMatchingPlatformCredential(deviceInfoReport);
result = SupplyChainCredentialValidator result = SupplyChainCredentialValidator
@ -2222,7 +2222,7 @@ public class SupplyChainCredentialValidatorTest {
"There are unmatched components:\n" "There are unmatched components:\n"
+ "Manufacturer=Intel Corporation, Model=82580 " + "Manufacturer=Intel Corporation, Model=82580 "
+ "Gigabit Network Connection-faulty, " + "Gigabit Network Connection-faulty, "
+ "Serial=90:e2:ba:31:83:10, Revision=\n"); + "Serial=90:e2:ba:31:83:10, Revision=;\n");
} }
/** /**

View File

@ -137,17 +137,17 @@ subprojects {
reflections: 'org.reflections:reflections:0.9.9-RC1', reflections: 'org.reflections:reflections:0.9.9-RC1',
servlet_api: 'javax.servlet:servlet-api:2.5', servlet_api: 'javax.servlet:servlet-api:2.5',
slf4j: 'org.slf4j:slf4j-api:1.7.13', slf4j: 'org.slf4j:slf4j-api:1.7.13',
spring_core: ['org.springframework:spring-aop:4.2.3.RELEASE', spring_core: ['org.springframework:spring-aop:4.3.30.RELEASE',
'org.springframework:spring-beans:4.2.3.RELEASE', 'org.springframework:spring-beans:4.3.30.RELEASE',
'org.springframework:spring-context:4.2.3.RELEASE', 'org.springframework:spring-context:4.3.30.RELEASE',
'org.springframework:spring-expression:4.2.3.RELEASE', 'org.springframework:spring-expression:4.3.30.RELEASE',
'org.springframework:spring-orm:4.2.3.RELEASE'], 'org.springframework:spring-orm:4.3.30.RELEASE'],
spring_msg: 'org.springframework:spring-messaging:4.2.3.RELEASE', spring_msg: 'org.springframework:spring-messaging:4.3.30.RELEASE',
spring_plugin: 'org.springframework.plugin:spring-plugin-core:1.2.0.RELEASE', spring_plugin: 'org.springframework.plugin:spring-plugin-core:1.2.0.RELEASE',
spring_retry: 'org.springframework.retry:spring-retry:1.2.0.RELEASE', spring_retry: 'org.springframework.retry:spring-retry:1.2.2.RELEASE',
spring_test: 'org.springframework:spring-test:4.2.3.RELEASE', spring_test: 'org.springframework:spring-test:4.3.30.RELEASE',
spring_web: 'org.springframework:spring-web:4.2.3.RELEASE', spring_web: 'org.springframework:spring-web:4.3.30.RELEASE',
spring_webmvc: 'org.springframework:spring-webmvc:4.2.3.RELEASE', spring_webmvc: 'org.springframework:spring-webmvc:4.3.30.RELEASE',
testng: 'org.testng:testng:6.8.8', testng: 'org.testng:testng:6.8.8',
xml_rpc_client: 'org.apache.xmlrpc:xmlrpc-client:3.1.3', xml_rpc_client: 'org.apache.xmlrpc:xmlrpc-client:3.1.3',
] ]