use of org.eclipse.winery.accountability.model.authorization.AuthorizationInfo in project winery by eclipse.
the class AccountabilityManagerImplTest method validateBlockchainInputArguments.
private static Stream<Arguments> validateBlockchainInputArguments() throws Exception {
String manifestFile = "TOSCA-Meta-Version: 1.0\n" + "CSAR-Version: 1.0\n" + "Created-By: Winery 3.0.0-SNAPSHOT\n" + "Entry-Definitions: Definitions/servicetemplates1__MyTinyToDo_Bare_Docker.tosca\n" + "\n" + "Name: myTestFile.tosca\n" + "Content-Type: application/vnd.oasis.tosca.definitions\n" + "SHA-256: 97193968948686d6947d4d760d3fe724b9981980056b8902be92e91fbe9e3eed\n" + "\n" + "Name: myTestFile2.tosca\n" + "Content-Type: application/vnd.oasis.tosca.definitions\n" + "SHA-256: a99c9a8e954355e34f11282a6dec25cc5e0b3aec2fd25d33daf2ca06267b477e\n";
ModelProvenanceElement element = new ModelProvenanceElement();
element.setFingerprint(manifestFile);
element.setAuthorAddress("0x11111");
Map<String, File> validFilesHashMap = new HashMap<>();
validFilesHashMap.put("myTestFile.tosca", new File(ClassLoader.getSystemClassLoader().getResource("emptyDefinition.tosca").toURI()));
validFilesHashMap.put("myTestFile2.tosca", new File(ClassLoader.getSystemClassLoader().getResource("secondDefinition.tosca").toURI()));
validFilesHashMap.put("Tosca.meta", new File(ClassLoader.getSystemClassLoader().getResource("Tosca.meta").toURI()));
AuthorizationElement authorizationElement = new AuthorizationElement();
authorizationElement.setAuthorizerBlockchainAddress("0x11111");
authorizationElement.setAuthorizedBlockchainAddress("0x11111");
authorizationElement.setAuthorizedIdentity("Gharreb");
authorizationElement.setTransactionHash("0x3215F23");
List<AuthorizationElement> authList = Arrays.asList(authorizationElement);
AuthorizationInfo authorizationInfo = new AuthorizationTree(authList);
return Stream.of(Arguments.of(VERIFIED, Collections.singletonList(element), validFilesHashMap, authorizationInfo, "Simple valid file in manifest"));
}
Aggregations