Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci-java.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
- name: Compile integration tests
run: ./mvnw -Pintegration-test test-compile compile
- name: Check style with Spotless
run: ./mvnw spotless:check -Pintegration-test
run: ./mvnw spotless:check -Pintegration-test,test-logcache,test-service-broker

integration-test:
needs: build
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,31 +40,31 @@ public static void main(String[] args) {
}

@RequestMapping("/counter")
public String counter(@RequestParam("name") String name, @RequestParam("delta") Long delta) throws Exception {
final String json = this.objectMapper.writeValueAsString(Counter.builder()
.name(name)
.delta(delta)
.build());
public String counter(@RequestParam("name") String name, @RequestParam("delta") Long delta)
throws Exception {
final String json =
this.objectMapper.writeValueAsString(
Counter.builder().name(name).delta(delta).build());
System.out.println(json);
return json;
}

@RequestMapping("/event")
public String event(@RequestParam("title") String title, @RequestParam("body") String body) throws Exception {
final String json = this.objectMapper.writeValueAsString(Event.builder()
.title(title)
.body(body)
.build());
public String event(@RequestParam("title") String title, @RequestParam("body") String body)
throws Exception {
final String json =
this.objectMapper.writeValueAsString(
Event.builder().title(title).body(body).build());
System.out.println(json);
return json;
}

@RequestMapping("/gauge")
public String gauge(@RequestParam("name") String name, @RequestParam("value") Double value) throws Exception {
final String json = this.objectMapper.writeValueAsString(Gauge.builder()
.name(name)
.value(value)
.build());
public String gauge(@RequestParam("name") String name, @RequestParam("value") Double value)
throws Exception {
final String json =
this.objectMapper.writeValueAsString(
Gauge.builder().name(name).value(value).build());
System.out.println(json);
return json;
}
Expand All @@ -77,9 +77,9 @@ public String log(@RequestParam("message") String message) {

@RequestMapping("/test")
public String test() {
final String output = "{\"type\":\"event\",\"title\":\"Test Title\",\"body\":\"Test Body\"}";
final String output =
"{\"type\":\"event\",\"title\":\"Test Title\",\"body\":\"Test Body\"}";
System.out.println(output);
return output;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,13 @@
*/

@Value.Style(
add = "*",
defaults = @Value.Immutable(copy = false),
depluralize = true,
jdkOnly = true,
put = "*",
typeAbstract = "_*",
typeImmutable = "*"
)
add = "*",
defaults = @Value.Immutable(copy = false),
depluralize = true,
jdkOnly = true,
put = "*",
typeAbstract = "_*",
typeImmutable = "*")
package org.cloudfoundry.logcachetest;

import org.immutables.value.Value;
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,4 @@

package org.cloudfoundry.servicebroker;

public @interface Nullable {

}
public @interface Nullable {}
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ public static void main(String[] args) {

@Bean
ObjectMapper objectMapper() {
return new ObjectMapper()
.disable(SerializationFeature.FAIL_ON_EMPTY_BEANS);
return new ObjectMapper().disable(SerializationFeature.FAIL_ON_EMPTY_BEANS);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,11 @@ final class BindingController {

@PutMapping("/v2/service_instances/{instanceId}/service_bindings/{bindingId}")
ResponseEntity<BindResponse> bind() {
return ResponseEntity.status(HttpStatus.CREATED)
.body(BindResponse.builder()
.build());
return ResponseEntity.status(HttpStatus.CREATED).body(BindResponse.builder().build());
}

@DeleteMapping("/v2/service_instances/{instanceId}/service_bindings/{bindingId}")
ResponseEntity<UnbindResponse> unbind() {
return ResponseEntity.ok()
.body(UnbindResponse.builder()
.build());
return ResponseEntity.ok().body(UnbindResponse.builder().build());
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -16,102 +16,133 @@

package org.cloudfoundry.servicebroker.catalog;

import java.util.UUID;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.UUID;

@RestController
final class CatalogController {

private final Catalog catalog;

CatalogController(@Value("${service.name}") String serviceName, @Value("${plan.name}") String planName) {
this.catalog = Catalog.builder()
.service(Service.builder()
.id(UUID.randomUUID().toString())
.name(serviceName)
.require("route_forwarding")
.description("test-service-description")
.bindable(true)
.planUpdateable(true)
.metadata(ServiceMetadata.builder()
.displayName("test-service-display-name")
.listing(Listing.builder()
.blurb("test-listing-blurb")
.imageUrl("http://test-image-host/test-image.gif")
.longDescription("test-listing-long-description")
.build())
.provider(Provider.builder()
.name("test-provider-name")
.build())
.build())
.dashboardClient(DashboardClient.builder()
.id(UUID.randomUUID().toString())
.redirectUri("http://test-dashboard-host")
.secret(UUID.randomUUID().toString())
.build())
.plan(Plan.builder()
.id(UUID.randomUUID().toString())
.name(planName)
.description("test-plan-description")
.metadata(PlanMetadata.builder()
.bullet(Bullet.builder()
.content("test-plan-metadata-bullet")
.build())
.cost(Cost.builder()
.amount("usd", 1)
.unit("MONTHLY")
.build())
.build())
.build())
.build())
.service(Service.builder()
.id(UUID.randomUUID().toString())
.name(serviceName + "-shareable")
.description("test-service-description-shareable")
.bindable(true)
.planUpdateable(true)
.metadata(ServiceMetadata.builder()
.displayName("test-service-display-name")
.listing(Listing.builder()
.blurb("test-listing-blurb")
.imageUrl("http://test-image-host/test-image.gif")
.longDescription("test-listing-long-description")
.build())
.provider(Provider.builder()
.name("test-provider-name")
.build())
.shareable(true)
.build())
.dashboardClient(DashboardClient.builder()
.id(UUID.randomUUID().toString())
.redirectUri("http://test-dashboard-host")
.secret(UUID.randomUUID().toString())
.build())
.plan(Plan.builder()
.id(UUID.randomUUID().toString())
.name(planName + "-shareable")
.description("test-plan-description-shareable")
.metadata(PlanMetadata.builder()
.bullet(Bullet.builder()
.content("test-plan-metadata-bullet")
.build())
.cost(Cost.builder()
.amount("usd", 1)
.unit("MONTHLY")
.build())
.build())
.build())
.build())
.build();
CatalogController(
@Value("${service.name}") String serviceName, @Value("${plan.name}") String planName) {
this.catalog =
Catalog.builder()
.service(
Service.builder()
.id(UUID.randomUUID().toString())
.name(serviceName)
.require("route_forwarding")
.description("test-service-description")
.bindable(true)
.planUpdateable(true)
.metadata(
ServiceMetadata.builder()
.displayName("test-service-display-name")
.listing(
Listing.builder()
.blurb("test-listing-blurb")
.imageUrl(
"http://test-image-host/test-image.gif")
.longDescription(
"test-listing-long-description")
.build())
.provider(
Provider.builder()
.name("test-provider-name")
.build())
.build())
.dashboardClient(
DashboardClient.builder()
.id(UUID.randomUUID().toString())
.redirectUri("http://test-dashboard-host")
.secret(UUID.randomUUID().toString())
.build())
.plan(
Plan.builder()
.id(UUID.randomUUID().toString())
.name(planName)
.description("test-plan-description")
.metadata(
PlanMetadata.builder()
.bullet(
Bullet.builder()
.content(
"test-plan-metadata-bullet")
.build())
.cost(
Cost.builder()
.amount(
"usd",
1)
.unit(
"MONTHLY")
.build())
.build())
.build())
.build())
.service(
Service.builder()
.id(UUID.randomUUID().toString())
.name(serviceName + "-shareable")
.description("test-service-description-shareable")
.bindable(true)
.planUpdateable(true)
.metadata(
ServiceMetadata.builder()
.displayName("test-service-display-name")
.listing(
Listing.builder()
.blurb("test-listing-blurb")
.imageUrl(
"http://test-image-host/test-image.gif")
.longDescription(
"test-listing-long-description")
.build())
.provider(
Provider.builder()
.name("test-provider-name")
.build())
.shareable(true)
.build())
.dashboardClient(
DashboardClient.builder()
.id(UUID.randomUUID().toString())
.redirectUri("http://test-dashboard-host")
.secret(UUID.randomUUID().toString())
.build())
.plan(
Plan.builder()
.id(UUID.randomUUID().toString())
.name(planName + "-shareable")
.description(
"test-plan-description-shareable")
.metadata(
PlanMetadata.builder()
.bullet(
Bullet.builder()
.content(
"test-plan-metadata-bullet")
.build())
.cost(
Cost.builder()
.amount(
"usd",
1)
.unit(
"MONTHLY")
.build())
.build())
.build())
.build())
.build();
}

@GetMapping("/v2/catalog")
ResponseEntity<Catalog> catalog() {
return ResponseEntity.ok(this.catalog);
}

}
Loading
Loading