@Test public void isValidNoId() { ValidationResult result = DeletePackageRequest.builder().build().isValid(); assertEquals(INVALID, result.getStatus()); assertEquals("id must be specified", result.getMessages().get(0)); }
@Test public void isValidInvalidPaginatedRequest() { ValidationResult result = new ListApplicationsRequest().withPage(0).isValid(); assertEquals(ValidationResult.Status.INVALID, result.getStatus()); assertEquals("page must be greater than or equal to 1", result.getMessages().get(0)); }
@Test public void isValidNoId() { ValidationResult result = new ListApplicationPackagesRequest().isValid(); assertEquals(INVALID, result.getStatus()); assertEquals("id must be specified", result.getMessages().get(0)); }
@Test public void isValidNoRouteId() { ValidationResult result = UnmapApplicationRouteRequest.builder().id("test-id").build().isValid(); assertEquals(INVALID, result.getStatus()); assertEquals("route id must be specified", result.getMessages().get(0)); }
@Test public void isNotValidNoId() { ValidationResult result = BindServiceInstanceToRouteRequest.builder().routeId("test-route-id").build().isValid(); assertEquals(INVALID, result.getStatus()); assertEquals("service instance id must be specified", result.getMessages().get(0)); }
@Test public void isValid() { ValidationResult result = UnmapApplicationRouteRequest.builder() .id("test-id") .routeId("test-route-id") .build() .isValid(); assertEquals(VALID, result.getStatus()); }
@Test public void isValid() { ValidationResult result = BindServiceInstanceToRouteRequest.builder() .serviceInstanceId("test-service-instance-id") .routeId("test-route-id") .build() .isValid(); assertEquals(VALID, result.getStatus()); }
@Override public ValidationResult isValid() { ValidationResult.ValidationResultBuilder builder = ValidationResult.builder(); if (this.organizationId == null) { builder.message("organization id must be specified"); } return builder.build(); }
@Override public ValidationResult isValid() { ValidationResult.ValidationResultBuilder builder = ValidationResult.builder(); if (this.applicationId == null) { builder.message("application id must be specified"); } if (this.routeId == null) { builder.message("route id must be specified"); } return builder.build(); }
@Override public ValidationResult isValid() { ValidationResult.ValidationResultBuilder builder = ValidationResult.builder(); if (this.id == null) { builder.message("id must be specified"); } if (this.username == null) { builder.message("username must be specified"); } return builder.build(); }
@Override public ValidationResult isValid() { ValidationResult.ValidationResultBuilder builder = ValidationResult.builder(); if (this.id == null) { builder.message("id must be specified"); } if (this.securityGroupId == null) { builder.message("security group id must be specified"); } return builder.build(); }
@Test public void isValid() { ValidationResult result = DeletePackageRequest.builder().id("test-id").build().isValid(); assertEquals(VALID, result.getStatus()); }
@Test public void isValid() { ValidationResult result = new ListApplicationsRequest().isValid(); assertEquals(ValidationResult.Status.VALID, result.getStatus()); }
@Test public void isValid() { ValidationResult result = new ListApplicationPackagesRequest().withId("test-id").isValid(); assertEquals(VALID, result.getStatus()); }