Skip to content

Commit

Permalink
Google Java Format
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions authored and doks5 committed Oct 26, 2023
1 parent 0b914a0 commit 8897ff2
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ private static DataJobContacts getContactsFromJob(DataJob job) {
}

public static JobDeploymentStatus toJobDeploymentStatus(
ActualDataJobDeployment deploymentStatus) {
ActualDataJobDeployment deploymentStatus) {
JobDeploymentStatus jobDeploymentStatus = new JobDeploymentStatus();

jobDeploymentStatus.setDataJobName(deploymentStatus.getDataJobName());
Expand All @@ -327,9 +327,9 @@ public static JobDeploymentStatus toJobDeploymentStatus(
jobDeploymentStatus.setEnabled(deploymentStatus.getEnabled());
jobDeploymentStatus.setLastDeployedBy(deploymentStatus.getLastDeployedBy());
jobDeploymentStatus.setLastDeployedDate(
deploymentStatus.getLastDeployedDate() == null
? null
: deploymentStatus.getLastDeployedDate().toString());
deploymentStatus.getLastDeployedDate() == null
? null
: deploymentStatus.getLastDeployedDate().toString());
jobDeploymentStatus.setResources(getResourcesFromDeployment(deploymentStatus));
// The ActualDataJobDeployment does not have a mode attribute, which is required by the
// JobDeploymentStatus,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import com.vmware.taurus.datajobs.ToApiModelConverter;
import com.vmware.taurus.service.deploy.DeploymentServiceV2;
import com.vmware.taurus.service.repository.JobsRepository;
import com.vmware.taurus.service.repository.ActualJobDeploymentRepository;
import com.vmware.taurus.service.deploy.DataJobDeploymentPropertiesConfig;
import com.vmware.taurus.service.deploy.DataJobDeploymentPropertiesConfig.ReadFrom;
import com.vmware.taurus.service.deploy.DeploymentService;
Expand Down Expand Up @@ -244,11 +243,10 @@ private Map<String, JobDeploymentStatus> readJobDeploymentsFromDb() {
return deploymentServiceV2.findAllActualDataJobDeployments().entrySet().stream()
.collect(
Collectors.toMap(
Map.Entry::getKey, entry -> DeploymentModelConverter.toJobDeploymentStatus(entry.getValue())));
Map.Entry::getKey,
entry -> DeploymentModelConverter.toJobDeploymentStatus(entry.getValue())));
}



private static DataJobPage buildResponse(int pageSize, int count, List pageList) {

return DataJobPage.builder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
import com.vmware.taurus.controlplane.model.data.DataJobExecution;
import com.vmware.taurus.service.deploy.DataJobDeploymentPropertiesConfig;
import com.vmware.taurus.service.deploy.DataJobDeploymentPropertiesConfig.ReadFrom;
import com.vmware.taurus.service.deploy.DeploymentServiceV2;
import com.vmware.taurus.service.model.*;
import com.vmware.taurus.service.repository.ActualJobDeploymentRepository;
import com.vmware.taurus.service.repository.JobsRepository;
import com.vmware.taurus.service.deploy.DeploymentService;
import com.vmware.taurus.service.graphql.model.Filter;
Expand Down Expand Up @@ -47,7 +47,7 @@
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
import java.time.OffsetDateTime;
import java.util.Map;

import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
Expand All @@ -69,7 +69,7 @@ class GraphQLDataFetchersTest {

@Mock private DataFetchingFieldSelectionSet dataFetchingFieldSelectionSet;

@Mock private ActualJobDeploymentRepository actualJobDeploymentRepository;
@Mock private DeploymentServiceV2 deploymentServiceV2;

@Mock private DataJobDeploymentPropertiesConfig dataJobDeploymentPropertiesConfig;

Expand All @@ -85,8 +85,8 @@ public void before() {
jobsRepository,
deploymentService,
executionDataFetcher,
actualJobDeploymentRepository,
dataJobDeploymentPropertiesConfig);
dataJobDeploymentPropertiesConfig,
deploymentServiceV2);
findDataJobs = graphQLDataFetchers.findAllAndBuildDataJobPage();
}

Expand Down Expand Up @@ -257,7 +257,7 @@ void testPopulateDeployments() throws Exception {
void testPopulateDeployments_readFromDB() throws Exception {
when(dataJobDeploymentPropertiesConfig.getReadDataSource()).thenReturn(ReadFrom.DB);
when(jobsRepository.findAll()).thenReturn(mockListOfDataJobsWithLastExecution());
when(actualJobDeploymentRepository.findAll()).thenReturn(mockListOfActualJobDeployments());
when(deploymentServiceV2.findAllActualDataJobDeployments()).thenReturn(mockMapOfActualJobDeployments());
when(dataFetchingEnvironment.getArgument("pageNumber")).thenReturn(1);
when(dataFetchingEnvironment.getArgument("pageSize")).thenReturn(100);
when(dataFetchingEnvironment.getSelectionSet()).thenReturn(dataFetchingFieldSelectionSet);
Expand Down Expand Up @@ -424,16 +424,14 @@ private List<DataJob> mockListOfDataJobs() {
return dataJobs;
}

private List<ActualDataJobDeployment> mockListOfActualJobDeployments() {
List<ActualDataJobDeployment> actualJobDeployments = new ArrayList<>();

actualJobDeployments.add(mockSampleActualJobDeployment("sample-job-1", true, "3.8-secure"));
actualJobDeployments.add(mockSampleActualJobDeployment("sample-job-2", false, "3.8-secure"));
actualJobDeployments.add(mockSampleActualJobDeployment("sample-job-3", true, "3.9-secure"));
actualJobDeployments.add(mockSampleActualJobDeployment("sample-job-4", false, "3.9-secure"));
actualJobDeployments.add(mockSampleActualJobDeployment("sample-job-5", true, "3.9-secure"));

return actualJobDeployments;
private Map<String, ActualDataJobDeployment> mockMapOfActualJobDeployments() {
return Map.of(
"sample-job-1", mockSampleActualJobDeployment("sample-job-1", true, "3.8-secure"),
"sample-job-2", mockSampleActualJobDeployment("sample-job-2", false, "3.8-secure"),
"sample-job-3", mockSampleActualJobDeployment("sample-job-3", true, "3.9-secure"),
"sample-job-4", mockSampleActualJobDeployment("sample-job-4", false, "3.9-secure"),
"sample-job-5", mockSampleActualJobDeployment("sample-job-5", true, "3.9-secure")
);
}

private List<DataJob> mockListOfDataJobsWithLastExecution() {
Expand Down

0 comments on commit 8897ff2

Please sign in to comment.