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

Always setting RestAssured response attachment name to response status line if default responseAttachmentName is null #679

Merged
merged 2 commits into from
Nov 8, 2021
Merged

Always setting RestAssured response attachment name to response status line if default responseAttachmentName is null #679

merged 2 commits into from
Nov 8, 2021

Conversation

serzhshakur
Copy link
Contributor

fixes #678

@CLAassistant
Copy link

CLAassistant commented Nov 8, 2021

CLA assistant check
All committers have signed the CLA.

Always setting RestAssured response attachment name to response status line if default responseAttachmentName is null
@baev
Copy link
Member

baev commented Nov 8, 2021

@serzhshakur please fix build on Java 8

@serzhshakur
Copy link
Contributor Author

@serzhshakur please fix build on Java 8

ahh, old good java 8. Ok, will do

@baev baev added the type:bug Something isn't working label Nov 8, 2021
@baev baev merged commit 2c21ebe into allure-framework:master Nov 8, 2021
@baev
Copy link
Member

baev commented Nov 8, 2021

@serzhshakur thanks!

@iRaunchy
Copy link

iRaunchy commented Dec 8, 2021

I still see this issue with my tests:
io.qameta.allure.attachment.AttachmentRenderException: Could't render http attachment file at io.qameta.allure.attachment.FreemarkerAttachmentRenderer.render(FreemarkerAttachmentRenderer.java:49) at io.qameta.allure.attachment.FreemarkerAttachmentRenderer.render(FreemarkerAttachmentRenderer.java:28) at io.qameta.allure.attachment.DefaultAttachmentProcessor.addAttachment(DefaultAttachmentProcessor.java:41) at io.qameta.allure.restassured.AllureRestAssured.filter(AllureRestAssured.java:119) at io.restassured.filter.Filter$filter.call(Unknown Source) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47) at io.restassured.filter.Filter$filter.call(Unknown Source) at io.restassured.internal.filter.FilterContextImpl.next(FilterContextImpl.groovy:72) at io.restassured.filter.log.StatusCodeBasedLoggingFilter.filter(StatusCodeBasedLoggingFilter.java:112) at io.restassured.filter.log.ResponseLoggingFilter.filter(ResponseLoggingFilter.java:31) at io.restassured.filter.Filter$filter.call(Unknown Source) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47) at io.restassured.filter.Filter$filter.call(Unknown Source) at io.restassured.internal.filter.FilterContextImpl.next(FilterContextImpl.groovy:72) at io.restassured.filter.log.RequestLoggingFilter.filter(RequestLoggingFilter.java:140) at io.restassured.filter.Filter$filter.call(Unknown Source) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47) at io.restassured.filter.Filter$filter$0.call(Unknown Source) at io.restassured.internal.filter.FilterContextImpl.next(FilterContextImpl.groovy:72) at io.restassured.filter.FilterContext$next.call(Unknown Source) at io.restassured.internal.RequestSpecificationImpl.applyPathParamsAndSendRequest(RequestSpecificationImpl.groovy:1672) at jdk.internal.reflect.GeneratedMethodAccessor78.invoke(Unknown Source) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:568) at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:107) at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:323) at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1268) at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1035) at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:819) at groovy.lang.GroovyObject.invokeMethod(GroovyObject.java:39) at org.codehaus.groovy.runtime.callsite.PogoInterceptableSite.call(PogoInterceptableSite.java:45) at org.codehaus.groovy.runtime.callsite.PogoInterceptableSite.callCurrent(PogoInterceptableSite.java:55) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:203) at io.restassured.internal.RequestSpecificationImpl.applyPathParamsAndSendRequest(RequestSpecificationImpl.groovy:1678) at jdk.internal.reflect.GeneratedMethodAccessor77.invoke(Unknown Source) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:568) at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:107) at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:323) at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1268) at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1035) at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:819) at groovy.lang.GroovyObject.invokeMethod(GroovyObject.java:39) at org.codehaus.groovy.runtime.callsite.PogoInterceptableSite.call(PogoInterceptableSite.java:45) at org.codehaus.groovy.runtime.callsite.PogoInterceptableSite.callCurrent(PogoInterceptableSite.java:55) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:203) at io.restassured.internal.RequestSpecificationImpl.get(RequestSpecificationImpl.groovy:173) at io.restassured.internal.RequestSpecificationImpl.get(RequestSpecificationImpl.groovy) at com.tripactions.projects.admin.api.SettingsAPI.getPaymentMethodIDByName(SettingsAPI.java:119) at com.tripactions.tests.projects.admin.ui.smoke.sequential.AdminSettingsSmokeTest.tearDown(AdminSettingsSmokeTest.java:227) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:568) at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:132) at org.testng.internal.MethodInvocationHelper.invokeMethodConsideringTimeout(MethodInvocationHelper.java:61) at org.testng.internal.ConfigInvoker.invokeConfigurationMethod(ConfigInvoker.java:366) at org.testng.internal.ConfigInvoker.invokeConfigurations(ConfigInvoker.java:320) at org.testng.internal.TestInvoker.runConfigMethods(TestInvoker.java:701) at org.testng.internal.TestInvoker.runAfterGroupsConfigurations(TestInvoker.java:677) at org.testng.internal.TestInvoker.invokeMethod(TestInvoker.java:661) at org.testng.internal.TestInvoker.invokeTestMethod(TestInvoker.java:174) at org.testng.internal.MethodRunner.runInSequence(MethodRunner.java:46) at org.testng.internal.TestInvoker$MethodInvocationAgent.invoke(TestInvoker.java:822) at org.testng.internal.TestInvoker.invokeTestMethods(TestInvoker.java:147) at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:146) at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:128) at java.base/java.util.ArrayList.forEach(ArrayList.java:1511) at org.testng.TestRunner.privateRun(TestRunner.java:764) at org.testng.TestRunner.run(TestRunner.java:585) at org.testng.SuiteRunner.runTest(SuiteRunner.java:384) at org.testng.SuiteRunner.access$000(SuiteRunner.java:28) at org.testng.SuiteRunner$SuiteWorker.run(SuiteRunner.java:425) at org.testng.internal.thread.ThreadUtil.lambda$execute$0(ThreadUtil.java:66) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) at java.base/java.lang.Thread.run(Thread.java:833) Caused by: java.lang.IndexOutOfBoundsException: start 1068, end 0, length 8682 at java.base/java.lang.AbstractStringBuilder.checkRange(AbstractStringBuilder.java:1802) at java.base/java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:680) at java.base/java.lang.StringBuffer.append(StringBuffer.java:388) at java.base/java.io.StringWriter.write(StringWriter.java:122) at freemarker.template.utility.StringUtil.XMLOrHTMLEnc(StringUtil.java:215) at freemarker.template.utility.StringUtil.XHTMLEnc(StringUtil.java:105) at freemarker.core.HTMLOutputFormat.output(HTMLOutputFormat.java:62) at freemarker.core.DollarVariable.accept(DollarVariable.java:68) at freemarker.core.Environment.visit(Environment.java:347) at freemarker.core.Environment.visit(Environment.java:353) at freemarker.core.Environment.visit(Environment.java:353) at freemarker.core.Environment.process(Environment.java:326) at freemarker.template.Template.process(Template.java:383) at io.qameta.allure.attachment.FreemarkerAttachmentRenderer.render(FreemarkerAttachmentRenderer.java:46) ... 77 more

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
theme:rest-assured type:bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Attachment name for RestAssured responses is set once and is reused across all subsequent responses
4 participants