use of com.google.cloud.talent.v4beta1.Job in project kubernetes-client by fabric8io.
the class JobIT method testCreateWithGenerateName.
@Test
public void testCreateWithGenerateName() {
// Given
Job job = getJobBuilder().editMetadata().withName(null).withGenerateName("test-job-").endMetadata().build();
// When
Job jobCreated = client.batch().jobs().inNamespace(session.getNamespace()).create(job);
// Then
assertNotNull(jobCreated);
assertTrue(jobCreated.getMetadata().getName().contains("test-job-"));
assertEquals("test-job-", jobCreated.getMetadata().getGenerateName());
assertNotNull(jobCreated.getMetadata().getName());
assertNotEquals("test-job-", jobCreated.getMetadata().getName());
assertTrue(client.batch().jobs().inNamespace(session.getNamespace()).withName(jobCreated.getMetadata().getName()).delete());
}
use of com.google.cloud.talent.v4beta1.Job in project java-scheduler by googleapis.
the class ITSystemTest method setUp.
@BeforeClass
public static void setUp() throws Exception {
/* The job will be delivered by publishing a message to the given Pub/Sub topic. */
publisherClient = TopicAdminClient.create();
publisherClient.createTopic(TOPIC_NAME);
client = CloudSchedulerClient.create();
Job createJob = Job.newBuilder().setName(JOB_NAME).setPubsubTarget(PUB_SUB_TARGET).setSchedule(SCHEDULE).setTimeZone(TIME_ZONE).build();
client.createJob(PARENT, createJob);
}
use of com.google.cloud.talent.v4beta1.Job in project java-scheduler by googleapis.
the class ITSystemTest method updateJobTest.
@Test
public void updateJobTest() {
String timeZone = "PST";
String schedule = "25 8 * * *";
Job updateJob = Job.newBuilder().setName(JOB_NAME).setPubsubTarget(PUB_SUB_TARGET).setSchedule(schedule).setTimeZone(timeZone).build();
UpdateJobRequest updateJobRequest = UpdateJobRequest.newBuilder().setJob(updateJob).build();
Job job = client.updateJob(updateJobRequest);
assertEquals(JOB_NAME, job.getName());
assertEquals(PUB_SUB_TARGET, job.getPubsubTarget());
assertEquals(Job.State.ENABLED, job.getState());
assertEquals(timeZone, job.getTimeZone());
assertEquals(schedule, job.getSchedule());
}
use of com.google.cloud.talent.v4beta1.Job in project java-scheduler by googleapis.
the class ITSystemTest method getJobTest.
@Test
public void getJobTest() {
Job job = client.getJob(JOB_NAME);
assertJobDetails(job);
}
use of com.google.cloud.talent.v4beta1.Job in project java-scheduler by googleapis.
the class ITSystemTest method runJobTest.
@Test
public void runJobTest() throws Exception {
RunJobRequest jobRequest = RunJobRequest.newBuilder().setName(JOB_NAME).build();
ApiFuture<Job> job = client.runJobCallable().futureCall(jobRequest);
while (true) {
if (job.isDone()) {
assertJobDetails(job.get());
break;
}
}
}
Aggregations