Skip to content

Commit

Permalink
code format
Browse files Browse the repository at this point in the history
  • Loading branch information
jackie-coming committed Dec 8, 2024
1 parent 07bb41c commit a4b356c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,11 @@ public List<ConfigurationChange> calcConfigurationChanges(

for (String newKey : newKeys) {
changes.add(new ConfigurationChange(newKey, latestReleaseConfigurations.get(newKey),
ConfigurationChangeType.ADDED));
"ADDED"));
}

for (String removedKey : removedKeys) {
changes.add(new ConfigurationChange(removedKey, null, ConfigurationChangeType.DELETED));
changes.add(new ConfigurationChange(removedKey, null,"DELETED"));
}

for (String commonKey : commonKeys) {
Expand All @@ -136,7 +136,7 @@ public List<ConfigurationChange> calcConfigurationChanges(
continue;
}
changes.add(
new ConfigurationChange(commonKey, currentValue, ConfigurationChangeType.MODIFIED));
new ConfigurationChange(commonKey, currentValue,"MODIFIED"));
}

return changes;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,7 @@ public void testQueryConfigWithIncrementalSync() throws Exception {
when(anotherRelease.getConfigurations()).thenReturn(anotherConfigurations);

List<ConfigurationChange> configurationChanges=new ArrayList<>();
configurationChanges.add(new ConfigurationChange("apollo.public.bar", "bar", ConfigurationChangeType.ADDED));
configurationChanges.add(new ConfigurationChange("apollo.public.bar", "bar", "ADDED"));
when(configService.calcConfigurationChanges(gson.fromJson(anotherConfigurations, configurationTypeReference),
gson.fromJson(someConfigurations, configurationTypeReference)))
.thenReturn(configurationChanges);
Expand Down Expand Up @@ -602,9 +602,9 @@ public void testQueryConfigWithIncrementalSyncPublicNamespaceAndAppOverride() th
String mergeServerSideConfigurations = "{\"apollo.public.bar\": \"bar\",\"apollo.public.foo\": \"foo-override\"}";
String mergeClientSideConfigurations = "{\"apollo.public.foo.client\": \"foo.override\"}";
List<ConfigurationChange> configurationChanges=new ArrayList<>();
configurationChanges.add(new ConfigurationChange("apollo.public.bar", "bar", ConfigurationChangeType.ADDED));
configurationChanges.add(new ConfigurationChange("apollo.public.foo", "foo-override", ConfigurationChangeType.ADDED));
configurationChanges.add(new ConfigurationChange("apollo.public.foo.client", null, ConfigurationChangeType.DELETED));
configurationChanges.add(new ConfigurationChange("apollo.public.bar", "bar", "ADDED"));
configurationChanges.add(new ConfigurationChange("apollo.public.foo", "foo-override", "ADDED"));
configurationChanges.add(new ConfigurationChange("apollo.public.foo.client", null, "DELETED"));
when(configService.calcConfigurationChanges(gson.fromJson(mergeServerSideConfigurations, configurationTypeReference),
gson.fromJson(mergeClientSideConfigurations, configurationTypeReference)))
.thenReturn(configurationChanges);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public void testChangeConfigurationsWithAdd() {
assertEquals(1, result.size());
assertEquals(key2, result.get(0).getKey());
assertEquals(value2, result.get(0).getNewValue());
assertEquals(ConfigurationChangeType.ADDED, result.get(0).getConfigurationChangeType());
assertEquals("ADDED", result.get(0).getConfigurationChangeType());
}
@Test
public void testChangeConfigurationsWithLatestConfigIsNULL() {
Expand All @@ -119,7 +119,7 @@ public void testChangeConfigurationsWithLatestConfigIsNULL() {
assertEquals(1, result.size());
assertEquals(key1, result.get(0).getKey());
assertEquals(null, result.get(0).getNewValue());
assertEquals(ConfigurationChangeType.DELETED, result.get(0).getConfigurationChangeType());
assertEquals("DELETED", result.get(0).getConfigurationChangeType());
}
@Test
public void testChangeConfigurationsWithHistoryConfigIsNULL() {
Expand All @@ -134,7 +134,7 @@ public void testChangeConfigurationsWithHistoryConfigIsNULL() {
assertEquals(1, result.size());
assertEquals(key1, result.get(0).getKey());
assertEquals(value1, result.get(0).getNewValue());
assertEquals(ConfigurationChangeType.ADDED, result.get(0).getConfigurationChangeType());
assertEquals("ADDED", result.get(0).getConfigurationChangeType());
}
@Test
public void testChangeConfigurationsWithUpdate() {
Expand All @@ -152,7 +152,7 @@ public void testChangeConfigurationsWithUpdate() {
assertEquals(1, result.size());
assertEquals(key1, result.get(0).getKey());
assertEquals(anotherValue1, result.get(0).getNewValue());
assertEquals(ConfigurationChangeType.MODIFIED, result.get(0).getConfigurationChangeType());
assertEquals("MODIFIED", result.get(0).getConfigurationChangeType());
}
@Test
public void testChangeConfigurationsWithDelete() {
Expand All @@ -168,7 +168,7 @@ public void testChangeConfigurationsWithDelete() {
assertEquals(1, result.size());
assertEquals(key1, result.get(0).getKey());
assertEquals(null, result.get(0).getNewValue());
assertEquals(ConfigurationChangeType.DELETED, result.get(0).getConfigurationChangeType());
assertEquals("DELETED", result.get(0).getConfigurationChangeType());
}

@Test
Expand Down

0 comments on commit a4b356c

Please sign in to comment.