Skip to content

Commit

Permalink
control-service: remove useless method (#3289)
Browse files Browse the repository at this point in the history
# Why
The method was only calling another public method in the same class. 
It is left over mess from supporting multiple versions of k8s.

---------

Co-authored-by: github-actions <>
  • Loading branch information
murphp15 committed Apr 4, 2024
1 parent 86d8bbd commit cd92087
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -309,10 +309,6 @@ public Set<String> listJobs() throws ApiException {
* Optional if the cron job does not exist or cannot be read
*/
public Optional<JobDeploymentStatus> readCronJob(String cronJobName) {
return readV1CronJob(cronJobName);
}

public Optional<JobDeploymentStatus> readV1CronJob(String cronJobName) {
log.debug("Reading k8s V1 cron job: {}", cronJobName);
V1CronJob cronJob = null;
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -337,24 +337,6 @@ public void testReadJobDeploymentStatuses() {
Assertions.assertEquals(v1TestList, resultStatuses);
}

@Test
public void testReadCronJob_readV1CronJobShouldReturnStatus() {
String testCronjobName = "testCronjob";
var mock = newDataJobKubernetesService();

JobDeploymentStatus testDeploymentStatus = new JobDeploymentStatus();
testDeploymentStatus.setEnabled(false);
testDeploymentStatus.setDataJobName(testCronjobName);
testDeploymentStatus.setCronJobName(testCronjobName);

doReturn(Optional.of(testDeploymentStatus)).when(mock).readV1CronJob(testCronjobName);

Assertions.assertNotNull(mock.readCronJob(testCronjobName));
Assertions.assertEquals(
testCronjobName, mock.readCronJob(testCronjobName).get().getCronJobName());
verify(mock, times(2)).readV1CronJob(testCronjobName);
}

@Test
public void testQuantityToMbConversionMegabytes() throws Exception {
var hundredMb = "100M";
Expand Down

0 comments on commit cd92087

Please sign in to comment.