/**
  * @test
  */
 public function loadMetadataCreateNewClassMetadata()
 {
     $expectedResult = new ClassMetadata\ClassMetadata('Kassko\\DataMapperTest\\ClassMetadata\\Fixture\\SampleClass');
     $cacheKey = 'testCacheKey';
     $this->objectKeyMock->expects($this->once())->method('getKey')->willReturn($cacheKey);
     $this->objectKeyMock->expects($this->once())->method('getClass')->willReturn('Kassko\\DataMapperTest\\ClassMetadata\\Fixture\\SampleClass');
     $this->loaderMock->expects($this->once())->method('loadClassMetadata')->with($expectedResult, $this->loadingCriteriaMock, $this->configurationMock);
     $this->cacheMock->expects($this->once())->method('save')->with($cacheKey);
     $this->eventDispatcherMock->expects($this->once())->method('dispatch')->with(ClassMetadata\Events::POST_LOAD_METADATA);
     $result = $this->classMetadataFactory->loadMetadata($this->objectKeyMock, $this->loadingCriteriaMock, $this->configurationMock);
     $this->assertEquals($expectedResult, $result);
 }