FlyteAdminClient { public ExecutionOuterClass.ExecutionCreateResponse createExecution( String project, String domain, String name, IdentifierOuterClass.Identifier launchPlanId, ExecutionOuterClass.ExecutionMetadata.ExecutionMode executionMode, Map<String, String> annotations, String parameter) { LOG.debug("createExecution {} {} {}", project, domain, launchPlanId); var metadata = ExecutionOuterClass.ExecutionMetadata.newBuilder() .setMode(executionMode) .setPrincipal(TRIGGERING_PRINCIPAL) .setNesting(USER_TRIGGERED_EXECUTION_NESTING) .build(); var launchPlan = getLaunchPlan(launchPlanId); var inputs = launchPlan.getSpec().getDefaultInputs(); var spec = ExecutionOuterClass.ExecutionSpec.newBuilder() .setLaunchPlan(launchPlanId) .setMetadata(metadata) .setAnnotations(Common.Annotations.newBuilder() .putAllValues(annotations) .build()) .build(); var response = stub.createExecution( ExecutionOuterClass.ExecutionCreateRequest.newBuilder() .setDomain(domain) .setProject(project) .setName(name) .setSpec(spec) .setInputs(fillParameterInInputs(inputs, parameter)) .build()); verifyNotNull( response, "Unexpected null response when creating execution %s on project %s domain %s for %s", name, project, domain, launchPlanId); return response; } FlyteAdminClient(AdminServiceGrpc.AdminServiceBlockingStub stub); static FlyteAdminClient create(String target, boolean insecure); ExecutionOuterClass.ExecutionCreateResponse createExecution(
      String project,
      String domain,
      String name,
      IdentifierOuterClass.Identifier launchPlanId,
      ExecutionOuterClass.ExecutionMetadata.ExecutionMode executionMode,
      Map<String, String> annotations,
      String parameter); ExecutionOuterClass.Execution getExecution(String project, String domain, String name); ExecutionOuterClass.ExecutionTerminateResponse terminateExecution(
      String project, String domain, String name, String cause); ExecutionOuterClass.ExecutionList listExecutions(
      String project,
      String domain,
      int limit,
      String token,
      String filters); ProjectOuterClass.Projects listProjects();  }
@Test public void shouldPropagateCreateExecutionToStub() { var workflowExecution = flyteAdminClient.createExecution(PROJECT, DOMAIN, NON_EXISTING_NAME, identifier(NON_EXISTING_NAME), ExecutionMode.SCHEDULED, Map.of(), PARAMETER); assertThat(workflowExecution.getId().getProject(), equalTo(PROJECT)); assertThat(workflowExecution.getId().getDomain(), equalTo(DOMAIN)); assertThat(workflowExecution.getId().getName(), equalTo(NON_EXISTING_NAME)); }