use of com.fo0.robot.model.ActionItem in project Robot by fo0.
the class TypeZipChainTest method unzip.
@Test
public void unzip() {
ActionItem item = ActionItem.builder().type(EActionType.Unzip).value("$SRC(/home/max/Schreibtisch/Robot/test/agent.zip) $DST(/home/max/Schreibtisch/Robot/test/x)").description("description example").build();
List<KeyValue> list = item.parsedValue();
KeyValue zipFile = list.stream().filter(e -> e.getKey().equals(CONSTANTS_PATTERN.SOURCE)).findFirst().orElse(null);
Assert.assertEquals(CONSTANTS_PATTERN.SOURCE, zipFile.getKey());
Assert.assertEquals("/home/max/Schreibtisch/Robot/test/agent.zip", zipFile.getValue());
KeyValue zipDstFolder = list.stream().filter(e -> e.getKey().equals(CONSTANTS_PATTERN.DESTINATION)).findFirst().orElse(null);
Assert.assertEquals(CONSTANTS_PATTERN.DESTINATION, zipDstFolder.getKey());
Assert.assertEquals("/home/max/Schreibtisch/Robot/test/x", zipDstFolder.getValue());
}
use of com.fo0.robot.model.ActionItem in project Robot by fo0.
the class ActionContext method pop.
public Entry<Integer, ActionItem> pop() {
ActionItem latest = map.get(current);
SimpleEntry<Integer, ActionItem> entry = new SimpleEntry<Integer, ActionItem>(current, latest);
current++;
end = map.size();
return entry;
}
Aggregations