/** * Converts this object into its corresponding model * * @return a DashboardClient model * @see org.springframework.cloud.servicebroker.model.catalog.DashboardClient */ public org.springframework.cloud.servicebroker.model.catalog.DashboardClient toModel() { return org.springframework.cloud.servicebroker.model.catalog.DashboardClient.builder() .id(this.id) .secret(this.secret) .redirectUri(this.redirectUri) .build(); }
@Test public void dashboardClientIsBuiltWithAllValues() { DashboardClient client = DashboardClient.builder() .id("client-id") .secret("client-secret") .redirectUri("https://token.example.com") .build(); assertThat(client.getId()).isEqualTo("client-id"); assertThat(client.getSecret()).isEqualTo("client-secret"); assertThat(client.getRedirectUri()).isEqualTo("https://token.example.com"); DocumentContext json = JsonUtils.toJsonPath(client); assertThat(json).hasPath("$.id").isEqualTo("client-id"); assertThat(json).hasPath("$.secret").isEqualTo("client-secret"); assertThat(json).hasPath("$.redirect_uri").isEqualTo("https://token.example.com"); }
@Test public void dashboardClientIsBuiltWithDefaults() { DashboardClient client = DashboardClient.builder() .build(); assertThat(client.getId()).isNull(); assertThat(client.getSecret()).isNull(); assertThat(client.getRedirectUri()).isNull(); DocumentContext json = JsonUtils.toJsonPath(client); assertThat(json).hasNoPath("$.id"); assertThat(json).hasNoPath("$.secret"); assertThat(json).hasNoPath("$.redirect_uri"); }
.requires("another_requires") .planUpdateable(true) .dashboardClient(DashboardClient.builder().build()) .build();