- 1.55.0 (latest)
- 1.54.0
- 1.53.0
- 1.51.0
- 1.50.0
- 1.49.0
- 1.48.0
- 1.47.0
- 1.46.0
- 1.45.0
- 1.44.0
- 1.43.0
- 1.42.0
- 1.41.0
- 1.39.0
- 1.38.0
- 1.37.0
- 1.36.0
- 1.35.0
- 1.34.0
- 1.33.0
- 1.32.0
- 1.31.0
- 1.30.0
- 1.29.0
- 1.26.0
- 1.25.0
- 1.24.0
- 1.23.0
- 1.22.0
- 1.21.0
- 1.20.0
- 1.19.0
- 1.18.0
- 1.17.0
- 1.16.0
- 1.15.0
- 1.14.0
- 1.13.0
- 1.11.0
- 1.10.0
- 1.9.0
- 1.8.0
- 1.7.0
- 1.6.0
- 1.5.6
- 1.4.0
- 1.3.2
- 1.2.12
public class LocalResourceManagerHelper
Deprecated. v3 GAPIC client of ResourceManager is now available
Utility to create a local Resource Manager mock for testing.
The mock runs in a separate thread, listening for HTTP requests on the local machine at an ephemeral port. While this mock attempts to simulate the Cloud Resource Manager, there are some divergences in behavior. The following is a non-exhaustive list of some of those behavioral differences:
- This mock assumes you have adequate permissions for any action. Related to this, testIamPermissions always indicates that the caller has all permissions listed in the request.
- IAM policies are set to an empty policy with version 0 (only legacy roles supported) upon project creation. The actual service will not have an empty list of bindings and may also set your version to 1.
- There is no input validation for the policy provided when replacing a policy or calling testIamPermissions.
- In this mock, projects never move from the DELETE_REQUESTED lifecycle state to DELETE_IN_PROGRESS without an explicit call to the utility method #changeLifecycleState. Similarly, a project is never completely removed without an explicit call to the utility method #removeProject.
- The messages in the error responses given by this mock do not necessarily match the messages given by the actual service.
Static Methods
create() (deprecated)
public static LocalResourceManagerHelper create()
Creates a LocalResourceManagerHelper
object that listens to requests on the local
machine.
Returns | |
---|---|
Type | Description |
LocalResourceManagerHelper |
Methods
changeLifecycleState(String projectId, String lifecycleState) (deprecated)
public synchronized boolean changeLifecycleState(String projectId, String lifecycleState)
Utility method to change the lifecycle state of the specified project.
Parameters | |
---|---|
Name | Description |
projectId |
String |
lifecycleState |
String |
Returns | |
---|---|
Type | Description |
boolean |
true if the lifecycle state was successfully updated, false otherwise |
getOptions() (deprecated)
public ResourceManagerOptions getOptions()
Returns a ResourceManagerOptions instance that sets the host to use the mock server.
Returns | |
---|---|
Type | Description |
ResourceManagerOptions |
removeProject(String projectId) (deprecated)
public synchronized boolean removeProject(String projectId)
Utility method to remove the specified project.
This method can be used to fully remove a project (to mimic when the server completely deletes a project).
Parameter | |
---|---|
Name | Description |
projectId |
String |
Returns | |
---|---|
Type | Description |
boolean |
true if the project was successfully deleted, false if the project didn't exist |
start() (deprecated)
public void start()
Starts the thread that runs the Resource Manager server.
stop() (deprecated)
public void stop()
Stops the thread that runs the mock Resource Manager server.