use of com.yahoo.elide.ElideSettingsBuilder in project elide by yahoo.
the class GraphQLTableExportOperationTest method setupMocks.
@BeforeEach
public void setupMocks(@TempDir Path tempDir) {
dataStore = new HashMapDataStore(DefaultClassScanner.getInstance(), new HashSet<>(Arrays.asList(TableExport.class.getPackage(), ArtifactGroup.class.getPackage())));
Map<String, Class<? extends Check>> map = new HashMap<>();
map.put(AsyncAPIInlineChecks.AsyncAPIOwner.PRINCIPAL_IS_OWNER, AsyncAPIInlineChecks.AsyncAPIOwner.class);
map.put(AsyncAPIInlineChecks.AsyncAPIAdmin.PRINCIPAL_IS_ADMIN, AsyncAPIInlineChecks.AsyncAPIAdmin.class);
map.put(AsyncAPIInlineChecks.AsyncAPIStatusValue.VALUE_IS_CANCELLED, AsyncAPIInlineChecks.AsyncAPIStatusValue.class);
map.put(AsyncAPIInlineChecks.AsyncAPIStatusQueuedValue.VALUE_IS_QUEUED, AsyncAPIInlineChecks.AsyncAPIStatusQueuedValue.class);
elide = new Elide(new ElideSettingsBuilder(dataStore).withEntityDictionary(EntityDictionary.builder().checks(map).build()).withAuditLogger(new Slf4jLogger()).withExportApiPath("/export").build());
elide.doScans();
user = mock(User.class);
requestScope = mock(RequestScope.class);
asyncExecutorService = mock(AsyncExecutorService.class);
engine = new FileResultStorageEngine(tempDir.toString(), false);
when(asyncExecutorService.getElide()).thenReturn(elide);
when(requestScope.getApiVersion()).thenReturn(NO_VERSION);
when(requestScope.getUser()).thenReturn(user);
when(requestScope.getElideSettings()).thenReturn(elide.getElideSettings());
when(requestScope.getBaseUrlEndPoint()).thenReturn("https://elide.io");
}
use of com.yahoo.elide.ElideSettingsBuilder in project elide by yahoo.
the class JsonAPITableExportOperationTest method setupMocks.
@BeforeEach
public void setupMocks(@TempDir Path tempDir) {
dataStore = new HashMapDataStore(DefaultClassScanner.getInstance(), new HashSet<>(Arrays.asList(TableExport.class.getPackage(), ArtifactGroup.class.getPackage())));
Map<String, Class<? extends Check>> map = new HashMap<>();
map.put(AsyncAPIInlineChecks.AsyncAPIOwner.PRINCIPAL_IS_OWNER, AsyncAPIInlineChecks.AsyncAPIOwner.class);
map.put(AsyncAPIInlineChecks.AsyncAPIAdmin.PRINCIPAL_IS_ADMIN, AsyncAPIInlineChecks.AsyncAPIAdmin.class);
map.put(AsyncAPIInlineChecks.AsyncAPIStatusValue.VALUE_IS_CANCELLED, AsyncAPIInlineChecks.AsyncAPIStatusValue.class);
map.put(AsyncAPIInlineChecks.AsyncAPIStatusQueuedValue.VALUE_IS_QUEUED, AsyncAPIInlineChecks.AsyncAPIStatusQueuedValue.class);
elide = new Elide(new ElideSettingsBuilder(dataStore).withEntityDictionary(EntityDictionary.builder().checks(map).build()).withAuditLogger(new Slf4jLogger()).withExportApiPath("/export").build());
elide.doScans();
user = mock(User.class);
requestScope = mock(RequestScope.class);
asyncExecutorService = mock(AsyncExecutorService.class);
engine = new FileResultStorageEngine(tempDir.toString(), true);
when(asyncExecutorService.getElide()).thenReturn(elide);
when(requestScope.getApiVersion()).thenReturn(NO_VERSION);
when(requestScope.getUser()).thenReturn(user);
when(requestScope.getElideSettings()).thenReturn(elide.getElideSettings());
when(requestScope.getBaseUrlEndPoint()).thenReturn("https://elide.io");
}
use of com.yahoo.elide.ElideSettingsBuilder in project elide by yahoo.
the class AsyncExecutorServiceTest method setupMockElide.
@BeforeAll
public void setupMockElide() {
HashMapDataStore inMemoryStore = new HashMapDataStore(DefaultClassScanner.getInstance(), AsyncQuery.class.getPackage());
Map<String, Class<? extends Check>> checkMappings = new HashMap<>();
elide = new Elide(new ElideSettingsBuilder(inMemoryStore).withEntityDictionary(EntityDictionary.builder().checks(checkMappings).build()).build());
asyncAPIDao = mock(DefaultAsyncAPIDAO.class);
testUser = mock(User.class);
scope = mock(RequestScope.class);
resultStorageEngine = mock(FileResultStorageEngine.class);
service = new AsyncExecutorService(elide, Executors.newFixedThreadPool(5), Executors.newFixedThreadPool(5), asyncAPIDao);
}
use of com.yahoo.elide.ElideSettingsBuilder in project elide by yahoo.
the class CSVExportFormatterTest method setupMocks.
@BeforeEach
public void setupMocks(@TempDir Path tempDir) {
dataStore = new HashMapDataStore(DefaultClassScanner.getInstance(), TableExport.class.getPackage());
Map<String, Class<? extends Check>> map = new HashMap<>();
elide = new Elide(new ElideSettingsBuilder(dataStore).withEntityDictionary(EntityDictionary.builder().checks(map).build()).withISO8601Dates("yyyy-MM-dd'T'HH:mm'Z'", TimeZone.getTimeZone("UTC")).build());
elide.doScans();
scope = mock(RequestScope.class);
}
use of com.yahoo.elide.ElideSettingsBuilder in project elide by yahoo.
the class JSONExportFormatterTest method setupMocks.
@BeforeEach
public void setupMocks(@TempDir Path tempDir) {
dataStore = new HashMapDataStore(DefaultClassScanner.getInstance(), TableExport.class.getPackage());
Map<String, Class<? extends Check>> map = new HashMap<>();
elide = new Elide(new ElideSettingsBuilder(dataStore).withEntityDictionary(EntityDictionary.builder().checks(map).build()).withISO8601Dates("yyyy-MM-dd'T'HH:mm'Z'", TimeZone.getTimeZone("UTC")).build());
elide.doScans();
scope = mock(RequestScope.class);
}
Aggregations