Skip to content

Commit

Permalink
Simplify/fix junit assertions
Browse files Browse the repository at this point in the history
  • Loading branch information
dwalluck authored and goneall committed Jan 22, 2025
1 parent cdb83eb commit 0b9005f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/test/java/org/spdx/core/TestCoreModelObject.java
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public void testCoreModelObjectCoreModelObjectBuilderString() throws InvalidSPDX
assertEquals(modelStore, result.getModelStore());
assertEquals(objectUri, result.getObjectUri());
assertEquals(copyManager, result.getCopyManager());
assertEquals(false, result.isStrict());
assertFalse(result.isStrict());
}

/**
Expand Down Expand Up @@ -193,7 +193,7 @@ public void testSetPropertyValue() throws InvalidSPDXAnalysisException {
modelType.setPropertyValue(BOOLEAN_PROPERTY_DESCRIPTOR, false);
Optional<Boolean> bResult = modelType.getBooleanPropertyValue(BOOLEAN_PROPERTY_DESCRIPTOR);
assertTrue(bResult.isPresent());
assertEquals(false, bResult.get());
assertFalse(bResult.get());
// enumeration
modelType.setPropertyValue(ENUM_PROPERTY_DESCRIPTOR, MockEnum.ENUM1);
Optional<? extends Enum<?>> eResult = modelType.getEnumPropertyValue(ENUM_PROPERTY_DESCRIPTOR);
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/org/spdx/core/TestModelRegistry.java
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public boolean canBeExternal(Class<?> clazz) {
assertTrue(oResult instanceof MockModelType);
assertEquals(OBJECT_URI, ((MockModelType)oResult).getObjectUri());
Class<?> cResult = ModelRegistry.getModelRegistry().typeToClass(MockModelType.TYPE, "3.0.0");
assertEquals(cResult, MockModelType.class);
assertEquals(MockModelType.class, cResult);
Enum<?> eResult = ModelRegistry.getModelRegistry().uriToEnum(MockEnum.ENUM1.getIndividualURI(), "3.0.0");
assertEquals(MockEnum.ENUM1, eResult);
Object iResult = ModelRegistry.getModelRegistry().uriToIndividual(individual.getIndividualURI(), "3.0.0", null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,11 +154,11 @@ public void testParseTemplate() throws LicenseTemplateRuleException, LicensePars
String noText = "";
TestLicenseTemplateOutputHandler handler = new TestLicenseTemplateOutputHandler();
SpdxLicenseTemplateHelper.parseTemplate(noText, handler);
assertEquals(null, optionalTextString);
assertEquals(null, normalTextString);
assertEquals(null, variableRule);
assertEquals(null, optionalRule);
assertEquals(null, endOptionalRule);
assertNull(optionalTextString);
assertNull(normalTextString);
assertNull(variableRule);
assertNull(optionalRule);
assertNull(endOptionalRule);

handler = new TestLicenseTemplateOutputHandler();
SpdxLicenseTemplateHelper.parseTemplate(PARSE_TEXT_STRING, handler);
Expand Down

0 comments on commit 0b9005f

Please sign in to comment.