Move ab_streaming_metadata under ab_config.

Add new config: ab_config.verify_payload_metadata.

Change-Id: I521dff92166c33dd9c2efa498dc599fe4bc83fde
Signed-off-by: Zhomart Mukhamejanov <zhomart@google.com>
Test: mmm, junit
Bug: 77150191
diff --git a/updater_sample/tests/src/com/example/android/systemupdatersample/UpdateConfigTest.java b/updater_sample/tests/src/com/example/android/systemupdatersample/UpdateConfigTest.java
index 1cbd860..48d0e42 100644
--- a/updater_sample/tests/src/com/example/android/systemupdatersample/UpdateConfigTest.java
+++ b/updater_sample/tests/src/com/example/android/systemupdatersample/UpdateConfigTest.java
@@ -44,10 +44,12 @@
 @SmallTest
 public class UpdateConfigTest {
 
-    private static final String JSON_NON_STREAMING =
-            "{\"name\": \"vip update\", \"url\": \"file:///builds/a.zip\", "
-                    + " \"ab_install_type\": \"NON_STREAMING\","
-                    + " \"ab_config\": { \"force_switch_slot\": false } }";
+    private static final String JSON_NON_STREAMING = "{"
+            + " \"name\": \"vip update\", \"url\": \"file:///my-builds/a.zip\","
+            + " \"ab_install_type\": \"NON_STREAMING\","
+            + " \"ab_config\": {"
+            + "     \"force_switch_slot\": false,"
+            + "     \"verify_payload_metadata\": false } }";
 
     @Rule
     public final ExpectedException thrown = ExpectedException.none();
@@ -71,7 +73,7 @@
         assertSame("type is parsed",
                 UpdateConfig.AB_INSTALL_TYPE_NON_STREAMING,
                 config.getInstallType());
-        assertEquals("url is parsed", "file:///builds/a.zip", config.getUrl());
+        assertEquals("url is parsed", "file:///my-builds/a.zip", config.getUrl());
     }
 
     @Test
@@ -81,9 +83,9 @@
         assertEquals("http://foo.bar/update.zip", config.getUrl());
         assertSame(UpdateConfig.AB_INSTALL_TYPE_STREAMING, config.getInstallType());
         assertEquals("payload.bin",
-                config.getStreamingMetadata().getPropertyFiles()[0].getFilename());
-        assertEquals(195, config.getStreamingMetadata().getPropertyFiles()[0].getOffset());
-        assertEquals(8, config.getStreamingMetadata().getPropertyFiles()[0].getSize());
+                config.getAbConfig().getPropertyFiles()[0].getFilename());
+        assertEquals(195, config.getAbConfig().getPropertyFiles()[0].getOffset());
+        assertEquals(8, config.getAbConfig().getPropertyFiles()[0].getSize());
         assertTrue(config.getAbConfig().getForceSwitchSlot());
     }
 
@@ -96,9 +98,12 @@
 
     @Test
     public void getUpdatePackageFile_throwsErrorIfNotAFile() throws Exception {
-        String json = "{\"name\": \"upd\", \"url\": \"http://foo.bar\","
+        String json = "{"
+                + " \"name\": \"upd\", \"url\": \"http://foo.bar\","
                 + " \"ab_install_type\": \"NON_STREAMING\","
-                + " \"ab_config\": { \"force_switch_slot\": false } }";
+                + " \"ab_config\": {"
+                + "     \"force_switch_slot\": false,"
+                + "     \"verify_payload_metadata\": false } }";
         UpdateConfig config = UpdateConfig.fromJson(json);
         thrown.expect(RuntimeException.class);
         config.getUpdatePackageFile();
@@ -107,7 +112,7 @@
     @Test
     public void getUpdatePackageFile_works() throws Exception {
         UpdateConfig c = UpdateConfig.fromJson(JSON_NON_STREAMING);
-        assertEquals("/builds/a.zip", c.getUpdatePackageFile().getAbsolutePath());
+        assertEquals("/my-builds/a.zip", c.getUpdatePackageFile().getAbsolutePath());
     }
 
     private String readResource(int id) throws IOException {