Skip to content

Commit d909d3a

Browse files
committed
Merge 119999655-delete-org-recursively to master
[Completes #119999655]
2 parents bd76057 + 260f1ab commit d909d3a

File tree

4 files changed

+58
-100
lines changed

4 files changed

+58
-100
lines changed

cloudfoundry-client-spring/src/test/java/org/cloudfoundry/reactor/client/v2/organizations/ReactorOrganizationsTest.java

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -788,12 +788,6 @@ protected InteractionContext getInteractionContext() {
788788
.build();
789789
}
790790

791-
@Override
792-
protected DeleteOrganizationRequest getInvalidRequest() {
793-
return DeleteOrganizationRequest.builder()
794-
.build();
795-
}
796-
797791
@Override
798792
protected DeleteOrganizationResponse getResponse() {
799793
return null;
@@ -830,12 +824,6 @@ protected InteractionContext getInteractionContext() {
830824
.build();
831825
}
832826

833-
@Override
834-
protected DeleteOrganizationRequest getInvalidRequest() {
835-
return DeleteOrganizationRequest.builder()
836-
.build();
837-
}
838-
839827
@Override
840828
protected DeleteOrganizationResponse getResponse() {
841829
return DeleteOrganizationResponse.builder()
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
/*
2+
* Copyright 2013-2016 the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package org.cloudfoundry.client.v2.organizations;
18+
19+
import com.fasterxml.jackson.annotation.JsonIgnore;
20+
import org.cloudfoundry.Nullable;
21+
import org.cloudfoundry.QueryParameter;
22+
import org.immutables.value.Value;
23+
24+
/**
25+
* The request payload for the Delete a Particular Organization operation
26+
*/
27+
@Value.Immutable
28+
abstract class AbstractDeleteOrganizationRequest {
29+
30+
/**
31+
* Whether to delete asynchronously
32+
*/
33+
@Nullable
34+
@QueryParameter("async")
35+
abstract Boolean getAsync();
36+
37+
/**
38+
* The organization id
39+
*/
40+
@JsonIgnore
41+
abstract String getOrganizationId();
42+
43+
/**
44+
* Whether to delete recursively
45+
*/
46+
@Nullable
47+
@QueryParameter("recursive")
48+
abstract Boolean getRecursive();
49+
50+
}

cloudfoundry-client/src/main/lombok/org/cloudfoundry/client/v2/organizations/DeleteOrganizationRequest.java

Lines changed: 0 additions & 68 deletions
This file was deleted.

cloudfoundry-client/src/test/java/org/cloudfoundry/client/v2/organizations/DeleteOrganizationRequestTest.java

Lines changed: 8 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -16,33 +16,21 @@
1616

1717
package org.cloudfoundry.client.v2.organizations;
1818

19-
import org.cloudfoundry.ValidationResult;
2019
import org.junit.Test;
2120

22-
import static org.cloudfoundry.ValidationResult.Status.INVALID;
23-
import static org.cloudfoundry.ValidationResult.Status.VALID;
24-
import static org.junit.Assert.assertEquals;
25-
2621
public final class DeleteOrganizationRequestTest {
2722

28-
@Test
29-
public void isValid() {
30-
ValidationResult result = DeleteOrganizationRequest.builder()
31-
.organizationId("test-organization-id")
32-
.build()
33-
.isValid();
34-
35-
assertEquals(VALID, result.getStatus());
23+
@Test(expected = IllegalStateException.class)
24+
public void noOrganizationId() {
25+
DeleteOrganizationRequest.builder()
26+
.build();
3627
}
3728

3829
@Test
39-
public void isValidNoId() {
40-
ValidationResult result = DeleteOrganizationRequest.builder()
41-
.build()
42-
.isValid();
43-
44-
assertEquals(INVALID, result.getStatus());
45-
assertEquals("organization id must be specified", result.getMessages().get(0));
30+
public void valid() {
31+
DeleteOrganizationRequest.builder()
32+
.organizationId("test-organization-id")
33+
.build();
4634
}
4735

4836
}

0 commit comments

Comments
 (0)