Fixed download progress event.

Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com>
This commit is contained in:
kaizimmerm
2016-07-07 14:46:29 +02:00
parent a9204fe5eb
commit 8fb2bd4322
15 changed files with 73 additions and 127 deletions

View File

@@ -14,7 +14,7 @@ import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import org.eclipse.hawkbit.eventbus.event.DownloadProgressEvent;
import org.eclipse.hawkbit.repository.model.Action;
import org.eclipse.hawkbit.repository.model.ActionStatus;
import org.eclipse.hawkbit.tenancy.TenantAware;
import org.junit.Before;
import org.junit.Test;
@@ -61,12 +61,12 @@ public class CacheWriteNotifyTest {
final long knownStatusId = 1;
final int knownPercentage = 23;
when(cacheManagerMock.getCache(Action.class.getName())).thenReturn(cacheMock);
when(cacheManagerMock.getCache(ActionStatus.class.getName())).thenReturn(cacheMock);
when(tenantAwareMock.getCurrentTenant()).thenReturn("default");
underTest.downloadProgressPercent(knownStatusId, knownPercentage, 100L);
underTest.downloadProgressPercent(knownStatusId, knownPercentage, 100L, 500L);
verify(cacheManagerMock).getCache(eq(Action.class.getName()));
verify(cacheManagerMock).getCache(eq(ActionStatus.class.getName()));
verify(cacheMock).put(knownStatusId + "." + CacheKeys.DOWNLOAD_PROGRESS_PERCENT, knownPercentage);
verify(eventBusMock).post(any(DownloadProgressEvent.class));
}