@@ -0,0 +1,2127 @@
+package ru.otus.kirillov.model.commands.getCacheStats;%0A%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0Aimport ru.otus.kirillov.cacheengine.CacheEngine;%0Aimport ru.otus.kirillov.cacheengine.stats.CacheStatistics;%0Aimport ru.otus.kirillov.model.commands.Result;%0Aimport ru.otus.kirillov.model.commands.common.ErroneousResult;%0A%0Aimport static org.junit.Assert.assertEquals;%0Aimport static org.junit.Assert.assertFalse;%0Aimport static org.junit.Assert.assertTrue;%0Aimport static org.mockito.Mockito.mock;%0Aimport static org.mockito.Mockito.when;%0A%0Apublic class GetCacheStatsCommandTest %7B%0A%0A    private GetCacheStatsCommand command;%0A%0A    private CacheEngine cacheEngineMock;%0A%0A    @Before%0A    public void setUp() %7B%0A        cacheEngineMock = mock(CacheEngine.class);%0A        command = new GetCacheStatsCommand(cacheEngineMock);%0A    %7D%0A%0A    private static final long CACHE_HIT_RESULT = 100;%0A    private static final long CACHE_MISS_RESULT = 200;%0A    private static final int CACHE_SIZE_RESULT = 300;%0A%0A    @Test%0A    public void testSuccess() %7B%0A        when(cacheEngineMock.getStats()).thenReturn(%0A                CacheStatistics.of(CACHE_HIT_RESULT, CACHE_MISS_RESULT, CACHE_SIZE_RESULT)%0A        );%0A        Result result = command.execute(new GetCacheStatsRequest());%0A%0A        assertTrue(result instanceof GetCacheStatsResult);%0A%0A        GetCacheStatsResult cacheStatsResult = (GetCacheStatsResult) result;%0A%0A        assertEquals(CACHE_HIT_RESULT, cacheStatsResult.getCacheHit());%0A        assertEquals(CACHE_MISS_RESULT, cacheStatsResult.getCacheMiss());%0A        assertEquals(CACHE_SIZE_RESULT, cacheStatsResult.getCacheSize());%0A    %7D%0A%0A    private static final String ERRONEOUS_MESSAGE = %22#1%25%5ETEZZZ#1%25%5E%22;%0A%0A    @Test%0A    public void testError() %7B%0A        when(cacheEngineMock.getStats()).thenThrow(%0A                new UnsupportedOperationException(ERRONEOUS_MESSAGE)%0A        );%0A        Result result = command.execute(new GetCacheStatsRequest());%0A%0A        assertTrue(result instanceof ErroneousResult);%0A%0A        ErroneousResult erroneousResult = (ErroneousResult) result;%0A        assertEquals(ERRONEOUS_MESSAGE, erroneousResult.getCause());%0A    %7D%0A%7D

add test for GetCacheStatsCommand