Skip to content

Commit eafc1b3

Browse files
authored
feat(allure-model): add optional attachment size (via #1182)
1 parent aad4638 commit eafc1b3

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

allure-java-commons/src/test/java/io/qameta/allure/AllureLifecycleTest.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,10 @@ void shouldAttachAsync() {
344344
tuple(attachment2Name, "text/plain")
345345
);
346346

347+
assertThat(attachments)
348+
.extracting(io.qameta.allure.model.Attachment::getSize)
349+
.containsOnlyNulls();
350+
347351
final String[] sources = attachments.stream()
348352
.map(io.qameta.allure.model.Attachment::getSource)
349353
.toArray(String[]::new);

allure-model/src/main/java/io/qameta/allure/model/Attachment.java

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ public class Attachment implements Serializable {
3232
private String name;
3333
private String source;
3434
private String type;
35+
private Long size;
3536

3637
/**
3738
* Gets name.
@@ -93,4 +94,24 @@ public Attachment setType(final String value) {
9394
return this;
9495
}
9596

97+
/**
98+
* Gets size.
99+
*
100+
* @return the size
101+
*/
102+
public Long getSize() {
103+
return size;
104+
}
105+
106+
/**
107+
* Sets size.
108+
*
109+
* @param value the value
110+
* @return self for method chaining
111+
*/
112+
public Attachment setSize(final Long value) {
113+
this.size = value;
114+
return this;
115+
}
116+
96117
}

0 commit comments

Comments
 (0)