use of com.venafi.vcert.sdk.connectors.cloud.domain.UserDetails in project vcert-java by Venafi.
the class CloudConnectorTest method setUp.
@BeforeEach
void setUp() {
classUnderTest = new CloudConnector(cloud);
userDetails = new UserDetails().user(new User()).company(new Company());
when(cloud.authorize(anyString())).thenReturn(userDetails);
}
use of com.venafi.vcert.sdk.connectors.cloud.domain.UserDetails in project vcert-java by Venafi.
the class CloudConnectorUtils method createAppForCit.
private static void createAppForCit(CertificateIssuingTemplate cit, String appName, String apiKey, Cloud cloud) throws VCertException {
UserDetails userDetails = cloud.authorize(apiKey);
String userId = userDetails.user().id();
Application application = new Application();
Application.OwnerIdsAndType ownerIdsAndType = new Application.OwnerIdsAndType();
ownerIdsAndType.ownerId(userId);
ownerIdsAndType.ownerType("USER");
List<Application.OwnerIdsAndType> ownerIdsAndTypes = new ArrayList<>();
ownerIdsAndTypes.add(ownerIdsAndType);
Map<String, String> citAliasIdMap = new HashMap<>();
citAliasIdMap.put(cit.name(), cit.id());
application.name(appName);
application.ownerIdsAndTypes(ownerIdsAndTypes);
application.certificateIssuingTemplateAliasIdMap(citAliasIdMap);
cloud.createApplication(application, apiKey);
}
Aggregations