### Question:
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();  }### Answer:
@Test public void only_action() throws JSONException { givenButtonComponent(FlexButtonComponent .newBuilder(new UriAction("https: "View details"))); messageShouldBe("{" + " \"type\": \"button\"," + " \"action\": {" + " \"type\": \"uri\"," + " \"label\": \"View details\"," + " \"uri\": \"https: " }" + "}"); }
@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" + "}"); }