@Test public void testOutput() throws Exception { ValueProvider<String> metadataLocation = pipeline .newProvider(Resources.getResource("pioneer/metadata-local.json").getPath()); ValueProvider<Boolean> kmsEnabled = pipeline.newProvider(false); ValueProvider<Boolean> decompressPayload = pipeline.newProvider(true); final List<String> input = readTestFiles(Arrays.asList("pioneer/study-foo.ciphertext.json")); PCollection<String> output = pipeline.apply(Create.of(input)) .apply(InputFileFormat.text.decode()) .apply("AddAttributes", MapElements.into(TypeDescriptor.of(PubsubMessage.class)) .via(element -> new PubsubMessage(element.getPayload(), ImmutableMap.of(Attribute.DOCUMENT_NAMESPACE, "telemetry", Attribute.DOCUMENT_TYPE, "pioneer-study", Attribute.DOCUMENT_VERSION, "4")))) .apply(DecryptPioneerPayloads.of(metadataLocation, kmsEnabled, decompressPayload)).output() .apply(OutputFileFormat.text.encode()).apply(ReformatJson.of()); final List<String> expectedMain = readTestFiles(Arrays.asList("pioneer/sample.plaintext.json")); PAssert.that(output).containsInAnyOrder(expectedMain); pipeline.run(); }
public static DecryptPioneerPayloads of(ValueProvider<String> metadataLocation, ValueProvider<Boolean> kmsEnabled, ValueProvider<Boolean> decompressPayload) { return new DecryptPioneerPayloads(metadataLocation, kmsEnabled, decompressPayload); }
DecryptPioneerPayloads extends
    PTransform<PCollection<PubsubMessage>, Result<PCollection<PubsubMessage>, PubsubMessage>> { public static DecryptPioneerPayloads of(ValueProvider<String> metadataLocation, ValueProvider<Boolean> kmsEnabled, ValueProvider<Boolean> decompressPayload) { return new DecryptPioneerPayloads(metadataLocation, kmsEnabled, decompressPayload); } }
DecryptPioneerPayloads extends
    PTransform<PCollection<PubsubMessage>, Result<PCollection<PubsubMessage>, PubsubMessage>> { public static DecryptPioneerPayloads of(ValueProvider<String> metadataLocation, ValueProvider<Boolean> kmsEnabled, ValueProvider<Boolean> decompressPayload) { return new DecryptPioneerPayloads(metadataLocation, kmsEnabled, decompressPayload); } private  DecryptPioneerPayloads(ValueProvider<String> metadataLocation,
      ValueProvider<Boolean> kmsEnabled, ValueProvider<Boolean> decompressPayload); }
DecryptPioneerPayloads extends
    PTransform<PCollection<PubsubMessage>, Result<PCollection<PubsubMessage>, PubsubMessage>> { public static DecryptPioneerPayloads of(ValueProvider<String> metadataLocation, ValueProvider<Boolean> kmsEnabled, ValueProvider<Boolean> decompressPayload) { return new DecryptPioneerPayloads(metadataLocation, kmsEnabled, decompressPayload); } private  DecryptPioneerPayloads(ValueProvider<String> metadataLocation,
      ValueProvider<Boolean> kmsEnabled, ValueProvider<Boolean> decompressPayload); static DecryptPioneerPayloads of(ValueProvider<String> metadataLocation,
      ValueProvider<Boolean> kmsEnabled, ValueProvider<Boolean> decompressPayload); @Override Result<PCollection<PubsubMessage>, PubsubMessage> expand(
      PCollection<PubsubMessage> messages); static byte[] decrypt(PrivateKey key, String payload); }
DecryptPioneerPayloads extends
    PTransform<PCollection<PubsubMessage>, Result<PCollection<PubsubMessage>, PubsubMessage>> { public static DecryptPioneerPayloads of(ValueProvider<String> metadataLocation, ValueProvider<Boolean> kmsEnabled, ValueProvider<Boolean> decompressPayload) { return new DecryptPioneerPayloads(metadataLocation, kmsEnabled, decompressPayload); } private  DecryptPioneerPayloads(ValueProvider<String> metadataLocation,
      ValueProvider<Boolean> kmsEnabled, ValueProvider<Boolean> decompressPayload); static DecryptPioneerPayloads of(ValueProvider<String> metadataLocation,
      ValueProvider<Boolean> kmsEnabled, ValueProvider<Boolean> decompressPayload); @Override Result<PCollection<PubsubMessage>, PubsubMessage> expand(
      PCollection<PubsubMessage> messages); static byte[] decrypt(PrivateKey key, String payload); static final String ENCRYPTED_DATA; static final String ENCRYPTION_KEY_ID; static final String SCHEMA_NAMESPACE; static final String SCHEMA_NAME; static final String SCHEMA_VERSION; static final String PIONEER_ID; static final String STUDY_NAME; static final String DELETION_REQUEST_SCHEMA_NAME; static final String ENROLLMENT_SCHEMA_NAME; }