@Test public void all_fields() throws JSONException { givenButtonComponent(FlexButtonComponent .newBuilder(new UriAction("https: .setFlex(3) .setGravity(FlexMessageComponent.Gravity.BOTTOM) .setColor("#ff0000") .setHeight(FlexMessageComponent.Height.MD) .setMargin(FlexMessageComponent.Margin.XL) .setStyle(FlexMessageComponent.Style.LINK)); messageShouldBe("{" + " \"type\": \"button\"," + " \"action\": {" + " \"type\": \"uri\"," + " \"label\": \"View details\"," + " \"uri\": \"https: " }," + " \"margin\": \"xl\"," + " \"height\": \"md\"," + " \"style\": \"link\"," + " \"color\": \"#ff0000\"," + " \"gravity\": \"bottom\"," + " \"flex\": 3" + "}"); }
public static Builder newBuilder(@NonNull Action action) { return new Builder(action); }
FlexButtonComponent extends FlexMessageComponent { public static Builder newBuilder(@NonNull Action action) { return new Builder(action); } }
FlexButtonComponent extends FlexMessageComponent { public static Builder newBuilder(@NonNull Action action) { return new Builder(action); } private  FlexButtonComponent(); private  FlexButtonComponent(@NonNull Builder builder); }
FlexButtonComponent extends FlexMessageComponent { public static Builder newBuilder(@NonNull Action action) { return new Builder(action); } private  FlexButtonComponent(); private  FlexButtonComponent(@NonNull Builder builder); static Builder newBuilder(@NonNull Action action); @NonNull @Override JSONObject toJsonObject(); }
FlexButtonComponent extends FlexMessageComponent { public static Builder newBuilder(@NonNull Action action) { return new Builder(action); } private  FlexButtonComponent(); private  FlexButtonComponent(@NonNull Builder builder); static Builder newBuilder(@NonNull Action action); @NonNull @Override JSONObject toJsonObject();  }