focal_method
stringlengths
13
60.9k
test_case
stringlengths
25
109k
@LiteralParameters("x") @ScalarOperator(INDETERMINATE) @SqlType(StandardTypes.BOOLEAN) public static boolean indeterminate(@SqlType("char(x)") Slice value, @IsNull boolean isNull) { return isNull; }
@Test public void testIndeterminate() { assertOperator(INDETERMINATE, "CAST(null AS CHAR(3))", BOOLEAN, true); assertOperator(INDETERMINATE, "CHAR '123'", BOOLEAN, false); }
@Override public boolean deleteService(String serviceName, String groupName) throws NacosException { NAMING_LOGGER.info("[DELETE-SERVICE] {} deleting service : {} with groupName : {}", namespaceId, serviceName, groupName); final Map<String, String> params = new HashMap<>(16)...
@Test void testDeleteService() throws Exception { //given NacosRestTemplate nacosRestTemplate = mock(NacosRestTemplate.class); HttpRestResult<Object> a = new HttpRestResult<Object>(); a.setData("{\"name\":\"service1\",\"groupName\":\"group1\"}"); a.setCode(200); when(...
@Override public void deleteDiyPage(Long id) { // 校验存在 validateDiyPageExists(id); // 删除 diyPageMapper.deleteById(id); }
@Test public void testDeleteDiyPage_success() { // mock 数据 DiyPageDO dbDiyPage = randomPojo(DiyPageDO.class); diyPageMapper.insert(dbDiyPage);// @Sql: 先插入出一条存在的数据 // 准备参数 Long id = dbDiyPage.getId(); // 调用 diyPageService.deleteDiyPage(id); // 校验数据不存在了...
@Operation(summary = "Get single organization") @GetMapping(value = "{id}", produces = "application/json") @ResponseBody public Organization getById(@PathVariable("id") Long id) { return organizationService.getOrganizationById(id); }
@Test public void organizationIdNotFound() { when(organizationServiceMock.getOrganizationById(anyLong())).thenThrow(NotFoundException.class); assertThrows(NotFoundException.class, () -> { controllerMock.getById(1L); }); }
@Override public MaterializedTable nonWindowed() { return new KsqlMaterializedTable(inner.nonWindowed()); }
@Test public void shouldCallFilterWithCorrectValuesOnNonWindowedGet() { // Given: final MaterializedTable table = materialization.nonWindowed(); givenNoopFilter(); when(project.apply(any(), any(), any())).thenReturn(Optional.of(transformed)); // When: table.get(aKey, partition).next(); /...
public StepInstanceActionResponse terminate( String workflowId, long workflowInstanceId, String stepId, User user, Actions.StepInstanceAction action, boolean blocking) { WorkflowInstance instance = instanceDao.getLatestWorkflowInstanceRun(workflowId, workflowInstanceId); ...
@Test public void testTerminate() { when(instance.getStatus()).thenReturn(WorkflowInstance.Status.IN_PROGRESS); stepActionHandler.terminate("sample-minimal-wf", 1, "job1", user, STOP, true); verify(actionDao, times(1)).terminate(instance, "job1", user, STOP, true); when(instance.getStatus()).thenRetur...
@Override public void updateCorePoolSize(int corePoolSize) { if (corePoolSize > 0 && corePoolSize <= Short.MAX_VALUE && corePoolSize < this.defaultMQPushConsumer.getConsumeThreadMax()) { this.consumeExecutor.setCorePoolSize(corePoolSize); } }
@Test public void testUpdateCorePoolSize() { popService.updateCorePoolSize(2); popService.incCorePoolSize(); popService.decCorePoolSize(); assertEquals(2, popService.getCorePoolSize()); }
public PrefetchableIterable<V> get(K key) { checkState( !isClosed, "Multimap user state is no longer usable because it is closed for %s", keysStateRequest.getStateKey()); Object structuralKey = mapKeyCoder.structuralValue(key); KV<K, List<V>> pendingAddValues = pendingAdds.get(struc...
@Test public void testGet() throws Exception { FakeBeamFnStateClient fakeClient = new FakeBeamFnStateClient( ImmutableMap.of( createMultimapKeyStateKey(), KV.of(ByteArrayCoder.of(), singletonList(A1)), createMultimapValueStateKey(A1), ...
public static Write write() { return new AutoValue_SnsIO_Write.Builder().build(); }
@Test public void testCustomCoder() throws Exception { final PublishRequest request1 = createSampleMessage("my_first_message"); final TupleTag<PublishResult> results = new TupleTag<>(); final AmazonSNS amazonSnsSuccess = getAmazonSnsMockSuccess(); final MockCoder mockCoder = new MockCoder(); fin...
static InitWriterConfig fromMap(Map<String, String> map) { Map<String, String> envMap = new HashMap<>(map); envMap.keySet().retainAll(InitWriterConfig.keyNames()); Map<String, Object> generatedMap = ConfigParameter.define(envMap, CONFIG_VALUES); return new InitWriterConfig(generatedMap...
@Test public void testFromMapEmptyEnvVarsThrows() { assertThrows(InvalidConfigurationException.class, () -> InitWriterConfig.fromMap(Map.of())); }
@VisibleForTesting void checkOpenFiles() { if (notificationExists(Notification.Type.ES_OPEN_FILES)) { return; } boolean allHigher = true; final Set<NodeFileDescriptorStats> fileDescriptorStats = cluster.getFileDescriptorStats(); for (NodeFileDescriptorStats nodeF...
@Test public void preventOpenFilesNotificationFlood() { when(notificationService.isFirst(Notification.Type.ES_OPEN_FILES)).thenReturn(false); indexerClusterCheckerThread.checkOpenFiles(); verify(notificationService, times(1)).isFirst(Notification.Type.ES_OPEN_FILES); verifyNoMoreIn...
public void updateContent(Properties prop) { { String value = prop.getProperty(ACCESS_KEY); if (value != null) { this.accessKey = value.trim(); } } { String value = prop.getProperty(SECRET_KEY); if (value != null) { ...
@Test public void updateContentTest() { SessionCredentials sessionCredentials = new SessionCredentials(); Properties properties = new Properties(); properties.setProperty(SessionCredentials.ACCESS_KEY,"RocketMQ"); properties.setProperty(SessionCredentials.SECRET_KEY,"12345678"); ...
public static Criterion matchIPSrc(IpPrefix ip) { return new IPCriterion(ip, Type.IPV4_SRC); }
@Test public void testMatchIPSrcMethod() { Criterion matchIpSrc = Criteria.matchIPSrc(ip1); IPCriterion ipCriterion = checkAndConvert(matchIpSrc, Criterion.Type.IPV4_SRC, IPCriterion.class); assertThat(ipCriterio...
public static void boundsCheck(int capacity, int index, int length) { if (capacity < 0 || index < 0 || length < 0 || (index > (capacity - length))) { throw new IndexOutOfBoundsException(String.format("index=%d, length=%d, capacity=%d", index, length, capacity)); } }
@Test(expected = IndexOutOfBoundsException.class) public void boundsCheck_whenLengthIntegerMax() { //Testing wrapping does not cause false check ArrayUtils.boundsCheck(0, 10, Integer.MAX_VALUE); }
public static <T> T getBean(Class<T> interfaceClass, Class typeClass) { Object object = serviceMap.get(interfaceClass.getName() + "<" + typeClass.getName() + ">"); if(object == null) return null; if(object instanceof Object[]) { return (T)Array.get(object, 0); } else { ...
@Test public void testConstructorWithParameters() { MImpl m = (MImpl)SingletonServiceFactory.getBean(M.class); Assert.assertEquals(5, m.getValue()); }
@Override public URL getLocalArtifactUrl(DependencyJar dependency) { String depShortName = dependency.getShortName(); String pathStr = properties.getProperty(depShortName); if (pathStr != null) { if (pathStr.indexOf(File.pathSeparatorChar) != -1) { throw new IllegalArgumentException( ...
@Test public void whenRelativePathIsProvidedInProperties_shouldReturnFileUrl() throws Exception { DependencyResolver resolver = new PropertiesDependencyResolver( propsFile("com.group:example:1.3", new File("path", "1")), mock); URL url = resolver.getLocalArtifactUrl(exampleDep); asser...
private CompletableFuture<Boolean> verifyTxnOwnership(TxnID txnID) { assert ctx.executor().inEventLoop(); return service.pulsar().getTransactionMetadataStoreService() .verifyTxnOwnership(txnID, getPrincipal()) .thenComposeAsync(isOwner -> { if (isOwner...
@Test(timeOut = 30000) public void sendAddPartitionToTxnResponse() throws Exception { final TransactionMetadataStoreService txnStore = mock(TransactionMetadataStoreService.class); when(txnStore.getTxnMeta(any())).thenReturn(CompletableFuture.completedFuture(mock(TxnMeta.class))); when(txnSto...
@Override public synchronized void write(int b) throws IOException { checkNotClosed(); file.writeLock().lock(); try { if (append) { pos = file.sizeWithoutLocking(); } file.write(pos++, (byte) b); file.setLastModifiedTime(fileSystemState.now()); } finally { file....
@Test public void testWrite_wholeArray_overwriting() throws IOException { JimfsOutputStream out = newOutputStream(false); addBytesToStore(out, 9, 8, 7, 6, 5, 4, 3); out.write(new byte[] {1, 2, 3, 4}); assertStoreContains(out, 1, 2, 3, 4, 5, 4, 3); }
@VisibleForTesting public static JobGraph createJobGraph(StreamGraph streamGraph) { return new StreamingJobGraphGenerator( Thread.currentThread().getContextClassLoader(), streamGraph, null, Runnable::run) ...
@Test void testPartitionTypesInBatchMode() { StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment(); env.setRuntimeMode(RuntimeExecutionMode.BATCH); env.setParallelism(4); env.disableOperatorChaining(); DataStream<Integer> source = env.fromData(...
public static BadRequestException itemAlreadyExists(String itemKey) { return new BadRequestException("item already exists for itemKey:%s", itemKey); }
@Test public void testItemAlreadyExists() { BadRequestException itemAlreadyExists = BadRequestException.itemAlreadyExists("itemKey"); assertEquals("item already exists for itemKey:itemKey", itemAlreadyExists.getMessage()); }
@Override public void cleanUp(GlobalTransaction tx) { if (tx == null) { throw new EngineExecutionException("Global transaction does not exist. Unable to proceed without a valid global transaction context.", FrameworkErrorCode.ObjectNotExists); } if (tx.getGlob...
@Test public void testCleanUp() { MockGlobalTransaction mockGlobalTransaction = new MockGlobalTransaction(); sagaTransactionalTemplate.cleanUp(mockGlobalTransaction); }
public static String buildURIFromPattern(String pattern, List<Parameter> parameters) { if (parameters != null) { // Browse parameters and choose between template or query one. for (Parameter parameter : parameters) { String wadlTemplate = "{" + parameter.getName() + "}"; ...
@Test void testBuildURIFromPattern() { // Prepare a bunch of parameters. Parameter yearParam = new Parameter(); yearParam.setName("year"); yearParam.setValue("2017"); Parameter monthParam = new Parameter(); monthParam.setName("month"); monthParam.setValue("08"); Para...
@Override public void load() throws AccessDeniedException { super.load(); if(preferences.getBoolean("bookmarks.folder.monitor")) { try { monitor.register(folder, FILE_FILTER, this); } catch(IOException e) { throw new LocalAccessDeni...
@Test public void testLoad() throws Exception { final Local source = new Local(System.getProperty("java.io.tmpdir"), UUID.randomUUID().toString()); final MonitorFolderHostCollection c = new MonitorFolderHostCollection(source); c.load(); final Host bookmark = new Host(new TestProtocol...
public static <FnT extends DoFn<?, ?>> DoFnSignature getSignature(Class<FnT> fn) { return signatureCache.computeIfAbsent(fn, DoFnSignatures::parseSignature); }
@Test public void testUsageOfTimerDeclaredInSuperclass() throws Exception { thrown.expect(IllegalArgumentException.class); thrown.expectMessage("process"); thrown.expectMessage("declared in a different class"); thrown.expectMessage(DoFnDeclaringTimerAndCallback.TIMER_ID); thrown.expectMessage(not(...
@Override public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); WarMetaData warMetaData = deploymentUnit.getAttachment(WarMetaData.ATTACHMENT_KEY); if (warMetaData == null) { ...
@Test public void testDeployLoginConfigWithRealmAndNullAuthMethod() throws Exception { DeploymentUnit unit = mock(DeploymentUnit.class); doReturn(true).when(unit).hasAttachment(WarMetaData.ATTACHMENT_KEY); doReturn(new NonNullRealmNullEverythingElseWarMetaData()).when(unit).getAttachment(War...
Map<String, String> getShardIterators() { if (streamArn == null) { streamArn = getStreamArn(); } // Either return cached ones or get new ones via GetShardIterator requests. if (currentShardIterators.isEmpty()) { DescribeStreamResponse streamDescriptionResult ...
@Test void shouldReturnRootShardIterator() throws Exception { component.getConfiguration().setStreamIteratorType(StreamIteratorType.FROM_START); Ddb2StreamEndpoint endpoint = (Ddb2StreamEndpoint) component.createEndpoint("aws2-ddbstreams://myTable"); ShardIteratorHandler underTest = new Shar...
@Nullable public Float getFloatValue(@FloatFormat final int formatType, @IntRange(from = 0) final int offset) { if ((offset + getTypeLen(formatType)) > size()) return null; switch (formatType) { case FORMAT_SFLOAT -> { if (mValue[offset + 1] == 0x07 && mValue[offset] == (byte) 0xFE) return F...
@Test public void setValue_FLOAT_nan() { final MutableData data = new MutableData(new byte[4]); data.setValue(Float.NaN, Data.FORMAT_FLOAT, 0); final float value = data.getFloatValue(Data.FORMAT_FLOAT, 0); assertEquals(Float.NaN, value, 0.00); }
public void setContract(@Nullable Produce contract) { this.contract = contract; setStoredContract(contract); handleContractState(); }
@Test public void cabbageContractOnionHarvestableAndCabbageDiseased() { final long unixNow = Instant.now().getEpochSecond(); // Get the two allotment patches final FarmingPatch patch1 = farmingGuildPatches.get(Varbits.FARMING_4773); final FarmingPatch patch2 = farmingGuildPatches.get(Varbits.FARMING_4774); ...
@Override public BasicTypeDefine reconvert(Column column) { BasicTypeDefine.BasicTypeDefineBuilder builder = BasicTypeDefine.builder() .name(column.getName()) .nullable(column.isNullable()) .comment(column.getComment()) ...
@Test public void testReconvertLong() { Column column = PhysicalColumn.builder().name("test").dataType(BasicType.LONG_TYPE).build(); BasicTypeDefine typeDefine = DB2TypeConverter.INSTANCE.reconvert(column); Assertions.assertEquals(column.getName(), typeDefine.getName()); Assertions....
Optional<List<String>> dependencies(ConfigT configuration, PipelineOptions options) { return Optional.empty(); }
@Test public void testDependencies() { SchemaTransformProvider provider = new FakeTypedSchemaIOProvider(); Row inputConfig = Row.withSchema(provider.configurationSchema()) .withFieldValue("string_field", "field1") .withFieldValue("integer_field", Integer.valueOf(13)) ...
@SuppressWarnings({"dereference.of.nullable", "argument"}) public static PipelineResult run(DataTokenizationOptions options) { SchemasUtils schema = null; try { schema = new SchemasUtils(options.getDataSchemaPath(), StandardCharsets.UTF_8); } catch (IOException e) { LOG.error("Failed to retrie...
@Test public void testFileSystemIOReadCSV() throws IOException { PCollection<Row> jsons = fileSystemIORead(CSV_FILE_PATH, FORMAT.CSV); assertRows(jsons); testPipeline.run(); }
public static <T> MutationDetector forValueWithCoder(T value, Coder<T> coder) throws CoderException { if (value == null) { return noopMutationDetector(); } else { return new CodedValueMutationDetector<>(value, coder); } }
@Test public void testImmutableList() throws Exception { List<Integer> value = Lists.newLinkedList(Arrays.asList(1, 2, 3, 4)); MutationDetector detector = MutationDetectors.forValueWithCoder(value, IterableCoder.of(VarIntCoder.of())); detector.verifyUnmodified(); }
@Override public void preCommit(TransactionState txnState, List<TabletCommitInfo> finishedTablets, List<TabletFailInfo> failedTablets) throws TransactionException { Preconditions.checkState(txnState.getTransactionStatus() != TransactionStatus.COMMITTED); txnState.clearAut...
@Test public void testHasUnfinishedTablet() { LakeTable table = buildLakeTable(); DatabaseTransactionMgr databaseTransactionMgr = addDatabaseTransactionMgr(); LakeTableTxnStateListener listener = new LakeTableTxnStateListener(databaseTransactionMgr, table); TransactionCommitFailedExc...
@Override public void doFilter(HttpRequest request, HttpResponse response, FilterChain chain) { IdentityProvider provider = resolveProviderOrHandleResponse(request, response, CALLBACK_PATH); if (provider != null) { handleProvider(request, response, provider); } }
@Test public void fail_on_disabled_provider() throws Exception { when(request.getRequestURI()).thenReturn("/oauth2/callback/" + OAUTH2_PROVIDER_KEY); identityProviderRepository.addIdentityProvider(new FakeOAuth2IdentityProvider(OAUTH2_PROVIDER_KEY, false)); underTest.doFilter(request, response, chain); ...
@Override public void parse(InputStream stream, ContentHandler handler, Metadata metadata, ParseContext context) throws IOException, SAXException, TikaException { // Automatically detect the character encoding try (AutoDetectReader reader = new AutoDetectReader(CloseShieldInpu...
@Test public void testEBCDIC_CP500() throws Exception { Metadata metadata = new Metadata(); StringWriter writer = new StringWriter(); parser.parse(getResourceAsStream("/test-documents/english.cp500.txt"), new WriteOutContentHandler(writer), metadata, new ParseContext()); ...
@Override public void handleWayTags(int edgeId, EdgeIntAccess edgeIntAccess, ReaderWay way, IntsRef relationFlags) { PointList pointList = way.getTag("point_list", null); Double edgeDistance = way.getTag("edge_distance", null); if (pointList != null && edgeDistance != null && !pointList.isEm...
@Test public void testCurvature() { CurvatureCalculator calculator = new CurvatureCalculator(em.getDecimalEncodedValue(Curvature.KEY)); ArrayEdgeIntAccess intAccess = ArrayEdgeIntAccess.createFromBytes(em.getBytesForFlags()); int edgeId = 0; calculator.handleWayTags(edgeId, intAccess...
@VisibleForTesting public Supplier<PageFilter> compileFilter( SqlFunctionProperties sqlFunctionProperties, RowExpression filter, boolean isOptimizeCommonSubExpression, Optional<String> classNameSuffix) { return compileFilter(sqlFunctionProperties, emptyMap...
@Test public void testCommonSubExpressionInFilter() { PageFunctionCompiler functionCompiler = new PageFunctionCompiler(createTestMetadataManager(), 0); Supplier<PageFilter> pageFilter = functionCompiler.compileFilter(SESSION.getSqlFunctionProperties(), new SpecialFormExpression(AND, BIGINT, ADD...
@Nullable protected String findWebJarResourcePath(String pathStr) { Path path = Paths.get(pathStr); if (path.getNameCount() < 2) return null; String version = swaggerUiConfigProperties.getVersion(); if (version == null) return null; Path first = path.getName(0); Path rest = path.subpath(1, path.getNameCoun...
@Test void returNullWhenVersionIsNull() { String path = "swagger-ui/swagger-initializer.js"; swaggerUiConfigProperties.setVersion(null); String actual = abstractSwaggerResourceResolver.findWebJarResourcePath(path); assertTrue(Objects.isNull(actual)); }
@SuppressWarnings("OptionalGetWithoutIsPresent") // Enforced by type @Override public StreamsMaterializedWindowedTable windowed() { if (!windowInfo.isPresent()) { throw new UnsupportedOperationException("Table has non-windowed key"); } final WindowInfo wndInfo = windowInfo.get(); final Window...
@Test public void shouldReturnWindowedForSession() { // Given: givenWindowType(Optional.of(WindowType.SESSION)); // When: final StreamsMaterializedWindowedTable table = materialization.windowed(); // Then: assertThat(table, is(instanceOf(KsMaterializedSessionTable.class))); }
@Override public void isNotEqualTo(@Nullable Object expected) { super.isNotEqualTo(expected); }
@Test public void isNotEqualTo_WithoutToleranceParameter_FailEquals() { expectFailureWhenTestingThat( array(2.2f, 5.4f, POSITIVE_INFINITY, NEGATIVE_INFINITY, NaN, 0.0f, -0.0f)) .isNotEqualTo(array(2.2f, 5.4f, POSITIVE_INFINITY, NEGATIVE_INFINITY, NaN, 0.0f, -0.0f)); }
@Override public Space get() throws BackgroundException { try { final SpaceUsage usage = new DbxUserUsersRequests(session.getClient()).getSpaceUsage(); final SpaceAllocation allocation = usage.getAllocation(); if(allocation.isIndividual()) { long remaining...
@Test public void testGet() throws Exception { final Quota.Space quota = new DropboxQuotaFeature(session).get(); assertNotNull(quota); assertNotEquals(-1, quota.available, 0L); assertNotEquals(-1, quota.used, 0L); }
@Override public JobStatus getJobStatus() { return JobStatus.FAILING; }
@Test void testStateDoesNotExposeGloballyTerminalExecutionGraph() throws Exception { try (MockFailingContext ctx = new MockFailingContext()) { StateTrackingMockExecutionGraph meg = new StateTrackingMockExecutionGraph(); Failing failing = createFailingState(ctx, meg); // ...
@VisibleForTesting List<String> getIpAddressFields(Message message) { return message.getFieldNames() .stream() .filter(e -> (!enforceGraylogSchema || ipAddressFields.containsKey(e)) && !e.startsWith(Message.INTERNAL_FIELD_PREFIX)) .coll...
@Test public void testGetIpAddressFieldsEnforceGraylogSchema() { GeoIpResolverConfig conf = config.toBuilder().enforceGraylogSchema(true).build(); final GeoIpResolverEngine engine = new GeoIpResolverEngine(geoIpVendorResolverService, conf, s3GeoIpFileService, metricRegistry); Map<String, O...
public void clear() { while (!this.segments.isEmpty()) { RecycleUtil.recycle(this.segments.pollLast()); } this.size = this.firstOffset = 0; }
@Test public void simpleBenchmark() { int warmupRepeats = 10_0000; int repeats = 100_0000; double arrayDequeOps = 0; double segListOps = 0; // test ArrayDequeue { ArrayDeque<Integer> deque = new ArrayDeque<>(); System.gc(); // wram...
@Override public Object getInternalProperty(String key) { String value = getenv(key); if (StringUtils.isEmpty(value)) { value = getenv(StringUtils.toOSStyleKey(key)); } return value; }
@Test void testGetInternalProperty() { Map<String, String> map = new HashMap<>(); map.put(MOCK_KEY, MOCK_VALUE); EnvironmentConfiguration configuration = new EnvironmentConfiguration() { @Override protected String getenv(String key) { return map.get(ke...
@Override public Node upload(final Path file, final Local local, final BandwidthThrottle throttle, final StreamListener listener, final TransferStatus status, final ConnectionCallback callback) throws BackgroundException { final ThreadPool pool = ThreadPoolFactory.get("multipart", con...
@Test public void testTripleCryptUploadBelowMultipartSize() throws Exception { final SDSNodeIdProvider nodeid = new SDSNodeIdProvider(session); final SDSDirectS3UploadFeature feature = new SDSDirectS3UploadFeature(session, nodeid, new SDSDirectS3WriteFeature(session, nodeid)); final Path roo...
@POST @Path("{noteId}/revision") @ZeppelinApi public Response checkpointNote(String message, @PathParam("noteId") String noteId) throws IOException { LOGGER.info("Commit note by JSON {}", message); CheckpointNoteRequest request = GSON.fromJson(message, CheckpointNoteReques...
@Test void testCheckpointNote() throws IOException { LOG.info("Running testCheckpointNote"); String note1Id = null; try { String notePath = "note1"; note1Id = notebook.createNote(notePath, anonymous); //Add a paragraph notebook.processNote(note1Id, note -> { Paragraph p1 =...
public Future<KafkaVersionChange> reconcile() { return getVersionFromController() .compose(i -> getPods()) .compose(this::detectToAndFromVersions) .compose(i -> prepareVersionChange()); }
@Test public void testUpgradeWithOldPodsAndNewSps(VertxTestContext context) { String oldKafkaVersion = KafkaVersionTestUtils.PREVIOUS_KAFKA_VERSION; String oldInterBrokerProtocolVersion = KafkaVersionTestUtils.PREVIOUS_PROTOCOL_VERSION; String oldLogMessageFormatVersion = KafkaVersionTestUti...
public FEELFnResult<String> invoke(@ParameterName( "string" ) String string, @ParameterName( "match" ) String match) { if ( string == null ) { return FEELFnResult.ofError(new InvalidParametersEvent(Severity.ERROR, "string", "cannot be null")); } if ( match == null ) { ret...
@Test void invokeNull() { FunctionTestUtil.assertResultError(substringAfterFunction.invoke((String) null, null), InvalidParametersEvent.class); FunctionTestUtil.assertResultError(substringAfterFunction.invoke(null, "test"), InvalidParametersEvent.class); ...
public static boolean validateInstanceEndpoint(String endpoint) { return INST_ENDPOINT_PATTERN.matcher(endpoint).matches(); }
@Test public void testValidateInstanceEndpoint() { assertThat(NameServerAddressUtils.validateInstanceEndpoint(endpoint1)).isEqualTo(false); assertThat(NameServerAddressUtils.validateInstanceEndpoint(endpoint2)).isEqualTo(false); assertThat(NameServerAddressUtils.validateInstanceEndpoint(endp...
public void dropPackage(DropPackageRequest request) { boolean success = false; try { openTransaction(); MPackage proc = findMPackage(request.getCatName(), request.getDbName(), request.getPackageName()); pm.retrieve(proc); if (proc != null) { pm.deletePersistentAll(proc); } ...
@Test public void testDropPackage() throws Exception { objectStore.createDatabase(new DatabaseBuilder() .setName(DB1) .setDescription("description") .setLocation("locationurl") .build(conf)); AddPackageRequest pkg = new AddPackageRequest("hive", DB1, "pkg1", "us...
T getFunction(final List<SqlArgument> arguments) { // first try to get the candidates without any implicit casting Optional<T> candidate = findMatchingCandidate(arguments, false); if (candidate.isPresent()) { return candidate.get(); } else if (!supportsImplicitCasts) { throw createNoMatchin...
@Test public void shouldMatchGenericMethodWithMultipleGenerics() { // Given: final GenericType genericA = GenericType.of("A"); final GenericType genericB = GenericType.of("B"); givenFunctions( function(EXPECTED, -1, genericA, genericB) ); // When: final KsqlScalarFunction fun = ud...
@Override public BytesInput getBytes() { // The Page Header should include: blockSizeInValues, numberOfMiniBlocks, totalValueCount if (deltaValuesToFlush != 0) { flushBlockBuffer(); } return BytesInput.concat( config.toBytesInput(), BytesInput.fromUnsignedVarInt(totalValueCount),...
@Test public void shouldSkip() throws IOException { int[] data = new int[5 * blockSize + 1]; for (int i = 0; i < data.length; i++) { data[i] = i * 32; } writeData(data); reader = new DeltaBinaryPackingValuesReader(); reader.initFromPage(100, writer.getBytes().toInputStream()); for (i...
public RuntimeOptionsBuilder parse(String... args) { return parse(Arrays.asList(args)); }
@Test void set_strict_on_strict_aware_formatters() { RuntimeOptions options = parser .parse("--plugin", AwareFormatter.class.getName()) .build(); Plugins plugins = new Plugins(new PluginFactory(), options); plugins.setEventBusOnEventListenerPlugins(new TimeSer...
@Override public PGobject parse(final String value) { try { PGobject result = new PGobject(); result.setType("json"); result.setValue(value); return result; } catch (final SQLException ex) { throw new SQLWrapperException(ex); } ...
@Test void assertParse() { PGobject actual = new PostgreSQLJsonValueParser().parse("['input']"); assertThat(actual.getType(), is("json")); assertThat(actual.getValue(), is("['input']")); }
public static UConditional create( UExpression conditionExpr, UExpression trueExpr, UExpression falseExpr) { return new AutoValue_UConditional(conditionExpr, trueExpr, falseExpr); }
@Test public void equality() { ULiteral trueLit = ULiteral.booleanLit(true); ULiteral falseLit = ULiteral.booleanLit(false); ULiteral negOneLit = ULiteral.intLit(-1); ULiteral oneLit = ULiteral.intLit(1); new EqualsTester() .addEqualityGroup(UConditional.create(trueLit, negOneLit, oneLit))...
@Override public boolean alterOffsets(Map<String, String> connectorConfig, Map<Map<String, ?>, Map<String, ?>> offsets) { AbstractConfig config = new AbstractConfig(CONFIG_DEF, connectorConfig); String filename = config.getString(FILE_CONFIG); if (filename == null || filename.isEmpty()) { ...
@Test public void testAlterOffsetsIncorrectPartitionKey() { assertThrows(ConnectException.class, () -> connector.alterOffsets(sourceProperties, Collections.singletonMap( Collections.singletonMap("other_partition_key", FILENAME), Collections.singletonMap(POSITION_FIELD, 0L) ...
@Override public Set<Long> calculateUsers(DelegateExecution execution, String param) { Set<Long> deptIds = StrUtils.splitToLongSet(param); List<DeptRespDTO> depts = deptApi.getDeptList(deptIds); return convertSet(depts, DeptRespDTO::getLeaderUserId); }
@Test public void testCalculateUsers() { // 准备参数 String param = "1,2"; // mock 方法 DeptRespDTO dept1 = randomPojo(DeptRespDTO.class, o -> o.setLeaderUserId(11L)); DeptRespDTO dept2 = randomPojo(DeptRespDTO.class, o -> o.setLeaderUserId(22L)); when(deptApi.getDeptList(e...
public static boolean isMatchWithPrefix(final byte[] candidate, final byte[] expected, final int prefixLength) { if (candidate.length != expected.length) { return false; } if (candidate.length == 4) { final int mask = prefixLengthToIpV4Mask(prefixLeng...
@Test void shouldNotMatchIfNotAllBytesWithPrefixMatch() { final byte[] a = { 'a', 'b', 'c', 'd' }; final byte[] b = { 'a', 'b', 'd', 'd' }; assertFalse(isMatchWithPrefix(a, b, 24)); }
@Override public String toString() { return toString(false); }
@Test public void testUnsupportedVersionsToString() { NodeApiVersions versions = new NodeApiVersions(new ApiVersionCollection(), Collections.emptyList(), false); StringBuilder bld = new StringBuilder(); String prefix = "("; for (ApiKeys apiKey : ApiKeys.clientApis()) { bl...
public BackgroundException map(HttpResponse response) throws IOException { final S3ServiceException failure; if(null == response.getEntity()) { failure = new S3ServiceException(response.getStatusLine().getReasonPhrase()); } else { EntityUtils.updateEntity(response...
@Test public void testEmpty() { assertEquals("Listing directory / failed.", new S3ExceptionMappingService().map("Listing directory {0} failed", new ServiceException(), new Path("/", EnumSet.of(Path.Type.directory))).getMessage()); }
public HttpHost[] getHttpHosts() { return httpHosts; }
@Test public void setsSchemePortAndHost() { EsConfig esConfig = new EsConfig("https://somehost:1234"); HttpHost[] httpHosts = esConfig.getHttpHosts(); assertEquals(1, httpHosts.length); assertEquals("https", httpHosts[0].getSchemeName()); assertEquals(1234, httpHosts[0].getPo...
@Override public ContainersInfo getContainers(HttpServletRequest req, HttpServletResponse res, String appId, String appAttemptId) { // Check that the appId/appAttemptId format is accurate try { RouterServerUtil.validateApplicationId(appId); RouterServerUtil.validateApplicationAttemptId(appA...
@Test public void testGetContainersWrongFormat() throws Exception { ApplicationId appId = ApplicationId.newInstance(Time.now(), 1); ApplicationAttemptId appAttempt = ApplicationAttemptId.newInstance(appId, 1); // Test Case 1: appId is wrong format, appAttemptId is accurate. LambdaTestUtils.intercept(...
public static int findNthByte(byte [] utf, int start, int length, byte b, int n) { int pos = -1; int nextStart = start; for (int i = 0; i < n; i++) { pos = findByte(utf, nextStart, length, b); if (pos < 0) { return pos; } nextStart = pos + 1; } return pos; }
@Test public void testFindNthByte() { byte[] data = "Hello, world!".getBytes(); assertEquals("Did not find 2nd occurrence of character 'l'", 3, UTF8ByteArrayUtils.findNthByte(data, 0, data.length, (byte) 'l', 2)); assertEquals("4th occurrence of character 'l' does not exist", -1, UTF8ByteA...
public static void main(String[] args) { /* * Getting bar series */ BarSeries series = CsvBarsLoader.loadAppleIncSeries(); /* * Creating indicators */ // Close price ClosePriceIndicator closePrice = new ClosePriceIndicator(series); EM...
@Test public void test() { IndicatorsToChart.main(null); }
@Override public void assign(Object o) { if (o == null) { predicate = null; } else if (o instanceof Predicate) { predicate = (Predicate)o; } else if (o instanceof PredicateFieldValue) { predicate = ((PredicateFieldValue)o).predicate; } else { ...
@Test public void requireThatBadAssignThrows() { try { new PredicateFieldValue().assign(new Object()); fail(); } catch (IllegalArgumentException e) { assertEquals("Expected com.yahoo.document.datatypes.PredicateFieldValue, got java.lang.Object.", ...
@Override public void close() throws IOException { super.close(); closed = true; if (channel != null) { channel.close(); } }
@Test public void testClose() throws Exception { BlobId blobId = BlobId.fromGsUtilUri("gs://bucket/path/to/closed.dat"); SeekableInputStream closed = new GCSInputStream(storage, blobId, null, gcpProperties, MetricsContext.nullMetrics()); closed.close(); assertThatThrownBy(() -> closed.seek(0))...
@Override public boolean test(Pair<Point, Point> pair) { if (timeDeltaIsSmall(pair.first().time(), pair.second().time())) { return distIsSmall(pair); } else { /* * reject points with large time deltas because we don't want to rely on a numerically *...
@Test public void testCase3() { DistanceFilter filter = newTestFilter(); LatLong position1 = new LatLong(0.0, 0.0); double tooFarInNm = MAX_DISTANCE_IN_FEET * 3.0 / Spherical.feetPerNM(); Point p1 = new PointBuilder() .latLong(position1) .time(Instant.EPOCH...
public static DataConverter toDataConverter(LogicalType logicalType) { return logicalType.accept(new LogicalTypeToDataConverter()); }
@Test void testLogicalTypeToDataConverter() { PythonTypeUtils.DataConverter converter = PythonTypeUtils.toDataConverter(new IntType()); GenericRowData data = new GenericRowData(1); data.setField(0, 10); Object externalData = converter.toExternal(data, 0); assertThat(external...
public String destinationURL(File rootPath, File file) { return destinationURL(rootPath, file, getSrc(), getDest()); }
@Test public void shouldProvideAppendFilePathToDestWhenUsingDoubleStart() { ArtifactPlan artifactPlan = new ArtifactPlan(ArtifactPlanType.file, "**/*/a.log", "logs"); assertThat(artifactPlan.destinationURL(new File("pipelines/pipelineA"), new File("pipelines/pipelineA/test/a/b/a.log")))....
@Override public Span error(Throwable throwable) { synchronized (state) { state.error(throwable); } return this; }
@Test void error() { RuntimeException error = new RuntimeException("this cake is a lie"); span.error(error); span.flush(); assertThat(spans.get(0).error()) .isSameAs(error); assertThat(spans.get(0).tags()) .doesNotContainKey("error"); }
@Override public Collection<DatabasePacket> execute() throws SQLException { switch (packet.getType()) { case PREPARED_STATEMENT: connectionSession.getServerPreparedStatementRegistry().removePreparedStatement(packet.getName()); break; case PORTAL: ...
@Test void assertExecuteClosePortal() throws SQLException { when(packet.getType()).thenReturn(PostgreSQLComClosePacket.Type.PORTAL); String portalName = "C_1"; when(packet.getName()).thenReturn(portalName); PostgreSQLComCloseExecutor closeExecutor = new PostgreSQLComCloseExecutor(por...
public static Optional<String> getDataSourceNameByDataSourceUnitNode(final String path) { Pattern pattern = Pattern.compile(getMetaDataNode() + DATABASE_DATA_SOURCES_NODE + DATA_SOURCE_UNITS_NODE + DATA_SOURCE_SUFFIX, Pattern.CASE_INSENSITIVE); Matcher matcher = pattern.matcher(path); return mat...
@Test void assertGetDataSourceNameByDataSourceUnitNode() { Optional<String> actual = DataSourceMetaDataNode.getDataSourceNameByDataSourceUnitNode("/metadata/logic_db/data_sources/units/foo_ds"); assertTrue(actual.isPresent()); assertThat(actual.get(), is("foo_ds")); }
@Override public KeyValue<KOutT, GenericRow> transform(final KInT key, final GenericRow value) { return KeyValue.pair( keyDelegate.transform( key, value, context.orElseThrow(() -> new IllegalStateException("Not initialized")) ), valueDelegate.transform( ...
@Test public void shouldReturnValueFromInnerTransformer() { // When: final KeyValue<String, GenericRow> result = ksTransformer.transform(KEY, VALUE); // Then: assertThat(result, is(KeyValue.pair(RESULT_KEY, RESULT_VALUE))); }
public Span nextSpan(Message message) { TraceContextOrSamplingFlags extracted = extractAndClearTraceIdProperties(processorExtractor, message, message); Span result = tracer.nextSpan(extracted); // Processor spans use the normal sampler. // When an upstream context was not present, lookup keys are unl...
@Test void nextSpan_should_retain_baggage_headers() throws JMSException { message.setStringProperty(BAGGAGE_FIELD_KEY, ""); jmsTracing.nextSpan(message); assertThat(message.getStringProperty(BAGGAGE_FIELD_KEY)).isEmpty(); }
static InitWriterConfig fromMap(Map<String, String> map) { Map<String, String> envMap = new HashMap<>(map); envMap.keySet().retainAll(InitWriterConfig.keyNames()); Map<String, Object> generatedMap = ConfigParameter.define(envMap, CONFIG_VALUES); return new InitWriterConfig(generatedMap...
@Test public void testFromMapMissingNodeNameThrows() { Map<String, String> envVars = new HashMap<>(ENV_VARS); envVars.remove(InitWriterConfig.NODE_NAME.key()); assertThrows(InvalidConfigurationException.class, () -> InitWriterConfig.fromMap(envVars)); }
public static Object get(Object object, int index) { if (index < 0) { throw new IndexOutOfBoundsException("Index cannot be negative: " + index); } if (object instanceof Map) { Map map = (Map) object; Iterator iterator = map.entrySet().iterator(); r...
@Test void testGetArray6() { assertEquals(1, CollectionUtils.get(new int[] {1, 2}, 0)); assertEquals(2, CollectionUtils.get(new int[] {1, 2}, 1)); }
@Override public ModuleState build() { ModuleState moduleState = new ModuleState(com.alibaba.nacos.api.common.Constants.Config.CONFIG_MODULE); moduleState.newState(Constants.DATASOURCE_PLATFORM_PROPERTY_STATE, DatasourcePlatformUtil.getDatasourcePlatform("")); moduleState.newState(C...
@Test void testBuild() { ModuleState actual = new ConfigModuleStateBuilder().build(); Map<String, Object> states = actual.getStates(); assertEquals(PersistenceConstant.DERBY, states.get(Constants.DATASOURCE_PLATFORM_PROPERTY_STATE)); assertTrue((Boolean) states.get(Constants.NACOS_PL...
@SuppressWarnings({"unchecked", "UnstableApiUsage"}) @Override public <T extends Statement> ConfiguredStatement<T> inject( final ConfiguredStatement<T> statement) { if (!(statement.getStatement() instanceof DropStatement)) { return statement; } final DropStatement dropStatement = (DropState...
@Test public void shouldNotThrowIfSchemaIsMissing() throws IOException, RestClientException { // Given: when(topic.getKeyFormat()) .thenReturn(KeyFormat.of(FormatInfo.of( FormatFactory.AVRO.name(), ImmutableMap.of(ConnectProperties.FULL_SCHEMA_NAME, "foo")), SerdeFeatures.of(),...
@Override public long getLong(int index) { checkIndex(index, 8); return _getLong(index); }
@Test public void testGetLongAfterRelease() { assertThrows(IllegalReferenceCountException.class, new Executable() { @Override public void execute() { releasedBuffer().getLong(0); } }); }
public RuntimeOptionsBuilder parse(String... args) { return parse(Arrays.asList(args)); }
@Test void assigns_glue() { RuntimeOptions options = parser .parse("--glue", "somewhere") .build(); assertThat(options.getGlue(), contains(uri("classpath:/somewhere"))); }
public static Map<String, String> applyOverrides( final Map<String, String> props, final Properties overrides ) { final Map<String, String> overridesMap = asMap(overrides); final HashMap<String, String> merged = new HashMap<>(props); merged.putAll(filterByKey(overridesMap, NOT_BLACKLISTED)); ...
@Test public void shouldFilterBlackListedFromOverrides() { Stream.of("java.", "os.", "sun.", "user.", "line.separator", "path.separator", "file.separator") .forEach(blackListed -> { // Given: final Properties overrides = properties( blackListed + "props.should.be.filtered...
public static void updateInstanceMetadata(Instance instance, InstanceMetadata metadata) { instance.setEnabled(metadata.isEnabled()); instance.setWeight(metadata.getWeight()); for (Map.Entry<String, Object> entry : metadata.getExtendData().entrySet()) { instance.getMetadata().put(entr...
@Test void testUpdateInstanceMetadata() { InstanceMetadata metaData = new InstanceMetadata(); Map<String, Object> extendData = new ConcurrentHashMap<>(1); extendData.put("k1", "v1"); extendData.put("k2", "v2"); metaData.setExtendData(extendData); metaData.setEnabled(t...
@Override public int compareTo(Migration that) { return COMPARATOR.compare(this, that); }
@Test public void testCompareTo() { final MigrationA a = new MigrationA(); final MigrationA aa = new MigrationA(); final MigrationB b = new MigrationB(); // same timestamp as A final MigrationC c = new MigrationC(); // oldest timestamp assertThat(a.compareTo(b)).isLessThan(0...
public static void verifyIncrementPubContent(String content) { if (content == null || content.length() == 0) { throw new IllegalArgumentException("publish/delete content can not be null"); } for (int i = 0; i < content.length(); i++) { char c = content.charAt(i);...
@Test void testVerifyIncrementPubContent() { String content = "aabbb"; ContentUtils.verifyIncrementPubContent(content); }
protected boolean configDevice(DeviceId deviceId) { // Returns true if config was successful, false if not and a clean up is // needed. final Device device = deviceService.getDevice(deviceId); if (device == null || !device.is(IntProgrammable.class)) { return true; } ...
@Test public void testConfigSinkDevice() { reset(deviceService, hostService); Device device = getMockDevice(true, DEVICE_ID); IntProgrammable intProg = getMockIntProgrammable(false, false, true, false); setUpDeviceTest(device, intProg, true, true); expect(intProg.setSinkPort(...
@Override public Optional<Integer> partitionFor(Facility facility) { return Optional.ofNullable(facilityToPartitionMapping.get(facility)); }
@Test public void partitionForWorksForEveryFacility() { FacilityPartitionMapping mapping = sampleMapping(); for (Facility facility : Facility.values()) { Optional<Integer> partition = mapping.partitionFor(facility); assertTrue(partition.get() >= 0, "All partition numbers s...
@VisibleForTesting boolean checkAndDeleteCgroup(File cgf) throws InterruptedException { boolean deleted = false; // FileInputStream in = null; try (FileInputStream in = new FileInputStream(cgf + "/tasks")) { if (in.read() == -1) { /* * "tasks" file is empty, sleep a bit more and the...
@Test public void testcheckAndDeleteCgroup() throws Exception { CgroupsLCEResourcesHandler handler = new CgroupsLCEResourcesHandler(); handler.setConf(new YarnConfiguration()); handler.initConfig(); FileUtils.deleteQuietly(cgroupDir); // Test 0 // tasks file not present, should return false ...
public static boolean acceptEndpoint(String endpointUrl) { return endpointUrl != null && endpointUrl.matches(ENDPOINT_PATTERN_STRING); }
@Test void testAcceptEndpoint() { AsyncTestSpecification specification = new AsyncTestSpecification(); KafkaMessageConsumptionTask task = new KafkaMessageConsumptionTask(specification); assertTrue(KafkaMessageConsumptionTask.acceptEndpoint("kafka://localhost/testTopic")); assertTrue(KafkaMe...
@Override public Map<Errors, Integer> errorCounts() { HashMap<Errors, Integer> counts = new HashMap<>(); data.groups().forEach( group -> updateErrorCounts(counts, Errors.forCode(group.errorCode())) ); return counts; }
@Test void testErrorCounts() { Errors e = Errors.INVALID_GROUP_ID; int errorCount = 2; ConsumerGroupDescribeResponseData data = new ConsumerGroupDescribeResponseData(); for (int i = 0; i < errorCount; i++) { data.groups().add( new ConsumerGroupDescribeResp...
@VisibleForTesting static String parseAcceptHeader(HttpServletRequest request) { String format = request.getHeader(HttpHeaders.ACCEPT); return format != null && format.contains(FORMAT_JSON) ? FORMAT_JSON : FORMAT_XML; }
@Test public void testParseHeaders() throws Exception { HashMap<String, String> verifyMap = new HashMap<String, String>(); verifyMap.put("text/plain", ConfServlet.FORMAT_XML); verifyMap.put(null, ConfServlet.FORMAT_XML); verifyMap.put("text/xml", ConfServlet.FORMAT_XML); verifyMap.put("application...
public Collection<String> getAllMetricNames() { Set<String> names = new HashSet<>(); for (Identifier id : values.keySet()) { names.add(id.getName()); } return names; }
@Test final void testGetAllMetricNames() { twoMetricsUniqueDimensions(); Collection<String> names = bucket.getAllMetricNames(); assertEquals(2, names.size()); assertTrue(names.contains("nalle")); assertTrue(names.contains("nalle2")); }
public static MacAddress valueOf(final String address) { if (!isValid(address)) { throw new IllegalArgumentException( "Specified MAC Address must contain 12 hex digits" + " separated pairwise by :'s."); } final String[] elements = addre...
@Test(expected = IllegalArgumentException.class) public void testValueOfInvalidString() throws Exception { MacAddress.valueOf(INVALID_STR); }
@Override public Messages process(Messages messages) { try (Timer.Context ignored = executionTime.time()) { final State latestState = stateUpdater.getLatestState(); if (latestState.enableRuleMetrics()) { return process(messages, new RuleMetricsListener(metricRegistry)...
@Test public void testMatchEitherStopsIfNoRuleMatched() { final RuleService ruleService = mock(MongoDbRuleService.class); when(ruleService.loadAll()).thenReturn(ImmutableList.of(RULE_TRUE, RULE_FALSE, RULE_ADD_FOOBAR)); final PipelineService pipelineService = mock(MongoDbPipelineService.cla...
public Map<String, ByteString> getEntries() { return map; }
@Test public void constructor_processes_entries() { SensorCacheEntry entry1 = SensorCacheEntry.newBuilder().setKey("key1").setData(ByteString.copyFrom("data1", UTF_8)).build(); SensorCacheEntry entry2 = SensorCacheEntry.newBuilder().setKey("key2").setData(ByteString.copyFrom("data2", UTF_8)).build(); Sen...
@Override public <K, V> void forward(final K key, final V value) { throw new StreamsException(EXPLANATION); }
@Test public void shouldThrowOnForwardWithTo() { assertThrows(StreamsException.class, () -> context.forward("key", "value", To.all())); }
public void evaluate(AuthenticationContext context) { if (context == null) { return; } this.authenticationStrategy.evaluate(context); }
@Test public void evaluate3() { if (MixAll.isMac()) { return; } User user = User.of("test", "test"); this.authenticationMetadataManager.createUser(user); DefaultAuthenticationContext context = new DefaultAuthenticationContext(); context.setRpcCode("11"); ...
@Override public void updateTask(Task task) { Map.Entry<String, Long> taskInDb = getTaskChecksumAndUpdateTime(task.getTaskId()); String taskCheckSum = computeChecksum(task); if (taskInDb != null) { long updateInterval = task.getUpdateTime() - taskInDb.getValue(); if (taskCheckSum.equals(taskIn...
@Test public void testUpdateTaskMissingChecksum() { executionDao.updateTask(task); Task actual = maestroExecutionDao.getTask(TEST_TASK_ID); assertNull(actual.getWorkerId()); assertEquals(0, actual.getPollCount()); assertEquals(0, actual.getUpdateTime()); // should update DB if there is no che...
@Override public KeyVersion createKey(final String name, final byte[] material, final Options options) throws IOException { return doOp(new ProviderCallable<KeyVersion>() { @Override public KeyVersion call(KMSClientProvider provider) throws IOException { return provider.createKey(name, m...
@Test public void testClientRetriesWithAuthenticationExceptionWrappedinIOException() throws Exception { Configuration conf = new Configuration(); conf.setInt( CommonConfigurationKeysPublic.KMS_CLIENT_FAILOVER_MAX_RETRIES_KEY, 3); KMSClientProvider p1 = mock(KMSClientProvider.class); when...
@Override public PathAttributes find(final Path file, final ListProgressListener listener) throws BackgroundException { if(file.isRoot()) { return PathAttributes.EMPTY; } if(new DefaultPathContainerService().isContainer(file)) { return PathAttributes.EMPTY; } ...
@Test public void testDuplicatesWithSameName() throws Exception { final DriveFileIdProvider fileid = new DriveFileIdProvider(session); final Path folder = new DriveDirectoryFeature(session, fileid).mkdir( new Path(DriveHomeFinderService.MYDRIVE_FOLDER, new AlphanumericRandomStringSer...