diff --git a/gcloud-java-resourcemanager/src/main/java/com/google/gcloud/resourcemanager/Project.java b/gcloud-java-resourcemanager/src/main/java/com/google/gcloud/resourcemanager/Project.java index 2db2602abe03..15e45f7e48fd 100644 --- a/gcloud-java-resourcemanager/src/main/java/com/google/gcloud/resourcemanager/Project.java +++ b/gcloud-java-resourcemanager/src/main/java/com/google/gcloud/resourcemanager/Project.java @@ -196,21 +196,6 @@ public void undelete() { resourceManager.undelete(projectId()); } - /** - * Replaces the attributes of the project with the attributes from the given {@code ProjectInfo}. - * - *
The caller must have modify permissions for this project. - * - * @see Cloud - * Resource Manager update - * @return the Project representing the new project metadata - * @throws ResourceManagerException upon failure - */ - public Project replace(ProjectInfo projectInfo) { - return resourceManager.replace(checkNotNull(projectInfo)); - } - /** * Replaces the attributes of the project with the attributes of this project. * diff --git a/gcloud-java-resourcemanager/src/test/java/com/google/gcloud/resourcemanager/ProjectTest.java b/gcloud-java-resourcemanager/src/test/java/com/google/gcloud/resourcemanager/ProjectTest.java index ee648df76eda..bc7ea273ff8a 100644 --- a/gcloud-java-resourcemanager/src/test/java/com/google/gcloud/resourcemanager/ProjectTest.java +++ b/gcloud-java-resourcemanager/src/test/java/com/google/gcloud/resourcemanager/ProjectTest.java @@ -168,31 +168,16 @@ public void testUndelete() { } @Test - public void testReplaceWithProjectInfo() { + public void testReplace() { initializeExpectedProject(2); - ProjectInfo newInfo = PROJECT_INFO.toBuilder().addLabel("k3", "v3").build(); - Project expectedProject = - new Project(serviceMockReturnsOptions, new ProjectInfo.BuilderImpl(newInfo)); - expect(resourceManager.options()).andReturn(mockOptions); - expect(resourceManager.replace(newInfo)).andReturn(expectedProject); - replay(resourceManager); - initializeProject(); - Project newProject = project.replace(newInfo); - assertEquals(expectedProject, newProject); - } - - @Test - public void testReplaceWithoutProjectInfo() { - initializeExpectedProject(2); - ProjectInfo newInfo = PROJECT_INFO.toBuilder().addLabel("k3", "v3").build(); - Project expectedProject = - new Project(serviceMockReturnsOptions, new ProjectInfo.BuilderImpl(newInfo)); - expect(resourceManager.options()).andReturn(mockOptions); + Project expectedReplacedProject = expectedProject.toBuilder().addLabel("k3", "v3").build(); + expect(resourceManager.options()).andReturn(mockOptions).times(2); expect(resourceManager.replace(anyObject(Project.class))).andReturn(expectedProject); replay(resourceManager); initializeProject(); - Project newProject = project.replace(newInfo); - assertEquals(expectedProject, newProject); + Project newProject = + new Project(resourceManager, new ProjectInfo.BuilderImpl(expectedReplacedProject)); + newProject.replace(); } private void compareProjects(Project expected, Project value) {