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 Nov 27, 2023
1 parent 770a830 commit b2acd7e
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ private void setVdkVersionForDeployment() throws Exception {
.with(user("user"))
.content(getDataJobDeploymentVdkVersionRequestBody("new_vdk_version_tag"))
.contentType(MediaType.APPLICATION_JSON))
.andExpect(status().isBadRequest());
.andExpect(status().isAccepted());
}

private void disableDeployment() throws Exception {
Expand All @@ -67,7 +67,7 @@ private void verifyVersion() throws Exception {
.with(user("user"))
.contentType(MediaType.APPLICATION_JSON))
.andExpect(status().isOk())
.andExpect(jsonPath("$.vdk_version", is("release")));
.andExpect(jsonPath("$.vdk_version", is("new_vdk_version_tag")));
}

private void resetVdkDeploymentVersion() throws Exception {
Expand All @@ -80,7 +80,7 @@ private void resetVdkDeploymentVersion() throws Exception {
.with(user("user"))
.content(getDataJobDeploymentVdkVersionRequestBody(""))
.contentType(MediaType.APPLICATION_JSON))
.andExpect(status().isOk());
.andExpect(status().isAccepted());
}

private MvcResult getDeployment() throws Exception {
Expand All @@ -105,7 +105,7 @@ private void checkDeployment() throws Exception {
Assertions.assertEquals("user", jobDeployment.getLastDeployedBy());
Assertions.assertEquals("3.9", jobDeployment.getPythonVersion());
Assertions.assertFalse(jobDeployment.getEnabled());
Assertions.assertEquals("release", jobDeployment.getVdkVersion());
Assertions.assertEquals("new_vdk_version_tag", jobDeployment.getVdkVersion());
Assertions.assertNotNull(jobDeployment.getJobVersion());
Assertions.assertNotNull(jobDeployment.getVdkVersion());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ public void testDataJobDeploymentDynamicVdkVersion() throws Exception {
Assertions.assertEquals(true, jobDeployment.getEnabled());
// by default the version is the same as the tag specified by datajobs.vdk.image
// for integration test this is registry.hub.docker.com/versatiledatakit/quickstart-vdk:release
Assertions.assertEquals("release", jobDeployment.getVdkVersion());
Assertions.assertEquals("ghcr.io/versatile-data-kit-dev/versatiledatakit/quickstart-vdk:release", jobDeployment.getVdkVersion());
Assertions.assertEquals("user", jobDeployment.getLastDeployedBy());
// just check some valid date is returned. It would be too error-prone/brittle to verify exact
// time.
Expand Down Expand Up @@ -212,9 +212,9 @@ public void testDataJobDeploymentDynamicVdkVersion() throws Exception {
.with(user("user"))
.content(getDataJobDeploymentVdkVersionRequestBody("new_vdk_version_tag"))
.contentType(MediaType.APPLICATION_JSON))
.andExpect(status().isBadRequest());
.andExpect(status().isAccepted());

// verify vdk version is not changed
// verify vdk version is changed
mockMvc
.perform(
get(String.format(
Expand All @@ -223,7 +223,7 @@ public void testDataJobDeploymentDynamicVdkVersion() throws Exception {
.with(user("user"))
.contentType(MediaType.APPLICATION_JSON))
.andExpect(status().isOk())
.andExpect(jsonPath("$.vdk_version", is("release")));
.andExpect(jsonPath("$.vdk_version", is("new_vdk_version_tag")));

// Execute change python version and set corresponding vdk version for deployment
mockMvc
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,9 +237,9 @@ public static DesiredDataJobDeployment mergeDeployments(
? newDeployment.getEnabled()
: oldDeployment.getEnabled());
mergedDeployment.setVdkImage(
newDeployment.getVdkVersion() != null
newDeployment.getVdkVersion() != null
? newDeployment.getVdkVersion()
: oldDeployment.getVdkImage());
: oldDeployment.getVdkImage());

return mergedDeployment;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import com.vmware.taurus.service.model.JobDeployment;
import com.vmware.taurus.service.repository.DesiredJobDeploymentRepository;
import com.vmware.taurus.service.repository.JobsRepository;
import org.junit.Assert;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
Expand Down

0 comments on commit b2acd7e

Please sign in to comment.