/**
  * test _beforeSaveMethod via save()
  */
 public function testSave()
 {
     $this->validatorMock->expects($this->once())->method('validate')->with($this->equalTo($this->addressMock))->will($this->returnValue([]));
     $this->entitySnapshotMock->expects($this->once())->method('isModified')->with($this->addressMock)->willReturn(true);
     $this->addressMock->expects($this->exactly(3))->method('getParentId')->will($this->returnValue(1));
     $this->gridPoolMock->expects($this->once())->method('refreshByOrderId')->with($this->equalTo(1))->will($this->returnSelf());
     $this->addressResource->save($this->addressMock);
 }
 public function testGridsReindex()
 {
     $this->eventObserverMock->expects($this->once())->method('getOrderId')->willReturn(100500);
     $this->gridPoolMock->expects($this->once())->method('refreshByOrderId')->with(100500);
     $this->assertNull($this->observer->execute($this->eventObserverMock));
 }