This repository has been archived by the owner on Feb 8, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added ability to fetch compute logs in the asset api
- Added tests - Updated version of common-utils
- Loading branch information
Showing
8 changed files
with
136 additions
and
1 deletion.
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
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
15 changes: 15 additions & 0 deletions
15
src/main/java/io/keyko/nevermined/models/gateway/ComputeLogs.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,15 @@ | ||
package io.keyko.nevermined.models.gateway; | ||
|
||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | ||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import io.keyko.nevermined.models.AbstractModel; | ||
import io.keyko.nevermined.models.FromJsonToModel; | ||
|
||
@JsonIgnoreProperties(ignoreUnknown = true) | ||
public class ComputeLogs extends AbstractModel implements FromJsonToModel { | ||
@JsonProperty | ||
public String content; | ||
|
||
@JsonProperty | ||
public String podName; | ||
} |
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
25 changes: 25 additions & 0 deletions
25
src/test/java/io/keyko/nevermined/models/ComputeLogsTest.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,25 @@ | ||
package io.keyko.nevermined.models; | ||
|
||
import com.fasterxml.jackson.core.type.TypeReference; | ||
import io.keyko.nevermined.models.gateway.ComputeLogs; | ||
import org.junit.Test; | ||
|
||
import java.io.IOException; | ||
import java.util.List; | ||
|
||
import static org.junit.Assert.assertEquals; | ||
|
||
public class ComputeLogsTest { | ||
|
||
@Test | ||
public void fromJsonTest() throws IOException { | ||
String logsJson = "[{\"content\":\"line1\",\"podName\":\"configurator\"},{\"content\":\"line2\",\"podName\":\"configurator\"}]"; | ||
List<ComputeLogs> computeLogs = ComputeLogs.fromJSON(new TypeReference<>() { | ||
}, logsJson); | ||
|
||
assertEquals("configurator", computeLogs.get(0).podName); | ||
assertEquals("line1", computeLogs.get(0).content); | ||
assertEquals("configurator", computeLogs.get(1).podName); | ||
assertEquals("line2", computeLogs.get(1).content); | ||
} | ||
} |