You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: team_layer_test.go
    path of file: ./repos/mattermost/server/channels/store/localcachelayer
    
    the code of the file until where you have to start completion: // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.

package localcachelayer

import (
	"testing"

	"github.com/stretchr/testify/assert"
	"github.com/stretchr/testify/require"

	"github.com/mattermost/mattermost/server/v8/channels/store/storetest"
	"github.com/mattermost/mattermost/server/v8/channels/store/storetest/mocks"
)

func TestTeamStore(t *testing.T) {
	StoreTest(t, storetest.TestTeamStore)
}

func TestTeamStoreCache(t *testing.T) {
	fakeUserId := "123"
	fakeUserTeamIds := []string{"1", "2", "3"}

	t.Run("first call not cached, second cached and returning same data", func(t *testing.T) {
		mockStore := getMockStore(t)
		mockCacheProvider := getMockCacheProvider()
		cachedStore, err := NewLocalCacheLayer(mockStore, nil, nil, mockCacheProvider)
		require.NoError(t, err)

		gotUserTeamIds, err := cachedStore.Team().GetUserTeamIds(fakeUserId, true)
		require.NoError(t, err)
		assert.Equal(t, fakeUserTeamIds, gotUserTeamIds)
		mockStore.T
    
func TestTeamStoreCache(t *testing.T) {
	fakeUserId := "123"
	fakeUserTeamIds := []string{"1", "2", "3"}

	t.Run("first call not cached, second cached and returning same data", func(t *testing.T) {
		mockStore := getMockStore(t)
		mockCacheProvider := getMockCacheProvider()
		cachedStore, err := NewLocalCacheLayer(mockStore, nil, nil, mockCacheProvider)
		require.NoError(t, err)

		gotUserTeamIds, err := cachedStore.Team().GetUserTeamIds(fakeUserId, true)
		require.NoError(t, err)
		assert.Equal(t, fakeUserTeamIds, gotUserTeamIds)
		mockStore.Team().(*mocks.TeamStore).AssertNumberOfCalls(t, "GetUserTeamIds", 1)

		gotUserTeamIds, err = cachedStore.Team().GetUserTeamIds(fakeUserId, true)
		require.NoError(t, err)
		assert.Equal(t, fakeUserTeamIds, gotUserTeamIds)
		mockStore.Team().(*mocks.TeamStore).AssertNumberOfCalls(t, "GetUserTeamIds", 1)
	})

	t.Run("first call not cached, second force not cached", func(t *testing.T) {
		mockStore := getMockStore(t)
		mockCacheProvider := getMockCacheProvider()
		cachedStore, err := NewLocalCacheLayer(mockStore, nil, nil, mockCacheProvider)
		require.NoError(t, err)

		gotUserTeamIds, err := cachedStore.Team().GetUserTeamIds(fakeUserId, true)
		require.NoError(t, err)
		assert.Equal(t, fakeUserTeamIds, gotUserTeamIds)
		mockStore.Team().(*mocks.TeamStore).AssertNumberOfCalls(t, "GetUserTeamIds", 1)

		gotUserTeamIds, err = cachedStore.Team().GetUserTeamIds(fakeUserId, false)
		require.NoError(t, err)
		assert.Equal(t, fakeUserTeamIds, gotUserTeamIds)
		mockStore.Team().(*mocks.TeamStore).AssertNumberOfCalls(t, "GetUserTeamIds", 2)
	})

	t.Run("first call not cached, invalidate, and then not cached again", func(t *testing.T) {
		mockStore := getMockStore(t)
		mockCacheProvider := getMockCacheProvider()
		cachedStore, err := NewLocalCacheLayer(mockStore, nil, nil, mockCacheProvider)
		require.NoError(t, err)

		gotUserTeamIds, err := cachedStore.Team().GetUserTeamIds(fakeUserId, true)
		require.NoError(t, err)
		assert.Equal(t, fakeUserTeamIds, gotUserTeamIds)
		mockStore.Team().(*mocks.TeamStore).AssertNumberOfCalls(t, "GetUserTeamIds", 1)

		cachedStore.Team().InvalidateAllTeamIdsForUser(fakeUserId)

		gotUserTeamIds, err = cachedStore.Team().GetUserTeamIds(fakeUserId, true)
		require.NoError(t, err)
		assert.Equal(t, fakeUserTeamIds, gotUserTeamIds)
		mockStore.Team().(*mocks.TeamStore).AssertNumberOfCalls(t, "GetUserTeamIds", 2)
	})
}