• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

cucumber / cucumber-jvm / 4072
86%

Build:
DEFAULT BRANCH: master
Ran 14 May 2020 06:13PM UTC
Jobs 1
Files 394
Run time 59s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
4072

push

travis-ci

web-flow
[Spring] Require an active scenario before creating beans (#1974)

The glue code context does not require an active scenario. As a result
it was possible to create scenario scoped beans that would be shared
(leak) between scenarios.

An example of this is illustrated below. Because this does require
access to the `GlueCodeScope` it is not possible to do this in
practice.

```java
@Configuration
public static class TestApplicationConfiguration {
    @Bean
    public BeanFactoryPostProcessor beanFactoryPostProcessor(){
        return factory -> factory.registerScope(SCOPE_CUCUMBER_GLUE, new GlueCodeScope());
    }

    @Bean
    public ExampleService service(ScenarioScopedApi api) {
        return new ExampleService(api);
    }

    @Bean
    @Scope(value = SCOPE_CUCUMBER_GLUE)
    public ScenarioScopedApi api() {
        return new ScenarioScopedApi();
    }
}
```

However without registering the the `GlueCodeScope` at start up Spring
will complain about missing the cucumber-glue scope rather then
complain about scope not having started or the missing proxy mode.

So to avoid further confusion:

1. GlueCodeContext will check if the context has been started.
2. Add a `@ScenarioScope` annotation that sets the correct proxy mode.
3. Do some renaming of internal classes
4. Use a global counter for conversation ids

Related
 - https://github.com/cucumber/cucumber-jvm/issues/1970
 - https://github.com/cucumber/cucumber-jvm/issues/1667

6748 of 7850 relevant lines covered (85.96%)

0.86 hits per line

Jobs
ID Job ID Ran Files Coverage
3 4072.3 (COVERAGE=true) 14 May 2020 06:13PM UTC 0
85.96
Travis Job 4072.3
Source Files on build 4072
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #4072
  • 0743e3c4 on github
  • Prev Build on master (#4065)
  • Next Build on master (#4073)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc