@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"); }
assertThat(catalog.getServiceDefinitions().get(0).getTags()).containsOnly("tag1", "tag2"); assertThat(catalog.getServiceDefinitions().get(0).getDashboardClient().getId()).isEqualTo("dashboard-id"); assertThat(catalog.getServiceDefinitions().get(0).getDashboardClient().getSecret()).isEqualTo("dashboard-secret"); assertThat(catalog.getServiceDefinitions().get(0).getDashboardClient().getRedirectUri()).isEqualTo("dashboard-redirect-uri"); assertThat(catalog.getServiceDefinitions().get(0).getPlans().get(0).getId()).isEqualTo("plan-one-id");