-
Notifications
You must be signed in to change notification settings - Fork 130
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add video display in tests * Fix tests * Fix template spacing (for minify) * Fix GherkinDialect related tests * Update maven.yml (remove update dependency graph) This was causing several 403 issues: https://github.com/extent-framework/extentreports-java/actions/runs/9579125973/job/26410971673?pr=400 ``` Error: HTTP Status 403 for request POST https://api.github.com/repos/extent-framework/extentreports-java/dependency-graph/snapshots Error: Response body: { "message": "Resource not accessible by integration", "documentation_url": "https://docs.github.com/rest/dependency-graph/dependency-submission#create-a-snapshot-of-dependencies-for-a-repository", "status": "403" } Error: Resource not accessible by integration Error: HttpError: Resource not accessible by integration at /home/runner/work/_actions/advanced-security/maven-dependency-submission-action/571e99aab1055c2e71a1e2309b9691de18d6b7d6/webpack:/maven-dependency-tree-action/node_modules/@github/dependency-submission-toolkit/dist/index.js:5317:1 at processTicksAndRejections (node:internal/process/task_queues:96:5) /home/runner/work/_actions/advanced-security/maven-dependency-submission-action/571e99aab1055c2e71a1e2309b9691de18d6b7d6/webpack:/maven-dependency-tree-action/node_modules/@github/dependency-submission-toolkit/dist/index.js:396 function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } ^ Error: Failed to submit snapshot: HttpError: Resource not accessible by integration at /home/runner/work/_actions/advanced-security/maven-dependency-submission-action/571e99aab1055c2e71a1e2309b9691de18d6b7d6/webpack:/maven-dependency-tree-action/node_modules/@github/dependency-submission-toolkit/dist/index.js:499:1 at Generator.throw (<anonymous>) at rejected (/home/runner/work/_actions/advanced-security/maven-dependency-submission-action/571e99aab1055c2e71a1e2309b9691de18d6b7d6/webpack:/maven-dependency-tree-action/node_modules/@github/dependency-submission-toolkit/dist/index.js:396:1) at processTicksAndRejections (node:internal/process/task_queues:96:5) ``` --------- Co-authored-by: grasshopper7 <grass.hopper.moc@gmail.com> Co-authored-by: Anshoo Arora <anshooarora@gmail.com>
- Loading branch information
1 parent
41ae106
commit 182c433
Showing
26 changed files
with
749 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 61 additions & 0 deletions
61
src/main/java/com/aventstack/extentreports/append/MediaTypeAdapter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
package com.aventstack.extentreports.append; | ||
|
||
import java.io.IOException; | ||
|
||
import com.aventstack.extentreports.model.Media; | ||
import com.aventstack.extentreports.model.service.MediaService; | ||
import com.google.gson.TypeAdapter; | ||
import com.google.gson.stream.JsonReader; | ||
import com.google.gson.stream.JsonToken; | ||
import com.google.gson.stream.JsonWriter; | ||
|
||
public class MediaTypeAdapter extends TypeAdapter<Media> { | ||
|
||
@Override | ||
public void write(JsonWriter out, Media value) throws IOException { | ||
} | ||
|
||
@Override | ||
public Media read(JsonReader reader) throws IOException { | ||
reader.beginObject(); | ||
String fieldName = null; | ||
int cycle = 0; | ||
|
||
String type = null; | ||
String path = null; | ||
String resolvedPath = null; | ||
String title = null; | ||
String base64 = null; | ||
|
||
while (reader.hasNext()) { | ||
JsonToken token = reader.peek(); | ||
if (token.equals(JsonToken.NAME)) { | ||
fieldName = reader.nextName(); | ||
} | ||
if ("string".equalsIgnoreCase(token.name()) && fieldName.equalsIgnoreCase("type")) { | ||
token = reader.peek(); | ||
type = reader.nextString(); | ||
} | ||
if ("string".equalsIgnoreCase(token.name()) && fieldName.equalsIgnoreCase("path")) { | ||
token = reader.peek(); | ||
path = reader.nextString(); | ||
} | ||
if ("string".equalsIgnoreCase(token.name()) && fieldName.equalsIgnoreCase("resolvedPath")) { | ||
token = reader.peek(); | ||
resolvedPath = reader.nextString(); | ||
} | ||
if ("string".equalsIgnoreCase(token.name()) && fieldName.equalsIgnoreCase("title")) { | ||
token = reader.peek(); | ||
title = reader.nextString(); | ||
} | ||
if ("string".equalsIgnoreCase(token.name()) && fieldName.equalsIgnoreCase("base64")) { | ||
token = reader.peek(); | ||
base64 = reader.nextString(); | ||
} | ||
if (cycle++ > 10) | ||
return MediaService.createMedia(type, path, resolvedPath, title, base64); | ||
} | ||
reader.endObject(); | ||
return MediaService.createMedia(type, path, resolvedPath, title, base64); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
src/main/java/com/aventstack/extentreports/model/Video.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package com.aventstack.extentreports.model; | ||
|
||
import java.io.Serializable; | ||
import java.util.HashMap; | ||
|
||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.Setter; | ||
|
||
@Getter | ||
@Setter | ||
public class Video extends Media implements Serializable { | ||
private static final long serialVersionUID = -6874043323709622353L; | ||
|
||
public static final String BASE64_ENCODED = "data:video/mp4;base64,"; | ||
|
||
private String base64; | ||
|
||
@Builder | ||
public Video(String path, String title, String resolvedPath, String base64) { | ||
super(MediaType.VIDEO, path, title, resolvedPath, new HashMap<String, Object>()); | ||
this.base64 = base64; | ||
} | ||
} |
Oops, something went wrong.