Fixed download progress event.
Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com>
This commit is contained in:
@@ -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));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user