cameronlee314 commented on a change in pull request #1157: SAMZA-2325 : Adding 
logic to read system config for repl-factor when creating a topic
URL: https://github.com/apache/samza/pull/1157#discussion_r325374851
 
 

 ##########
 File path: 
samza-core/src/test/java/org/apache/samza/config/TestStorageConfig.java
 ##########
 @@ -155,18 +157,37 @@ public void testGetStorageMsgSerde() {
   @Test
   public void testGetChangelogSystem() {
     // empty config, so no system
-    assertEquals(Optional.empty(), new StorageConfig(new 
MapConfig()).getChangelogSystem());
+    assertEquals(Optional.empty(), new StorageConfig(new 
MapConfig()).getChangelogStream(STORE_NAME0));
 
-    // job.changelog.system takes precedence over job.default.system
     StorageConfig storageConfig = new StorageConfig(new MapConfig(
         ImmutableMap.of(StorageConfig.CHANGELOG_SYSTEM, "changelog-system", 
JobConfig.JOB_DEFAULT_SYSTEM,
             "should-not-be-used")));
-    assertEquals(Optional.of("changelog-system"), 
storageConfig.getChangelogSystem());
+    assertEquals(Optional.empty(), 
storageConfig.getChangelogStream(STORE_NAME0));
+
+    // job.changelog.system takes precedence over job.default.system when 
changelog is specified as just streamName
+    storageConfig = new StorageConfig(new MapConfig(
+        ImmutableMap.of(StorageConfig.CHANGELOG_SYSTEM, "changelog-system", 
JobConfig.JOB_DEFAULT_SYSTEM,
+            "should-not-be-used", String.format(CHANGELOG_STREAM, 
STORE_NAME0), "streamName")));
+    assertEquals("changelog-system", 
StreamUtil.getSystemStreamFromNames(storageConfig.getChangelogStream(STORE_NAME0).get()).getSystem());
 
 Review comment:
   Would it be more straightforward and complete to just check the value of 
`getChangelogStream` directly?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to