use of com.hp.octane.integrations.dto.general.MbtUnitParameter in project octane-ci-java-sdk by MicroFocus.
the class MbtTests method parseConfiguration.
@Test
public void parseConfiguration() {
URL url = getClass().getResource("mbtExample1.json");
MbtData mbtData = DTOFactory.getInstance().dtoFromJsonFile(new File(url.getFile()), MbtData.class);
Assert.assertEquals(4, mbtData.getUnits().size());
Assert.assertEquals(6, mbtData.getData().getParameters().size());
Assert.assertEquals(2, mbtData.getData().getIterations().size());
mbtData.getData().getIterations().forEach(strings -> Assert.assertEquals(6, strings.size()));
mbtData.getUnits().forEach(mbtUnit -> System.out.println(mbtUnit.getName() + ", parameters: " + Optional.ofNullable(mbtUnit.getParameters()).orElse(Collections.emptyList()).stream().map(MbtUnitParameter::getParameterId).collect(Collectors.joining(", "))));
mbtData.getData().getParameters().forEach(System.out::println);
mbtData.getData().getIterations().forEach(strings -> strings.forEach(System.out::println));
}
Aggregations