use of com.android.tools.build.bundletool.model.manifestelements.Receiver in project bundletool by google.
the class ManifestEditorTest method addReceiver.
@Test
public void addReceiver() throws Exception {
Receiver receiver = Receiver.builder().setName("receiverName").build();
XmlNode receiverXmlNode = XmlNode.newBuilder().setElement(receiver.asXmlProtoElement().getProto()).build();
AndroidManifest androidManifest = AndroidManifest.create(androidManifest("com.test.app"));
AndroidManifest editedManifest = androidManifest.toEditor().addReceiver(receiver).save();
assertThat(getApplicationElement(editedManifest).getChildList()).containsExactly(receiverXmlNode);
}