@Test public void banner_withMinimumAttributes_createsInAppMessage() { MessagesProto.Content minimumBanner = MessagesProto.Content.newBuilder() .setBanner( MessagesProto.BannerMessage.newBuilder() .setTitle(TITLE_PROTO) .setBackgroundHexColor(MESSAGE_BACKGROUND_HEX_STRING)) .build(); BannerMessage expected = BannerMessage.builder() .setBackgroundHexColor(MESSAGE_BACKGROUND_HEX_STRING) .setTitle(TITLE_MODEL) .build(CAMPAIGN_METADATA_MODEL, DATA); InAppMessage actual = decode(minimumBanner); assertThat(actual).isEqualTo(expected); }
private static Button decode(MessagesProto.Button in) { Button.Builder builder = Button.builder(); if (!TextUtils.isEmpty(in.getButtonHexColor())) { builder.setButtonHexColor(in.getButtonHexColor()); } if (in.hasText()) { builder.setText(decode(in.getText())); } return builder.build(); }
ProtoMarshallerClient { private static Button decode(MessagesProto.Button in) { Button.Builder builder = Button.builder(); if (!TextUtils.isEmpty(in.getButtonHexColor())) { builder.setButtonHexColor(in.getButtonHexColor()); } if (in.hasText()) { builder.setText(decode(in.getText())); } return builder.build(); } }
ProtoMarshallerClient { private static Button decode(MessagesProto.Button in) { Button.Builder builder = Button.builder(); if (!TextUtils.isEmpty(in.getButtonHexColor())) { builder.setButtonHexColor(in.getButtonHexColor()); } if (in.hasText()) { builder.setText(decode(in.getText())); } return builder.build(); } @Inject  ProtoMarshallerClient(); }
ProtoMarshallerClient { private static Button decode(MessagesProto.Button in) { Button.Builder builder = Button.builder(); if (!TextUtils.isEmpty(in.getButtonHexColor())) { builder.setButtonHexColor(in.getButtonHexColor()); } if (in.hasText()) { builder.setText(decode(in.getText())); } return builder.build(); } @Inject  ProtoMarshallerClient(); static InAppMessage decode(
      @Nonnull MessagesProto.Content in,
      @NonNull String campaignId,
      @NonNull String campaignName,
      boolean isTestMessage,
      @Nullable Map<String, String> data); }
ProtoMarshallerClient { private static Button decode(MessagesProto.Button in) { Button.Builder builder = Button.builder(); if (!TextUtils.isEmpty(in.getButtonHexColor())) { builder.setButtonHexColor(in.getButtonHexColor()); } if (in.hasText()) { builder.setText(decode(in.getText())); } return builder.build(); } @Inject  ProtoMarshallerClient(); static InAppMessage decode(
      @Nonnull MessagesProto.Content in,
      @NonNull String campaignId,
      @NonNull String campaignName,
      boolean isTestMessage,
      @Nullable Map<String, String> data);  }