Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a possibility to reset CaptureOutput #8390

Closed
SchulteMarkus opened this issue Feb 23, 2017 · 2 comments
Closed

Add a possibility to reset CaptureOutput #8390

SchulteMarkus opened this issue Feb 23, 2017 · 2 comments
Labels
status: superseded An issue that has been superseded by another

Comments

@SchulteMarkus
Copy link

Hi there,

I am using OutputCapture as part of my integration tests.
I am testing the spring-boot application as suggested in boot-features-testing-spring-boot-applications.
After my application is booted in my integration-test, I am using HtmlUnit for making HTTP calls against the running application.
I am testing a multi-step form, so I am performing several HTTP calls. Each of which produces a lot of logging, which I can access by using OutputCapture.

When doing my second HTTP call against the application, I want to access the logs produced only by/after this call. Right now, OutputCapture keeps increasing, so the first log line(s) (produced by the first HTTP call) is kept forever.
On this point, I would be very happy to have a kind of "reset"-method in OutputCapture. I would use this after having done my first HTTP call.

By the way, I have decided to use a workaround in my project:

class ResetableOutputCapture extends org.springframework.boot.test.rule.OutputCapture {
  public void reset() {
    super.releaseOutput();
    super.captureOutput();
  }
}
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Feb 23, 2017
@philwebb philwebb added priority: normal status: ideal-for-contribution An issue that a contributor can help us with type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged labels Feb 28, 2017
@philwebb
Copy link
Member

That would seem like a nice addition. I've marked this one as ideal-for-contribution.

@snicoll
Copy link
Member

snicoll commented Mar 10, 2017

Closing in favour of PR #8490

@snicoll snicoll closed this as completed Mar 10, 2017
@snicoll snicoll added status: duplicate A duplicate of another issue and removed priority: normal status: ideal-for-contribution An issue that a contributor can help us with type: enhancement A general enhancement labels Mar 10, 2017
snicoll pushed a commit that referenced this issue Mar 10, 2017
snicoll added a commit that referenced this issue Mar 10, 2017
* pr/8490:
  Polish contribution
  Introduce reset method to OutputCapture
@philwebb philwebb added status: superseded An issue that has been superseded by another and removed status: duplicate A duplicate of another issue labels Sep 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: superseded An issue that has been superseded by another
Projects
None yet
Development

No branches or pull requests

4 participants