[Tests] verify that identifier service provides key

Verify that the results of the identifier service are used for
persistence calls instead of the domain object id.

https://github.com/nasa/openmct/issues/1013
This commit is contained in:
Pete Richards
2016-06-15 10:31:25 -07:00
parent 2d5824c4ab
commit c00b053aa7

View File

@ -35,7 +35,8 @@ define(
mockNofificationService, mockNofificationService,
mockCacheService, mockCacheService,
mockQ, mockQ,
id = "object id", key = "persistence key",
id = "object identifier",
model, model,
SPACE = "some space", SPACE = "some space",
persistence, persistence,
@ -101,7 +102,7 @@ define(
}); });
mockIdentifierService.parse.andReturn(mockIdentifier); mockIdentifierService.parse.andReturn(mockIdentifier);
mockIdentifier.getSpace.andReturn(SPACE); mockIdentifier.getSpace.andReturn(SPACE);
mockIdentifier.getKey.andReturn(id); mockIdentifier.getKey.andReturn(key);
persistence = new PersistenceCapability( persistence = new PersistenceCapability(
mockCacheService, mockCacheService,
mockPersistenceService, mockPersistenceService,
@ -125,7 +126,7 @@ define(
expect(mockPersistenceService.createObject).toHaveBeenCalledWith( expect(mockPersistenceService.createObject).toHaveBeenCalledWith(
SPACE, SPACE,
id, key,
model model
); );
}); });
@ -139,7 +140,7 @@ define(
expect(mockPersistenceService.updateObject).toHaveBeenCalledWith( expect(mockPersistenceService.updateObject).toHaveBeenCalledWith(
SPACE, SPACE,
id, key,
model model
); );
}); });