) BeforeEach(func() { fakeResource = new(rfakes.FakeResource) fakeCache = new(rfakes.FakeCache) fakeTracker.InitWithCacheReturns(fakeResource, fakeCache, nil) fakeVersionedSource = new(rfakes.FakeVersionedSource) fakeVersionedSource.VersionReturns(atc.Version{"some": "version"}) fakeVersionedSource.MetadataReturns([]atc.MetadataField{{"some", "metadata"}}) fakeResource.GetReturns(fakeVersionedSource) }) It("initializes the resource with the correct type and session id, making sure that it is not ephemeral", func() { Expect(fakeTracker.InitWithCacheCallCount()).To(Equal(1)) _, sm, sid, typ, tags, cacheID := fakeTracker.InitWithCacheArgsForCall(0) Expect(sm).To(Equal(stepMetadata)) Expect(sid).To(Equal(resource.Session{ ID: identifier, Ephemeral: false, })) Expect(typ).To(Equal(resource.ResourceType("some-resource-type"))) Expect(tags).To(ConsistOf("some", "tags")) Expect(cacheID).To(Equal(resource.ResourceCacheIdentifier{ Type: "some-resource-type", Source: resourceConfig.Source, Params: params, Version: version, }))