Skip to main content

expanders-assert


1.1.0 (2024-10-18)

Added

  • Added @TestModelAssembly annotation, which allows more control over how Specs returned by the annotated methods are built.

Changed

  • Restored AssertJ as a transitive dependency. Other dependencies are still expected to be provided by the project.
  • Improved annotation lookup mechanism for @TestModel, @TestProfile and @TestModelAssembly, so that we can be composed into other annotations.

1.0.0 (2024-09-03)

Changed

  • TestExpansion can now also be an instance variable of the Test class.
  • Changed ValidationAssert class:
    • Removed generic type.
    • The actual of the assert object is now the ValidationRuleComposite instead of the model instance.
    • Error messages have been changed to be more compact.

Fixed

  • Fixed ClassNotFoundException when loading TestExpansion with model-transmutation dependency.
  • Fixed indents in error messages of net.democritus.expander.assertj.conditions.With.
  • Fixed conflict message showing dependency with missing information.

0.10.0 (2024-08-30)

Added

  • Added conditions for more descriptive tests for models.
  • Added assertThatTransmuter() method to TestExpansion to verify newly created modules, programs or elements.

Changed

  • Several dependencies are now set to provided in the pom. They need to be added explicitly as a dependency in the tested project.
  • Changed ExpanderAssert.doesNotHaveTag(String) to fail if the provided tag is not defined on the expander under testing.
    • Also applies to FeatureAssert and ExpansionStepAssert.
  • Added additional checks to prevent the TestExpansion to be used with the wrong Composite type.
  • Transmuter tests now use a custom transmuter to remove the dependency on model-transmutations.
  • Improved formatting for Composites and other classes

Fixed

  • Fixed NullPointerException that occurred if the version of a dependency in the classpath is null.

0.9.1 (2024-08-07)

Fixed

  • Fixed a bug where DataResources would not be loaded when running a test in IntelliJ, causing it to fail on missing elements. This occurred in multi-module projects that contained multiple DataResources with the same classPath location. Requires prime-core 2024.4.5+ to work.

0.9.0 (2024-06-25)

Added

  • Added ExpanderAssert#hasHarvestPath(String) to test harvest paths.

0.8.0 (2024-06-11)

Added

  • Added imports(String arguments) to allow assertions on import anchors with arguments.

0.7.0 (2024-06-06)

Added

  • Added @TransmuterTest to test Transmuters using model asserts after .afterRunningTransmutation().
  • Added extendModel(String, Class<?>, Spec...) to extend part of the model by its key.
  • Added assertThatModel(String select, Class<?> elementClass) to assert different parts of the model.
  • Added assertThatData(Class<?> elementClass) to assert elements in the dataRegistry.
  • Added option assertions to CompositeAssert and CompositeListAssert.
  • Added selecting and selectingAll methods to perform assertions on specific elements.

Changed

  • Bumped CompositeAssert to inherit Object assertions.

0.6.0 (2024-05-27)

Added

  • Test methods can now have a Composite parameter, which will resolve to the selected model.
  • Test methods can now have a DataRegistryComposite parameter, containing all DataResources and @TestData models.

0.5.0 (2024-04-30)

Added

  • Added TagAssert#on(Function), which can be used to assert tags on a connected part of the model. Useful if the target element is itself not expandable or does not have a functional key.
  • Added support for testing validationRules.

0.4.0 (2024-04-19)

Added

  • Added programType parameter to @TestModel.
  • Added @TestData annotation. Add this to a method returning an ElementSpec. The spec will be built and added to the DataRegistry before the model is built.

0.3.0 (2024-02-14)

Added

  • Added TestExpansion.extendElements() to apply model extension to a collection of elements.

0.2.0 (2024-01-10)

Added

  • Added basic support for expansionSteps
  • Added support for tags
  • Added support for expanders targeting abstract element classes.

Changed

  • TestExpansion now delays building the model until it is necessary. This allows you to change the baseModel and target with the TestExpansion methods in the test model without having unintended side effects from building the original test model.

0.1.4 (2023-12-15)

Fixed

  • Fixed issues with dependencies between project resources by merging them into a single project expansion-resource.

0.1.3 (2023-12-14)

Fixed

  • Provide better names for expansion-resources generated for projects, so that there are no conflicts. This fixes some disparities between running tests in IntelliJ and running them with maven.

0.1.2 (2023-12-11)

Fixed

  • Exclude project expansion-resource from conflict validation to ensure useful error messages.

0.1.1 (2023-12-11)

Fixed

  • Fixed a bug where the expansion-resources would not be sorted before loading data-resources, causing unexpected issues of missing data.
  • Changed the order of execution when preparing the test context, so that the ClassPath can be validated before data-resources are being loaded.

0.1.0 (2023-12-06)

Added

  • Added @UseModel annotation. You can now define multiple methods with @TestModel. By default, the framework will grab the baseModel() method. If the @UseModel annotation is added to the test method, it will instead grab the method defined in the annotation.

Fixed

  • The project's expansionResource manifest is now generated ad hoc before the tests, giving better consistency when changing Expanders and Features, or adding Data-resources.

0.0.4 (2023-10-23)

Added

  • Added extendModel(Function, Spec...) method to TestExpansion. This allows you to select a part of the model and then extend it. e.g.
    testExpansion.extendModel(dataElement -> dataElement.getComponent(), option("some.component.option"));

0.0.3 (2023-10-19)

Added

  • Added imports() assertion to FeatureAssert to test imports from usages in mapping file.

Fixed

  • Added fallback to classpath when an expander cannot be found

0.0.2 (2023-10-03)

Fixed

  • expansionResource.xml files generated for tests are now correctly removed after tests.
  • Fixed version issue because test expansion-resource was using an invalid version 'NOW'.

0.0.1 (2023-06-29)

Added

  • Added @ExpanderTest, @FeatureTest and @ModelTest annotations to configure junit 5 tests.
  • Added TestExpansion class to build expansion model for tests
  • Added Assert classes using AssertJ to test expanders and features