public function testUpdateGroup() { $builder = $this->_objectManager->create('\\Magento\\Customer\\Service\\V1\\Data\\CustomerGroupBuilder'); $group = $builder->setId(null)->setCode('New Group')->setTaxClassId(3)->create(); $groupId = $this->_groupService->saveGroup($group); $this->assertNotNull($groupId); $newGroup = $this->_groupService->getGroup($groupId); $this->assertEquals($groupId, $newGroup->getId()); $this->assertEquals($group->getCode(), $newGroup->getCode()); $this->assertEquals($group->getTaxClassId(), $newGroup->getTaxClassId()); $updates = $builder->setId($groupId)->setCode('Updated Group')->setTaxClassId(3)->create(); $newId = $this->_groupService->saveGroup($updates); $this->assertEquals($newId, $groupId); $updatedGroup = $this->_groupService->getGroup($groupId); $this->assertEquals($updates->getCode(), $updatedGroup->getCode()); $this->assertEquals($updates->getTaxClassId(), $updatedGroup->getTaxClassId()); }