Behavior-Driven Development in plain Java

Overview

Build Status Coverage Status Apache License 2.0 Maven Central Join the chat at https://gitter.im/TNG/JGiven Javadocs Open Source Helpers

JGiven

JGiven is a developer-friendly and pragmatic BDD tool for Java. Developers write scenarios in plain Java using a fluent, domain-specific API, JGiven generates reports that are readable by domain experts.

Why another BDD tool?

Behavior-Driven Development (BDD) is a development method where business analysts, developers, and testers describe the behavior of a software product in a common language and notation. Behavior is typically described in terms of scenarios, which are written in the Given-When-Then notation. The common language and notation is one cornerstone of BDD. The other cornerstone is that the defined scenarios are executable, form a comprehensive test suite, and a living documentation for the software product.

In classical BDD tools for Java like JBehave or Cucumber scenarios are written in plain text files. This allows non-developers to write scenarios, because no programming knowledge is required. To make scenarios executable, developers write so-called step-implementations. To bind plain text to step implementations regular expressions are used. For developers maintaining these executable scenarios has a high overhead that is not required if tests would be directly written in a programming language.

Beside the classical BDD tools there are a number of tools for Java to write BDD tests in a programming language like Groovy (easyb) or Scala (ScalaTest). To our knowledge, however, there is no BDD tool where scenarios can be written in plain Java.

Finally, there are specification testing frameworks like Spock (Groovy) or LambdaBehave which are very developer-centric and good for unit-testing, but the generated reports are not in Given-When-Then form and are not easily readable by non-developers.

BDD with JGiven

  • Scenarios are written in standard Java code using a fluent, domain-specific API (no extra language like Scala or Groovy needed, no IDE plugin needed)
  • Java method names and parameters are parsed during test execution (no extra annotations needed)
  • Scenarios are executed by either JUnit or TestNG (no extra test runner needed)
  • Scenarios consist of so-called stages, which share state by injection, providing a modular way of writing Scenarios.
  • JGiven generates scenario reports for business owners and domain experts

Example

@Test
public void a_pancake_can_be_fried_out_of_an_egg_milk_and_flour() {
    given().an_egg().
        and().some_milk().
        and().the_ingredient( "flour" );

    when().the_cook_mangles_everything_to_a_dough().
        and().the_cook_fries_the_dough_in_a_pan();

    then().the_resulting_meal_is_a_pancake();
}

The above test can be executed like any JUnit test. During the execution, JSON files are generated that can then be used afterwards to generate test reports. By default, a plain text report is shown in the console, which would look as follows:

Scenario: a pancake can be fried out of an egg milk and flour

  Given an egg
    And some milk
    And the ingredient flour
   When the cook mangles everything to a dough
    And the cook fries the dough in a pan
   Then the resulting meal is a pancake

In addition, you can generate a HTML Report.

Getting Started

  1. Start by reading the documentation section on JGiven's website.
  2. See the talk on JGiven held on the TNG Big TechDay

License

JGiven is published under the Apache License 2.0, see https://www.apache.org/licenses/LICENSE-2.0 for details.

Contributing

See CONTRIBUTING

Comments
  • HTML5 Report: Accumulate tags

    HTML5 Report: Accumulate tags

    Currently, we can select scenarios related to one given tag by clicking on it. But we're not able to select scenarios related to a selection of tags.

    Let's say we have these tags:

    • Customer -> this a high-level feature tag;
    • Account -> this is a more specific feature tag that could be used inside another high-level feature;
    • Listed -> this is a customer specificity that could be used inside another high-level feature.

    If I filter scenarios by one of these tags, I do not have the ones I'm looking for. A possible solution would be the accumulation of tags: Customer AND Account AND Listed. We could also think about a more flexible mechanism language: Customer AND (Account OR Listed).

    enhancement HTML Report 
    opened by clementheliou 24
  • Added required attribute to ScenarioState.

    Added required attribute to ScenarioState.

    This commit adds a new boolean attribute "required" to both ScenarioState and ExpectedScenarioState. If set to true on a field within a stage, corresponding tests will fail automatically if the state hasn't been provided.

    fixes #255

    opened by Airblader 23
  • ScenarioState should be injected when stage is wrapped into spring proxy

    ScenarioState should be injected when stage is wrapped into spring proxy

    We are using a JGiven setup with Spring where the stages themselves are spring beans. However, as soon as the stage is wrapped into a spring proxy, the scenario state injection does no longer work.

    See the attached test case for details. You can verify that both test cases should be working by disabling the logging aspect.

    testcase.tar.gz

    bug core Spring waiting for verification 
    opened by corneliusweig 21
  • JGiven Reports in Jenkins not visible with Content Security Policy

    JGiven Reports in Jenkins not visible with Content Security Policy

    Hi,

    we have integrated JGiven into our builds and everyone really loves the reports. :+1:

    "Unfortunately" the Jenkins in our company has been updated and now enforces Jenkins Content Security Policy quite strictly, see here: https://wiki.jenkins-ci.org/display/JENKINS/Configuring+Content+Security+Policy

    Since this I cannot watch the JGiven Reports on our Jenkins, neither with the JGiven Plugin nor with the HTML Publisher Plugin on version 1.10. Both worked before.

    So I think what it comes down too is this:

    From version 1.10 on, the HTML Publisher Plugin is compatible with Content Security Policy. Before that, it executed inline JavaScript in a file served by DirectoryBrowserSupport to set up the frame wrapper around the published files and would fail unless script-src 'unsafe-inline' was allowed, which is a possible security issue.

    If the published HTML files require JavaScript or other dynamic features prohibited by Content Security Policy to work properly, the Content-Security-Policy header will need to be adjusted accordingly. This applies to all versions of HTML Publisher Plugin.

    Am i correct? Is there any chance this can be adjusted in the report or the JGiven-Plugin?

    Thank you very much,

    mgehlen

    wontfix 
    opened by mgehlen 20
  • Allow adding tags dynamically.

    Allow adding tags dynamically.

    This commit allows adding tags dynamically to a scenario at runtime. Furthermore, it implicitly fixes an issue where nested tags, description and href would not be evaluated if ignoreValue was set to true.

    fixes #172

    enhancement core 
    opened by Airblader 17
  • Add cssClass to @IsTag to customize tags in HTML reports

    Add cssClass to @IsTag to customize tags in HTML reports

    Add a new attribute cssClass to the @IsTag annotation.

    public @interface IsTag {
        String cssClass() default ""; // Or the default can come from Foundation
    }
    
    enhancement core HTML Report 
    opened by janschaefer 17
  •  @As and @CaseDescription annotation use different placeholder enumerations

    @As and @CaseDescription annotation use different placeholder enumerations

    If I want to adress the first argument in the @As ( "First argument: $1, Second Argument: $2" ), it starts with the index 1. In @CaseDescription it starts with index 0.

    I would propose to set the @As index to start from 0, because usually programmer will write these tests.

    Need to add at least two examples for simple placeholder and enumerated ones to docs and jgiven-examples.

    @As ( "First argument: $, second argument $") @As ( "Second argument: $1, first argument $0")

    @CaseDescription ( "First argument: $, second argument $") @CaseDescription ( "Second argument: $1, first argument $0")

    CaseDescription is also not documented yet.

    Minimal example for @CaseDescription is found here.

    Minimal example for @As Description:

    
    import junitparams.JUnitParamsRunner;
    import junitparams.Parameters;
    import org.junit.Test;
    
    import com.tngtech.jgiven.Stage;
    import com.tngtech.jgiven.annotation.As;
    import com.tngtech.jgiven.annotation.Description;
    import com.tngtech.jgiven.annotation.IntroWord;
    import com.tngtech.jgiven.junit.SimpleScenarioTest;
    import org.junit.runner.RunWith;
    
    RunWith( JUnitParamsRunner.class )
    @Description( "Demonstrates the usage of the @As annotation" )
    public class AsAnnotationExampleTest extends SimpleScenarioTest<AsAnnotationExampleTest.AsAnnotationStage> {
    
        @Test
        @As( "Scenario that shows the usage of @At with argument enumeration")
        @Parameters({
                "false, 0"
        })
        public void steps_can_use_at_annotation_to_reference_arguments_by_enumeration(boolean bool, int i) {
            given().some_boolean_and_int_value( bool, i );
        }
    
        public static class AsAnnotationStage extends Stage<AsAnnotationStage> {
    
            @As( "Referencing first argument : $1, second argument : $2 ")
            public AsAnnotationStage some_boolean_and_int_value( boolean bool, int i) {
                return this;
            }
        }
    }
    
    core documentation API inconsistency 
    opened by cirquit 16
  • Allow multiple formatters for one property

    Allow multiple formatters for one property

    Hi Jan,

    public T superbox_query_type_$_with_query_$_is_prepared(@Hidden Class<? extends SuperBoxController> superboxClass,
                JAFQueryType queryType, @Quoted @NotSetIfNull String query) {
    

    throws a

    com.tngtech.jgiven.exception.AmbiguousFormattingException.

    Is there any reason why multiple formatters can't be used in the order they are declared? To achieve that behaviour, I need to provide another formatter annotation that combines both formatters which results in increased code verbosity.

    Best regards, Niko

    enhancement core 
    opened by nikowitt 16
  • hiding

    hiding "technical" tests in report

    Sometimes there are tests which exist only to initiate some state but they are not the focus.

    For example, logging-in is required by all scenarios in an application and there also might be a dedicated LoginTest class, however the login itself is just some technicality for most scenario methods and we would like to keep it hidden in the test report.

    Sometimes this can be solved with @Before... stuff, but sometimes it requires too much tricks and doing it in a separate test method upon which others depend is much simpler.

    Can it be done with current library? Any direction about where I need to look in order to implement such thing myself?

    opened by adrian-herscu 15
  • Ability to set global prefix per class to scenarios

    Ability to set global prefix per class to scenarios

    Hi Jan, some more feedback.

    There are lots of security tests implemented that extend from a base class that also contains scenarios, e.g. "Validate create access" which is then called in a QuestionSecurityTestSuite and a ResponseSecurityTestSuite.

    In the report, it is now difficult to see which scenario belongs to which test as there are just several "Validate create access" scenarios listed. A "group by class" (which is one additional click) solves this issue, but the class name might be too technical for non developers.

    What would be great is to be able to define some global prefix by class that is prepended to the scenarios that are executed in the class. This way, the inherited generic "Validate create access" tests can have unique names (e.g. "Question - Validate create access" or "Response - Validate create access") and lots of wrapper methods that are only required to create unique names can be omitted.

    Best regards, Niko

    enhancement core HTML Report 
    opened by nikowitt 15
  • Issue 236, Extended Description argument parsing functionality

    Issue 236, Extended Description argument parsing functionality

    • added front-end parsing for extended descriptions with arguments
    • added front-end tests in utilTest.js
    • added example usage in ExtendedDescriptionTest.java
    • added example for @As usage with direct references to arguments in AsAnnotationExampleTest.java
    • added documentation for @As and @ExtendedDescription in step-usage

    missing:

    • tests for extended description in html5report
    enhancement core HTML App 
    opened by cirquit 14
  • Update renovatebot/github-action action to v34.90.0

    Update renovatebot/github-action action to v34.90.0

    Mend Renovate

    This PR contains the following updates:

    | Package | Type | Update | Change | |---|---|---|---| | renovatebot/github-action | action | minor | v34.78.0 -> v34.90.0 |


    Release Notes

    renovatebot/github-action

    v34.90.0

    Compare Source

    See the the changelog for changes in all releases.

    34.90.0 (2023-01-07)

    Bug Fixes
    • deps: update renovate/renovate docker tag to v34.90.0 (5224b67)

    v34.87.0

    Compare Source

    See the the changelog for changes in all releases.

    34.87.0 (2023-01-06)

    Bug Fixes
    • deps: update renovate/renovate docker tag to v34.87.0 (1573d2f)

    v34.84.2

    Compare Source

    See the the changelog for changes in all releases.

    34.84.2 (2023-01-06)
    Bug Fixes
    • deps: update renovate/renovate docker tag to v34.84.2 (d00dd42)

    v34.84.1

    Compare Source

    See the the changelog for changes in all releases.

    34.84.1 (2023-01-06)
    Bug Fixes
    • deps: update renovate/renovate docker tag to v34.84.1 (7bf255e)

    v34.83.1

    Compare Source

    See the the changelog for changes in all releases.

    34.83.1 (2023-01-05)
    Bug Fixes
    • deps: update renovate/renovate docker tag to v34.83.1 (34618f3)

    v34.82.2

    Compare Source

    See the the changelog for changes in all releases.

    34.82.2 (2023-01-04)
    Bug Fixes
    • deps: update renovate/renovate docker tag to v34.82.2 (a575228)

    v34.82.0

    Compare Source

    See the the changelog for changes in all releases.

    34.82.0 (2023-01-04)

    Bug Fixes
    • deps: update renovate/renovate docker tag to v34.82.0 (a0ed9c2)

    v34.81.0

    Compare Source

    See the the changelog for changes in all releases.

    34.81.0 (2023-01-03)

    Bug Fixes
    • deps: update renovate/renovate docker tag to v34.81.0 (f1d4648)

    Configuration

    📅 Schedule: Branch creation - "after 10pm every weekday,before 5am every weekday,every weekend" (UTC), Automerge - At any time (no schedule defined).

    🚦 Automerge: Enabled.

    â™» Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    🔕 Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 0
  • attachment of nested steps incorrectly rendered in html report

    attachment of nested steps incorrectly rendered in html report

    Consider a scenario with Nested Steps:

    1. A Step with attachment [1]
    2. Step with Nested Steps a. First Nested Step with attachment [2] b. Second Nested Step with attachment [3]

    The resulting report should contain 3 different attachments.

    The actual report contains only 2 attchaments, although all 3 attachments appear in json report file. If we would add a dummy step before 2.a step, then 3 attachments appear, however the [2] and [3] attachments are just copies of [1] attachment.

    Checked with 1.1.0 and with 1.2.4.

    opened by adrian-herscu 0
  • Update plugin org.springframework.boot to v3

    Update plugin org.springframework.boot to v3

    Mend Renovate

    This PR contains the following updates:

    | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | org.springframework.boot (source) | 2.7.7 -> 3.0.1 | age | adoption | passing | confidence |


    Release Notes

    spring-projects/spring-boot

    v3.0.1

    :lady_beetle: Bug Fixes
    • Fix typo in LocalDevToolsAutoConfiguration logging #​33615
    • No warning is given when <springProfile> is used in a Logback <root> block #​33610
    • Auto-configure PropagationWebGraphQlInterceptor for tracing propagation #​33542
    • WebClient instrumentation fails with IllegalArgumentException when adapting to WebClientExchangeTagsProvider #​33483
    • Reactive observation auto-configuration does not declare order for WebFilter #​33444
    • Web server fails to start due to "Resource location must not be null" when attempting to use a PKCS 11 KeyStore #​33433
    • Actuator health endpoint for neo4j throws NoSuchElementException and always returns Status.DOWN #​33428
    • Anchors in YAML configuration files throw UnsupportedOperationException #​33404
    • ZipkinRestTemplateSender is not customizable #​33399
    • AOT doesn't work with Logstash Logback Encoder #​33387
    • Maven process-aot goal fails when release version is set in Maven compiler plugin #​33382
    • DependsOnDatabaseInitializationPostProcessor re-declares bean dependencies at native image runtime #​33374
    • @SpringBootTest now throws a NullPointerException rather than a helpful IllegalStateException when @SpringBootConfiguration is not found #​33371
    • bootBuildImage always trys to create a native image due to bootJar always adding a META-INF/native-image/argfile to the jar #​33363
    :notebook_with_decorative_cover: Documentation
    • Improve gradle plugin tags documentation #​33617
    • Improve maven plugin tags documentation #​33616
    • Fix typo in tomcat accesslog checkExists doc #​33512
    • Documented Java compiler level is wrong #​33505
    • Fix typo in documentation #​33453
    • Update instead of replace environment in bootBuildImage documentation #​33424
    • Update the reference docs to document the need to declare the native-maven-plugin when using buildpacks to create a native image #​33422
    • Document that the shutdown endpoint is not intended for use when deploying a war to a servlet container #​33410
    • Reinstate GraphQL testing documentaion #​33407
    • Description of NEVER in Sanitize Sensitive Values isn't formatted correctly #​33398
    :hammer: Dependency Upgrades
    :heart: Contributors

    Thank you to all the contributors who worked on this release:

    @​Artur-, @​aksh1618, @​candrews, @​cdanger, @​currenjin, @​izeye, @​jprinet, @​lishangbu, @​ohdaeho, @​peter-janssen, and @​shekharAggarwal

    v3.0.0

    See the Release notes for 3.0 for upgrade instructions and details of new features.

    :star: New Features
    • Provide a configuration property for the observation patterns of Spring Integration components #​33099
    :lady_beetle: Bug Fixes
    • io.micrometer.tracing.Tracer on the classpath breaks AOT processing for tests #​33298
    • Tracer library HTTP instrumentation is auto-configured unnecessarily #​33287
    • Auto-configuration ignores user-provided ObservationConventions #​33285
    • ScheduledBeanLazyInitializationExcludeFilter is auto-configured even when annotation-based scheduled has not been enabled #​33284
    • SpringBootContextLoader prints banner twice when using a @ContextHierarchy #​33263
    • Properties migrator causes an application to fail to start if it tries to map a property whose metadata data entry contains an invalid configuration property name #​33250
    • Wavefront MeterRegistryCustomizer is not applying application tags from application.properties #​33244
    • Actuator responses no longer format timestamps as ISO-8601 #​33236
    • Configuration property is not bound in a native image when property has get, set, and is methods #​33232
    • Configuration property binding does not deal with bridge methods #​33212
    • Contribute missing resource hints for GraphQL schema files and GraphiQL HTML page #​33208
    • Hints for ClientHttpRequestFactory should only be generated for matching methods #​33203
    • Native profile should configure execution in pluginManagement #​33184
    • Configuring management.server.port via a config tree results in a ConverterNotFoundException when the management context is refreshed #​33169
    • JBoss logging does not route directly to SLF4J when using Logback #​33155
    • Test with UseMainMethod.Always do not work with Kotlin main functions #​33114
    • Maven process-aot does not specify source and target release when compiling generated sources #​33112
    • Some Actuator beans are ineligible for post-processing #​33110
    • AOT-generated source fails to compile when Actuator is enabled on a WebFlux project #​33106
    • @ContextHierarchy should never be used with main method #​33078
    • Maven process-aot fails when compiler plugin has been configured with --enable-preview #​33012
    • Wavefront application tags differ from those used in a Spring Boot 2.x application #​32844
    • Maven goal spring-boot:build-image runs package phase twice #​26455
    :notebook_with_decorative_cover: Documentation
    • Document observation for R2DBC #​33335
    • Align Tomcat multiple connectors example with recommendation to configure SSL declaratively #​33333
    • Actuator document is misleading about k8s startup probe #​33327
    • Update documented for @Timed to reflect narrower support #​33282
    • Update reference documentation to replace mentions of tags providers and contributors with their Observation-based equivalents #​33281
    • Link to Micrometer's @Timed documentation #​33266
    • Clarify use of the spring.cache.type property with Hazelcast #​33258
    • Example git.commit.time in the Actuator API documentation is thousands of years in the future #​33256
    • Update Spring Security filter dispatcher types docs to reflect change in default value #​33252
    • Documentation for nested configuration properties in a native image uses @NestedConfigurationProperty too widely #​33239
    • Document that the jar task should not be disabled when building a native image #​33238
    • Document nesting configuration properties using records or Kotlin data classes and how and when to use @NestedConfigurationProperty #​33235
    • Links to Features describes sections that have moved elsewhere #​33214
    • Fix broken links in docs #​33209
    • Document the need for compilation with -parameters when targeting a native image #​33182
    • Remove outdated native image documentation #​33109
    • Mention @RegisterReflectionForBinding in the docs #​32903
    :hammer: Dependency Upgrades
    :heart: Contributors

    Thank you to all the contributors who worked on this release:

    @​artembilan, @​dreis2211, @​hpoettker, @​izeye, @​jonatan-ivanov, @​oppegard, @​sdeleuze, @​ttddyy, @​tumit, and @​vpavic


    Configuration

    📅 Schedule: Branch creation - "after 10pm every weekday,before 5am every weekday,every weekend" (UTC), Automerge - At any time (no schedule defined).

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    â™» Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    🔕 Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 0
  • Update spring core to v6 (major)

    Update spring core to v6 (major)

    Mend Renovate

    This PR contains the following updates:

    | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | org.springframework:spring-jdbc | 5.3.24 -> 6.0.3 | age | adoption | passing | confidence | | org.springframework:spring-tx | 5.3.24 -> 6.0.3 | age | adoption | passing | confidence | | org.springframework:spring-test | 5.3.24 -> 6.0.3 | age | adoption | passing | confidence | | org.springframework:spring-context | 5.3.24 -> 6.0.3 | age | adoption | passing | confidence |


    Release Notes

    spring-projects/spring-framework

    v6.0.3

    :star: New Features
    • Throw PessimisticLockingFailureException/CannotAcquireLockException instead of plain ConcurrencyFailureException #​29675
    • Introduce additional constructors in MockClientHttpRequest and MockClientHttpResponse #​29670
    • Fall back to JdkClientHttpConnector as ClientHttpConnector #​29645
    • Optimize object creation in RequestMappingHandlerMapping#handleNoMatch #​29634
    • Align multipart codecs on client and server #​29630
    • Deprecate "application/graphql+json" media type after spec changes #​29617
    • HTTP interface client does not call FormHttpMessageWriter when writing form data #​29615
    • ProblemDetail doesn't override the equals method #​29606
    • Add title to SockJS iFrames for accessibility compliance #​29594
    • Forbid loading of a test's ApplicationContext in AOT mode if AOT processing failed #​29579
    • Deprecate JettyWebSocketClient in favor of StandardWebSocketClient #​29576
    • Improve options to expose MessageSource formatted errors for a ProblemDetail response #​29574
    • Make @ModelAttribute and @InitBinder annotations @Reflective #​29572
    • Update BindingReflectionHintsRegistrar to support properties on records #​29571
    :lady_beetle: Bug Fixes
    • Cannot use WebDAV methods in Spring MVC 6.0 anymore #​29689
    • AnnotatedElementUtils.findMergedRepeatableAnnotations does not fetch results when other attributes exist in container annotation #​29685
    • BeanWrapperImpl NPE in setWrappedInstance after invoking getPropertyValue #​29681
    • SpEL ConstructorReference does not generate AST representation of arrays #​29665
    • NullPointerException in BindingReflectionHintsRegistrar for anonymous classes #​29657
    • DataBufferInputStream violates InputStream contract #​29642
    • Component scanning no longer uses component index for @Named, @ManagedBean, and other Jakarta annotations #​29641
    • Fix canWrite in PartHttpMessageWriter #​29631
    • NoHandlerFoundException mistakenly returns request headers from ErrorResponse#getHeaders #​29626
    • URI override for @HttpExchange doesn't work if there are both URI and @PathVariable method parameters #​29624
    • Unnecessary parameter name introspection for constructor-arg resolution (leading to LocalVariableTableParameterNameDiscoverer warnings) #​29612
    • Set detail from reason in both constructors of ResponseStatusException #​29608
    • SpEL string literal misses single quotation marks in toStringAST() #​29604
    • AOT code generation fails for bean of type boolean #​29598
    • request-scoped bean with @Lazy fails in native image (due to missing detection of CGLIB lazy resolution proxies) #​29584
    • 500 error from WebFlux when parsing Content-Type leads to InvalidMediaTypeException #​29565
    • ConcurrentLruCache implementation is using too much heap memory #​29520
    • Duplicate key violation gets translated to DataIntegrityViolationException instead of DuplicateKeyException in Spring 6 #​29511
    • SpEL: Two double quotes are replaced by one double quote in single quoted String literal (and vice versa) #​28356
    :notebook_with_decorative_cover: Documentation
    :hammer: Dependency Upgrades
    :heart: Contributors

    Thank you to all the contributors who worked on this release:

    @​Aashay-Chapatwala, @​CoderYellow, @​ShenFeng312, @​Spark61, @​divcon, @​izeye, @​koo-taejin, @​mdeinum, @​mhalbritter, @​quaff, and @​singhbaljit

    v6.0.2

    :star: New Features
    • Rely on standard parameter name resolution in Bean Validation 3.0 #​29566
    :lady_beetle: Bug Fixes
    • ResponseStatusException does not use the reason to set the "detail" field #​29567
    • LocalVariableTableParameterNameDiscoverer logs many warnings with Hibernate validation #​29563
    :notebook_with_decorative_cover: Documentation

    v6.0.1

    :star: New Features

    • Make SourceHttpMessageConverter optional #​29535
    • Deprecate LocalVariableTableParameterNameDiscoverer completely (avoiding its exposure in native images) #​29531
    • Make GeneratorStrategy.generate unreachable on native #​29521
    • Update LogAdapter to allow build-time code removal #​29506

    :lady_beetle: Bug Fixes

    • Unhandled exceptions should mark Servlet observation outcome as error #​29512

    :notebook_with_decorative_cover: Documentation

    :hammer: Dependency Upgrades

    :heart: Contributors

    Thank you to all the contributors who worked on this release:

    @​Encyclopedias, @​andregasser, @​davidcostanzo, @​divcon, @​jiangying000, @​mdeinum, and @​wilkinsona

    v6.0.0

    See What's New in Spring Framework 6.x and Upgrading to Spring Framework 6.x for upgrade instructions and details of new features.

    :star: New Features

    • Avoid direct URL construction and URL equality checks #​29486
    • Simplify creating RFC 7807 responses from functional endpoints #​29462
    • Allow test classes to provide runtime hints via declarative mechanisms #​29455

    :notebook_with_decorative_cover: Documentation

    • Align javadoc of DefaultParameterNameDiscoverer with its behavior #​29494
    • Document AOT support in the TestContext framework #​29482
    • Document Ahead of Time processing in the reference guide #​29350

    :hammer: Dependency Upgrades

    :heart: Contributors

    Thank you to all the contributors who worked on this release:

    @​ophiuhus and @​wilkinsona


    Configuration

    📅 Schedule: Branch creation - "after 10pm every weekday,before 5am every weekday,every weekend" (UTC), Automerge - At any time (no schedule defined).

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    â™» Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    🔕 Ignore: Close this PR and you won't be reminded about these updates again.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 0
  • Issue-802: Ensure commit is on graph

    Issue-802: Ensure commit is on graph

    If the bot does not have admin rights on github, the push to master will fail. However, the creation of the tag will be successful creating a tag object that is not on the graph. To avoid this we place the commit on a branch an push that branch, to be merged manually after the release

    Signed-off-by: l-1sqared [email protected]

    opened by l-1squared 0
  • jgiven-html-app : no translation available

    jgiven-html-app : no translation available

    Hi !

    Currently, it's possible to write JGiven scenarios in some other languages than English (Spanish for example). While using this feature both with the HTML5 app' generator, we end up with a mixed interface with menus/headers in English (All scenarios, Failed, Pending) and our scenarios in the chosen language.

    The underlying AngularJS app does not seems to include a translation system. All labels seem to be hard-coded.

    1. What would be the best solution to translate the HTML5 app' ?
    2. Would it be costly to add translation system into the Angular app (as it does not seems to evolve anymore...) ?

    Thanks Clément

    HTML App 
    opened by clementheliou 2
Releases(v1.2.4)
  • v1.2.4(Oct 24, 2022)

  • v1.2.3(Oct 14, 2022)

  • v1.2.2(Jun 3, 2022)

  • v.1.2.1(May 4, 2022)

  • v1.2.0(Jan 11, 2022)

  • v1.1.0(Aug 18, 2021)

  • v1.0.0(Mar 4, 2021)

  • v1.0.0-RC7(Nov 26, 2020)

    seventh release candidate for JGiven. Functionally equivalent to RC6 The binaries may be found here: https://search.maven.org/search?q=g:com.tngtech.jgiven%20AND%20v:1.0.0-RC7

    Source code(tar.gz)
    Source code(zip)
  • v1.0.0-RC6(Nov 9, 2020)

    the current packages can be found at:

    • https://search.maven.org/search?q=g:com.tngtech.jgiven
    • https://plugins.gradle.org/plugin/com.tngtech.jgiven.gradle-plugin
    Source code(tar.gz)
    Source code(zip)
  • v0.18.2(Sep 7, 2019)

  • v0.18.1(Sep 4, 2019)

    Exception handling changed for TestNG

    When using TestNG, exceptions are not longer caught and suppressed until the end of a scenario. This means that steps following a failed step are no longer shown in the scenario report. This change was needed to ensure that TestNG reports the correct test status in case of an exception.

    See PR #422 and Issue #312 for details.

    Fixed Issues

    • Fix issue with @Pending(executeSteps = true) that marked a scenario as failed instead of pending #402
    • Make TestNG ScenarioTestListener work with parallel="tests" option #409
    Source code(tar.gz)
    Source code(zip)
  • v0.18.0(Aug 30, 2019)

    New Features

    • The CurrentStep interface has a new method setName to change the name of a step programmatically #386

    Fixed Issues

    • Fixed calculation of minimal thumbnail sizes #417
    Source code(tar.gz)
    Source code(zip)
  • v0.17.1(Jan 20, 2019)

  • v0.17.0(Nov 10, 2018)

  • v0.16.1(Sep 22, 2018)

    New Features

    • First release of the Spock integration #358 (thanks to mustaine)
    • TestNG SkipExceptions are now recognized #355

    Fixed Issues

    • Fixed a bug that prevented the use of the PowerMockRunner #365
    • Fixed a NPE that was thrown when the @Table annotations was used with an empty list #341
    Source code(tar.gz)
    Source code(zip)
  • v0.16.0(May 20, 2018)

    New Features

    • Java 10 is supported now #345

    Fixed Issues

    • Fixed an IllegalArgumentException when creating thumbnails for very small images #329 (thanks to maccluca)
    • Fixed NPE when using JUnit 5 and one test class has only disabled method #338
    • Fixed minor issue in JUnit 5 example that did not generate the HTML 5 report #340

    Backwards Incompatible Changes

    • Java 6 is not supported anymore
    Source code(tar.gz)
    Source code(zip)
  • v0.15.3(Oct 8, 2017)

  • v0.15.2(Oct 8, 2017)

    Fixed Issues

    • Fixed JUnit 5.0.0 compilation issue due to API changes #326
    • Fixed a NullPointerException in the PojoFormatter when passed object is null #318

    INFO: JGiven HTML App

    The JGiven HTML5 App is extracted into its own project. This allows us to develop the HTML5 App independently of JGiven as it is also used by jsGiven, for example. For users of JGiven nothing changes as the HTML5 App is delivered together with JGiven.

    Source code(tar.gz)
    Source code(zip)
  • v0.15.1(May 7, 2017)

  • v0.15.0(Apr 28, 2017)

    New Features

    • Thumbnail preview for image attachments added #299
    • The ReportGenerator now uses the HTML5 report as default, doesn't silently misinterprets wrong arguments and flags and offers suggestions #299
    • Formatting POJOs has been greatly improved, by allowing to specify custom formatters for fields #297 (thanks to dgrandemange)
    • @ExtendedDescription supports parameter place holders now #283
    • The HTML App has been extracted into a separate project and has been refactored internally. The functionality should not have been changed. #287

    Fixed Issues

    • Upgraded to ByteBuddy 1.6.x to fix backwards-incompatibility issues when JGiven is used with Mockito 2.7.19 #309
    • Introduced CaseAs annotation to replace the CaseDescription annotation #301
    • Removed ambiguity between parsing of As, CaseAs and ExtendedDescription. Argument enumeration starts from 1, internal count of how often placeholders are used, see docs to As for every feature. All argument reference types are interoperable #301
    Source code(tar.gz)
    Source code(zip)
  • v0.14.1(Feb 11, 2017)

    Fixed Issues

    • Performance: Caching the classes generated with ByteBuddy introduced with v0.14.0 to decrease the memory consumption and performance of creating stage classes #294
    • OSGi: Using class loader of the stage class instead of the current thread when creating classes with ByteBuddy #302
    • HTML Report: Long exception messages of failed Scenarios are now wrapped #292
    Source code(tar.gz)
    Source code(zip)
  • v0.14.0(Jan 6, 2017)

    Switch from cglib to ByteBuddy

    The internal JGiven interception mechanism was changed to use ByteBuddy instead of cglib. The main reason for this change is support for Android (see below). From a users perspective, JGiven should behave as before.

    Backwards Incompatible Changes

    Spring Integration

    In order to fix issue #259 the Spring integration was largely rewritten. If you only had used the @EnableJGiven and @JGivenStage annotations, nothing should change. If you had a custom Spring configuration for JGiven you have to change the following:

    • The classes SpringStepMethodInterceptor and JGivenStageAutoProxyCreator do not exist anymore, you have to remove all references
    • As a replacement the new class JGivenBeanFactoryPostProcessor exists now. You have to register this bean in your Spring configuration

    New Features

    • Tags with the same name, but different packages are now correctly distinguished #242 (thanks to ahus1)
    • Scenario states can be marked as required to make scenarios fail quickly and with a clear message if the state hasn't been provided #255

    Experimental JUnit 5 Support

    JGiven can now be used together with JUnit 5, by using the JGivenExtension. Refer to the user guide for additional details. #277

    Experimental Android Support

    There is a new experimental module called jgiven-android, which enables JGiven support for tests executed on the device or simulator. This makes it possible to combine JGiven with Espresso tests and even integrate screenshots in the JGiven report. For details of how to setup and use the Android support have a look at the jgiven-android-test project.

    Also see #258

    Special thanks to orginx

    Fixed Issues

    • Spring Integration: Nested Steps are now supported when using Spring #259
    Source code(tar.gz)
    Source code(zip)
  • v0.14.0-RC3(Dec 29, 2016)

  • v0.14.0-RC2(Dec 29, 2016)

    Important changes compared to 0.14.0-RC1

    • Added experimental JUnit 5 support (see http://jgiven.org/userguide/#_junit_5_experimental)
    • Fixed some issues with the new Spring integration
    • Fixed issue with the Maven Plugin (also see v0.13.1)

    Note: this release contains broken pom.xml files. Please use release 0.14.0-RC3

    Source code(tar.gz)
    Source code(zip)
  • v0.13.1(Dec 25, 2016)

  • v0.14.0-RC1(Dec 24, 2016)

    Switch from cglib to ByteBuddy

    The internal JGiven interception mechanism was changed to use ByteBuddy instead of cglib. The main reason for this change is support for Android (see below). From a users perspective, JGiven should behave as before.

    Backwards Incompatible Changes

    Spring Integration

    In order to fix issue #259 the Spring integration was largely rewritten. If you only had used the @EnableJGiven and @JGivenStage annotations, nothing should change. If you had a custom Spring configuration for JGiven you have to change the following:

    • The classes SpringStepMethodInterceptor and JGivenStageAutoProxyCreator do not exist anymore, you have to remove all references
    • As a replacement the new class JGivenBeanFactoryPostProcessor exists now. You have to register this bean in your Spring configuration

    New Features

    • Tags with the same name, but different packages are now correctly distinguished #242 (thanks to ahus1)
    • Scenario states can be marked as required to make scenarios fail quickly and with a clear message if the state hasn't been provided #255

    Experimental Android Support

    There is a new experimental module called jgiven-android, which enables JGiven support for tests executed on the device or simulator. This makes it possible to combine JGiven with Espresso tests and even integrate screenshots in the JGiven report. For details of how to setup and use the Android support have a look at the jgiven-android-test project.

    Also see #258

    Special thanks to orginx

    Fixed Issues

    • Spring Integration: Nested Steps are now supported when using Spring #259
    Source code(tar.gz)
    Source code(zip)
  • v0.13.0(Dec 16, 2016)

    Backwards Incompatible Changes

    In order to fix issue #239, a backwards incompatible change had to be done:

    • The ScenarioBase class is now abstract, because the method getScenario() was made abstract. Thus, subclasses have to implement the getScenario() method. As, in general, you should have inherited either from ScenarioTest or SimpleScenarioTest the change should most likely not effect you. If you have directly inherited from ScenarioBase, have a look at the ScenarioTest class of how to implement the getScenario() method.

    New Features

    • Custom annotations can now also be defined for the @Table annotation #235
    • In addition to text and images, all kinds of media types can now be used as attachments #228 (thanks to ahus1)

    Small Improvements

    • Assertion errors shown in the HTML report respect line breaks now. #234

    Bug Fixes

    • TestNG: executing test methods in parallel is now possible. #239
    • Correctly handle nested steps in parametrized scenarios. #248
    • Correctly report pending status of parametrized scenarios. #200
    • Spring: added support for executing Spring tests with the Spring JUnit rules instead of the Spring test runner. #250
    Source code(tar.gz)
    Source code(zip)
  • v0.13.0-RC1(Nov 24, 2016)

    Backwards Incompatible Changes

    In order to fix issue #239, a backwards incompatible change had to be done:

    • The ScenarioBase class is now abstract, because the method getScenario() was made abstract. Thus, subclasses have to implement the getScenario() method. As, in general, you should have inherited either from ScenarioTest or SimpleScenarioTest the change should most likely not effect you. If you have directly inherited from ScenarioBase, have a look at the ScenarioTest class of how to implement the getScenario() method.

    New Features

    • Custom annotations can now also be defined for the @Table annotation #235
    • In addition to text and images, all kinds of media types can now be used as attachments #228 (thanks to ahus1)

    Small Improvements

    • Assertion errors shown in the HTML report respect line breaks now. #234

    Bug Fixes

    • TestNG: executing test methods in parallel is now possible. #239
    • Correctly handle nested steps in parametrized scenarios. #248
    • Correctly report pending status of parametrized scenarios. #200
    • Spring: added support for executing Spring tests with the Spring JUnit rules instead of the Spring test runner. #250
    Source code(tar.gz)
    Source code(zip)
  • v0.12.1(Sep 18, 2016)

  • v0.12.0(Sep 18, 2016)

    New Features

    • Added possibility to use JGiven in JUnit by just using two rules. No deriving from ScenarioTest is necessary anymore, see #232
    • Allow multiple formatter annotations on arguments, e.g., "@Quoted @YesNo", see #204.
    • Added a new comment() method to provide further information on specific step method invocations, see #50.
    • Steps can now have multiple attachments #194.
    • Tags can now be hidden from the navigation bar in the HTML report by setting the showInNavigation a ttribute to false #211.
    • Added a new CurrentScenario interface similar to CurrentStep.
    • The CurrentScenario interface allows adding tags programmatically, see #172.
    • Allow tag annotations on step methods and step classes.
    • Extended the @As annotation with a provider mechanism, see #189.

    Breaking Changes in the JSON model

    • Due to the introduction of multiple attachments per step, the JSON model had to be changed in an backwards-incompatible way. Instead of a single field attachment that holds a single attachment object, a step has now an attachments field that holds an array of attachment objects.

    Fixed Issues

    • Fixed an issue that step methods that are all uppercase are formatted in an unexpected way #221
    • Fixed an issue that newlines of formatted arguments have not been formatted in the HTML5 report #226
    Source code(tar.gz)
    Source code(zip)
Owner
TNG Technology Consulting GmbH
TNG Technology Consulting GmbH is a value-based consulting partnership focused on high end information technology.
TNG Technology Consulting GmbH
JVM version of Pact. Enables consumer driven contract testing, providing a mock service and DSL for the consumer project, and interaction playback and verification for the service provider project.

pact-jvm JVM implementation of the consumer driven contract library pact. From the Ruby Pact website: Define a pact between service consumers and prov

Pact Foundation 962 Dec 31, 2022
JVM version of Pact Enables consumer driven contract testing

JVM version of Pact. Enables consumer driven contract testing, providing a mock service and DSL for the consumer project, and interaction playback and verification for the service provider project.

Pact Foundation 961 Dec 30, 2022
HATEOAS with HAL for Java. Create hypermedia APIs by easily serializing your Java models into HAL JSON.

hate HATEOAS with HAL for Java. Create hypermedia APIs by easily serializing your Java models into HAL JSON. More info in the wiki. Install with Maven

null 20 Oct 5, 2022
Never debug a test again: Detailed failure reports and hassle free assertions for Java tests - Power Asserts for Java

Scott Test Reporter for Maven and Gradle Get extremely detailed failure messages for your tests without assertion libraries, additional configuration

Dávid Csákvári 133 Nov 17, 2022
TCP Chat Application - Java networking, java swing

TCP-Chat-Application-in-Java TCP Chat Application - Java networking, java swing Java – Multithread Chat System Java Project on core Java, Java swing &

Muhammad Asad 5 Feb 4, 2022
A sample repo to help you handle basic auth for automation test in Java-selenium on LambdaTest. Run your Java Selenium tests on LambdaTest platform.

How to handle basic auth for automation test in Java-selenium on LambdaTest Prerequisites Install and set environment variable for java. Windows - htt

null 12 Jul 13, 2022
A sample repo to help you clear browser cache with Selenium 4 Java on LambdaTest cloud. Run your Java Selenium tests on LambdaTest platform.

How to clear browser cache with Selenium 4 Java on LambdaTest cloud Prerequisites Install and set environment variable for java. Windows - https://www

null 12 Jul 13, 2022
A sample repo to help you run automation test in incognito mode in Java-selenium on LambdaTest. Run your Java Selenium tests on LambdaTest platform.

How to run automation test in incognito mode in Java-selenium on LambdaTest Prerequisites Install and set environment variable for java. Windows - htt

null 12 Jul 13, 2022
A sample repo to help you handle cookies for automation test in Java-selenium on LambdaTest. Run your Java Selenium tests on LambdaTest platform.

How to handle cookies for automation test in Java-selenium on LambdaTest Prerequisites Install and set environment variable for java. Windows - https:

null 13 Jul 13, 2022
A sample repo to help you set geolocation for automation test in Java-selenium on LambdaTest. Run your Java Selenium tests on LambdaTest platform.

How to set geolocation for automation test in Java-selenium on LambdaTest Prerequisites Install and set environment variable for java. Windows - https

null 12 Jul 13, 2022
A sample repo to help you capture JavaScript exception for automation test in Java-selenium on LambdaTest. Run your Java Selenium tests on LambdaTest platform.

How to capture JavaScript exception for automation test in Java-selenium on LambdaTest Prerequisites Install and set environment variable for java. Wi

null 12 Jul 13, 2022
A sample repo to help you find an element by text for automation test in Java-selenium on LambdaTest. Run your Java Selenium tests on LambdaTest platform.

How to find an element by text for automation test in Java-selenium on LambdaTest Prerequisites Install and set environment variable for java. Windows

null 12 Jul 13, 2022
A sample repo to help you emulate network conditions in Java-selenium automation test on LambdaTest. Run your Java Selenium tests on LambdaTest platform.

How to emulate network conditions in Java-selenium automation test on LambdaTest Prerequisites Install and set environment variable for java. Windows

null 12 Jul 13, 2022
Awaitility is a small Java DSL for synchronizing asynchronous operations

Testing asynchronous systems is hard. Not only does it require handling threads, timeouts and concurrency issues, but the intent of the test code can

Awaitility 3.3k Dec 31, 2022
Java binding for Hoverfly

Hoverfly Java - Easy Creation of Stub Http Servers for Testing A Java native language binding for Hoverfly, a Go proxy which allows you to simulate ht

null 148 Nov 21, 2022
Java DSL for easy testing of REST services

Testing and validation of REST services in Java is harder than in dynamic languages such as Ruby and Groovy. REST Assured brings the simplicity of usi

REST Assured 6.2k Dec 31, 2022
Library that allows tests written in Java to follow the BDD style introduced by RSpec and Jasmine.

J8Spec J8Spec is a library that allows tests written in Java to follow the BDD style introduced by RSpec and Jasmine. More details here: j8spec.github

J8Spec 45 Feb 17, 2022
A modern testing and behavioural specification framework for Java 8

Introduction If you're a Java developer and you've seen the fluent, modern specification frameworks available in other programming languages such as s

Richard Warburton 250 Sep 12, 2022