focal_method
stringlengths
13
60.9k
test_case
stringlengths
25
109k
static CompletableFuture<DLInputStream> openReaderAsync(DistributedLogManager distributedLogManager) { return distributedLogManager.openAsyncLogReader(DLSN.InitialDLSN) .thenApply(r -> new DLInputStream(distributedLogManager, r)); }
@Test public void openAsyncLogReaderFailed() { when(dlm.openAsyncLogReader(any(DLSN.class))).thenReturn(failedFuture(new Exception("Open reader was failed"))); try { DLInputStream.openReaderAsync(dlm).get(); } catch (Exception e) { assertEquals(e.getCause().getMessag...
@Override public T add(K name, V value) { throw new UnsupportedOperationException("read only"); }
@Test public void testAddStringValue() { assertThrows(UnsupportedOperationException.class, new Executable() { @Override public void execute() { HEADERS.add("name", "value"); } }); }
public final boolean schedule(Runnable task, long delay, TimeUnit unit) { checkNotNull(task); checkNotNegative(delay, "delay"); checkNotNull(unit); ScheduledTask scheduledTask = new ScheduledTask(this); scheduledTask.task = task; long deadlineNanos = nanoClock.nanoTime()...
@Test public void test_schedule() { Task task = new Task(); reactor.offer(() -> reactor.eventloop.schedule(task, 1, SECONDS)); assertTrueEventually(() -> assertEquals(1, task.count.get())); }
static Result coerceUserList( final Collection<Expression> expressions, final ExpressionTypeManager typeManager ) { return coerceUserList(expressions, typeManager, Collections.emptyMap()); }
@Test public void shouldNotCoerceMapOfIncompatibleKeyLiterals() { // Given: final ImmutableList<Expression> expressions = ImmutableList.of( new CreateMapExpression( ImmutableMap.of( new IntegerLiteral(10), new IntegerLiteral(289476) ) ), ...
@Override public boolean unregister(final Application application) { return SMAppService.loginItemServiceWithIdentifier(application.getIdentifier()).unregisterAndReturnError(null); }
@Test public void testUnregister() { assumeFalse(Factory.Platform.osversion.matches("(10|11|12)\\..*")); assertFalse(new SMAppServiceApplicationLoginRegistry().unregister( new Application("bundle.helper"))); }
public static void doRegister(final String json, final String url, final String type, final String accessToken) throws IOException { if (StringUtils.isBlank(accessToken)) { LOGGER.error("{} client register error accessToken is null, please check the config : {} ", type, json); return; ...
@Test public void testDoRegisterWhenSuccess() throws IOException { when(okHttpTools.post(url, json)).thenReturn("success"); Headers headers = new Headers.Builder().add(Constants.X_ACCESS_TOKEN, accessToken).build(); when(okHttpTools.post(url, json, headers)).thenReturn("success"); t...
@Override public boolean processRow( StepMetaInterface smi, StepDataInterface sdi ) throws KettleException { Preconditions.checkArgument( first, BaseMessages.getString( PKG, "BaseStreamStep.ProcessRowsError" ) ); Preconditions.checkNotNull( source ); Preconditions.checkNotNull( window ); try { ...
@Test public void testAlwaysCloses() throws KettleException { when( streamWindow.buffer( any() ) ).thenThrow( new IllegalStateException( "run for your life!!!" ) ); try { baseStreamStep.processRow( meta, stepData ); } catch ( IllegalStateException ignored ) { } verify( streamSource ).close()...
public FallbackPath getFallback() { return fallback; }
@Test public void testFallbackPath() { ShenyuConfig.FallbackPath fallback = config.getFallback(); fallback.setEnabled(true); fallback.setPaths(Collections.emptyList()); List<String> paths = fallback.getPaths(); Boolean enabled = fallback.getEnabled(); notEmptyElemen...
public List<Partition> getPartitions(Connection connection, Table table) { JDBCTable jdbcTable = (JDBCTable) table; String query = getPartitionQuery(table); try (PreparedStatement ps = connection.prepareStatement(query)) { ps.setString(1, jdbcTable.getDbName()); ps.setStr...
@Test public void testGetPartitions_NonPartitioned() throws DdlException { JDBCMetadata jdbcMetadata = new JDBCMetadata(properties, "catalog", dataSource); List<Column> columns = Arrays.asList(new Column("d", Type.VARCHAR)); JDBCTable jdbcTable = new JDBCTable(100000, "tbl1", columns, Lists....
@ExecuteOn(TaskExecutors.IO) @Get(uri = "/flows/{namespace}/{flowId}") @Operation(tags = {"Executions"}, summary = "Get flow information's for an execution") public FlowForExecution getFlowForExecution( @Parameter(description = "The namespace of the flow") @PathVariable String namespace, @Pa...
@SuppressWarnings("DataFlowIssue") @Test void getFlowForExecution() { FlowForExecution result = client.toBlocking().retrieve( GET("/api/v1/executions/flows/io.kestra.tests/full"), FlowForExecution.class ); assertThat(result, notNullValue()); assertThat(re...
public void setSimpleLoadBalancerState(SimpleLoadBalancerState state) { _watcherManager.updateWatcher(state, this::doRegisterLoadBalancerState); doRegisterLoadBalancerState(state, null); state.register(new SimpleLoadBalancerStateListener() { @Override public void onStrategyAdded(String se...
@Test(dataProvider = "nonDualReadD2ClientJmxManagers") public void testSetSimpleLBStateListenerUpdateClusterInfo(String prefix, D2ClientJmxManager.DiscoverySourceType sourceType, Boolean isDualReadLB) { D2ClientJmxManagerFixture fixture = new D2ClientJmxManagerFixture(); D2ClientJmxManager d2ClientJmx...
protected String getDumpPath() { final String dumpPath = url.getParameter(DUMP_DIRECTORY); if (StringUtils.isEmpty(dumpPath)) { return USER_HOME; } final File dumpDirectory = new File(dumpPath); if (!dumpDirectory.exists()) { if (dumpDirectory.mkdirs()) { ...
@Test void jStackDumpTest_dumpDirectoryNotExists_canBeCreated() { final String dumpDirectory = UUID.randomUUID().toString(); URL url = URL.valueOf("dubbo://admin:hello1234@10.20.130.230:20880/context/path?dump.directory=" + dumpDirectory + "&version=1.0.0&application...
@Override public AclConfig getAllAclConfig() { return aclPlugEngine.getAllAclConfig(); }
@Test public void getAllAclConfigTest() { PlainAccessValidator plainAccessValidator = new PlainAccessValidator(); AclConfig aclConfig = plainAccessValidator.getAllAclConfig(); Assert.assertEquals(aclConfig.getGlobalWhiteAddrs().size(), 4); Assert.assertEquals(aclConfig.getPlainAccess...
public static Set<Result> anaylze(String log) { Set<Result> results = new HashSet<>(); for (Rule rule : Rule.values()) { Matcher matcher = rule.pattern.matcher(log); if (matcher.find()) { results.add(new Result(rule, log, matcher)); } } ...
@Test public void tooOldJava2() throws IOException { CrashReportAnalyzer.Result result = findResultByRule( CrashReportAnalyzer.anaylze(loadLog("/crash-report/too_old_java2.txt")), CrashReportAnalyzer.Rule.TOO_OLD_JAVA); assertEquals("52", result.getMatcher().group("ex...
@Override public void run() { try { PushDataWrapper wrapper = generatePushData(); ClientManager clientManager = delayTaskEngine.getClientManager(); for (String each : getTargetClientIds()) { Client client = clientManager.getClient(each); if...
@Test void testRunFailedWithHandleException() { PushDelayTask delayTask = new PushDelayTask(service, 0L); PushExecuteTask executeTask = new PushExecuteTask(service, delayTaskExecuteEngine, delayTask); when(delayTaskExecuteEngine.getServiceStorage()).thenThrow(new RuntimeException()); ...
@VisibleForTesting static void checkSamePrefixedProviders( Map<String, DelegationTokenProvider> providers, Set<String> warnings) { Set<String> providerPrefixes = new HashSet<>(); for (String name : providers.keySet()) { String[] split = name.split("-"); if (!provi...
@Test public void checkSamePrefixedProvidersShouldNotGiveErrorsWhenNoSamePrefix() { Map<String, DelegationTokenProvider> providers = new HashMap<>(); providers.put("s3-hadoop", new TestDelegationTokenProvider()); Set<String> warnings = new HashSet<>(); DefaultDelegationTokenManager.c...
public void start() { commandTopic.start(); }
@Test public void shouldStartCommandTopicOnStart() { // When: commandStore.start(); // Then: verify(commandTopic).start(); }
public String generateQualityGate(Metric.Level level) { return qualityGateTemplates.get(level); }
@Test public void generate_quality_gate() { initSvgGenerator(); String result = underTest.generateQualityGate(ERROR); checkQualityGate(result, ERROR); }
public abstract Duration parse(String text);
@Test public void testLongSeconds() { Assert.assertEquals(Duration.ofSeconds(1), DurationStyle.LONG.parse("1 seconds")); Assert.assertEquals(Duration.ofSeconds(10), DurationStyle.LONG.parse("10 seconds")); Assert.assertThrows(DateTimeException.class, () -> DurationStyle.LONG.parse("a seconds...
public static Builder custom() { return new Builder(); }
@Test public void builderTimeoutIsNull() throws Exception { exception.expect(NullPointerException.class); exception.expectMessage(TIMEOUT_DURATION_MUST_NOT_BE_NULL); RateLimiterConfig.custom() .timeoutDuration(null); }
@Override public String doSharding(final Collection<String> availableTargetNames, final PreciseShardingValue<Comparable<?>> shardingValue) { ShardingSpherePreconditions.checkNotNull(shardingValue.getValue(), NullShardingValueException::new); return doSharding(availableTargetNames, Range.singleton(sh...
@Test void assertRangeDoShardingByQuarter() { Collection<String> actual = shardingAlgorithmByQuarter.doSharding(availableTablesForQuarterDataSources, createShardingValue("2019-10-15 10:59:08", "2020-04-08 10:59:08")); assertThat(actual.size(), is(3)); }
public static String lowercaseFirstLetter(String string) { if (string == null || string.length() == 0) { return string; } else { return string.substring(0, 1).toLowerCase() + string.substring(1); } }
@Test public void testLowercaseFirstLetter() { assertEquals(lowercaseFirstLetter(""), ("")); assertEquals(lowercaseFirstLetter("A"), ("a")); assertEquals(lowercaseFirstLetter("AA"), ("aA")); assertEquals(lowercaseFirstLetter("a"), ("a")); assertEquals(lowercaseFirstLetter("aB...
@SuppressWarnings("unchecked") public static <T> Map<String, T> getEnumConstants(Class<T> type) { return Arrays.stream(type.getDeclaredFields()) .filter(field -> field.getType() == type && (field.getModifiers() & ENUM_CONSTANT_MASK) == ENUM_CONSTANT_MASK) ...
@Test public void test_getEnumConstants() { assertThat(FieldUtils.getEnumConstants(EnumLikeClass.class)) .containsExactlyInAnyOrderEntriesOf(Map.of( "VALUE1", EnumLikeClass.VALUE1, "VALUE2", EnumLikeClass.VALUE2, "VALUE3...
public RestOpenApiProcessor(Map<String, Object> parameters, RestConfiguration configuration) { this.configuration = configuration; this.support = new RestOpenApiSupport(); this.openApiConfig = new BeanConfig(); if (parameters == null) { parame...
@Test public void testRestOpenApiProcessor() throws Exception { CamelContext context = new DefaultCamelContext(); context.addRoutes(new RouteBuilder() { @Override public void configure() { rest().get("/foo").description("Foo endpoint").to("mock:foo") ...
@Override public void upgrade() { if (clusterConfigService.get(V20230531135500_MigrateRemoveObsoleteItemsFromGrantsCollection.MigrationCompleted.class) != null) { return; } final Set<String> names = new HashSet(); mongoConnection.getMongoDatabase().listCollectionNames()....
@Test @MongoDBFixtures("V20230531135500_MigrateRemoveObsoleteItemsFromGrantsCollectionTest_noElements.json") void notMigratingAnythingIfNoElementsArePresent() { assertThat(this.collection.countDocuments()).isEqualTo(9); this.migration.upgrade(); assertThat(migrationCompleted()).isNotNu...
protected static byte rho(long x, int k) { return (byte) (Long.numberOfLeadingZeros((x << k) | (1 << (k - 1))) + 1); }
@Test public void testRho() { assertEquals(17, LogLog.rho(0, 16)); assertEquals(16, LogLog.rho(1, 16)); assertEquals(15, LogLog.rho(2, 16)); assertEquals(1, LogLog.rho(0x00008000, 16)); assertEquals(23, LogLog.rho(0, 10)); assertEquals(22, LogLog.rho(1, 10)); ...
public synchronized OutputStream open() { try { close(); fileOutputStream = new FileOutputStream(file, true); } catch (FileNotFoundException e) { throw new RuntimeException("Unable to open output stream", e); } return fileOutputStream; }
@Test public void requireThatFileIsReopened() throws IOException { FileLogTarget logTarget = new FileLogTarget(File.createTempFile("logfile", ".log")); OutputStream out1 = logTarget.open(); assertNotNull(out1); OutputStream out2 = logTarget.open(); assertNotNull(out2); ...
@Override public String getConsumerMethodProperty(String service, String method, String key) { return config.getProperty(DynamicConfigKeyHelper.buildConsumerMethodProKey(service, method, key), DynamicHelper.DEFAULT_DYNAMIC_VALUE); }
@Test public void getConsumerMethodProperty() { }
@Udf(description = "When reducing an array, " + "the reduce function must have two arguments. " + "The two arguments for the reduce function are in order: " + "the state and the array item. " + "The final state is returned." ) public <T,S> S reduceArray( @UdfParameter(description = "Th...
@Test public void shouldReduceArray() { assertThat(udf.reduceArray( ImmutableList.of(), "", biFunction1()), is("")); assertThat(udf.reduceArray(ImmutableList.of(), "answer", biFunction1()), is("answer")); assertThat(udf.reduceArray(ImmutableList.of(2, 3, 4, 4, 1000), "", biFunction1()), is("evenoddeveneve...
@Override public boolean shouldCareAbout(Object entity) { return securityConfigClasses.stream().anyMatch(aClass -> aClass.isAssignableFrom(entity.getClass())); }
@Test public void shouldCareAboutRolesConfigChange() { SecurityConfigChangeListener securityConfigChangeListener = new SecurityConfigChangeListener() { @Override public void onEntityConfigChange(Object entity) { } }; assertThat(securityConfigChangeListene...
public Collection<String> getUsedConversionClasses(Schema schema) { Collection<String> result = new HashSet<>(); for (Conversion<?> conversion : getUsedConversions(schema)) { result.add(conversion.getClass().getCanonicalName()); } return result; }
@Test void getUsedConversionClassesForNullableLogicalTypesInNestedRecord() throws Exception { SpecificCompiler compiler = createCompiler(); final Schema schema = new Schema.Parser().parse( "{\"type\":\"record\",\"name\":\"NestedLogicalTypesRecord\",\"namespace\":\"org.apache.avro.codegentest.testdata...
@Override public ImmutableList<Fact> facts() { return facts; }
@GwtIncompatible @Test public void testSerialization_ComparisonFailureWithFacts() { ImmutableList<String> messages = ImmutableList.of("hello"); ImmutableList<Fact> facts = ImmutableList.of(fact("first", "value"), simpleFact("second")); String expected = "expected"; String actual = "actual"; Thro...
public boolean offer(E item) { checkNotNull(item, "item"); if (tail - head + 1 == capacity) { return false; } else { long t = tail + 1; int index = (int) (t & mask); array[index] = item; tail = t; return true; } ...
@Test(expected = NullPointerException.class) public void test_offer_whenNull() { CircularQueue<Integer> queue = new CircularQueue<>(128); queue.offer(null); }
public static NamespaceName get(String tenant, String namespace) { validateNamespaceName(tenant, namespace); return get(tenant + '/' + namespace); }
@Test(expectedExceptions = IllegalArgumentException.class) public void namespace_emptyNamespace() { NamespaceName.get("pulsar", "cluster", ""); }
public static synchronized void d(final String tag, String text) { if (msLogger.supportsD()) { msLogger.d(tag, text); addLog(LVL_D, tag, text); } }
@Test public void testDNotSupported() throws Exception { Mockito.when(mMockLog.supportsD()).thenReturn(false); Logger.d("mTag", "Text with %d digits", 1); Mockito.verify(mMockLog, Mockito.never()).d("mTag", "Text with 1 digits"); Logger.d("mTag", "Text with no digits"); Mockito.verify(mMockLog, M...
@Override public Range<T> lastRange() { return rangeSet.lastRange(); }
@Test public void testLastRange() { set = new RangeSetWrapper<>(consumer, reverseConvert, managedCursor); assertNull(set.lastRange()); Range<LongPair> range = Range.openClosed(new LongPair(0, 97), new LongPair(0, 99)); set.addOpenClosed(0, 97, 0, 99); assertEquals(set.lastRan...
@Override public Integer call() throws Exception { super.call(); try (var files = Files.walk(directory)) { List<Template> templates = files .filter(Files::isRegularFile) .filter(YamlFlowParser::isValidExtension) .map(path -> yamlFlowParser...
@Test void runNoDelete() { URL directory = TemplateNamespaceUpdateCommandTest.class.getClassLoader().getResource("templates"); URL subDirectory = TemplateNamespaceUpdateCommandTest.class.getClassLoader().getResource("templates/templatesSubFolder"); ByteArrayOutputStream out = new ByteArrayO...
@Override public void finished(boolean allStepsExecuted) { if (postProjectAnalysisTasks.length == 0) { return; } ProjectAnalysisImpl projectAnalysis = createProjectAnalysis(allStepsExecuted ? SUCCESS : FAILED); for (PostProjectAnalysisTask postProjectAnalysisTask : postProjectAnalysisTasks) { ...
@Test @UseDataProvider("booleanValues") public void logStatistics_adds_statistics_to_end_of_task_log(boolean allStepsExecuted) { Map<String, Object> stats = new HashMap<>(); for (int i = 0; i <= new Random().nextInt(10); i++) { stats.put("statKey_" + i, "statVal_" + i); } PostProjectAnalysisTa...
@JsonIgnore public boolean canHaveProfile() { return !this.indexTemplateType().map(TEMPLATE_TYPES_FOR_INDEX_SETS_WITH_IMMUTABLE_FIELD_TYPES::contains).orElse(false); }
@Test public void testFailureIndexWithProfileSetIsIllegal() { assertFalse(testIndexSetConfig(IndexTemplateProvider.FAILURE_TEMPLATE_TYPE, null, "profile").canHaveProfile()); }
public static AppsInfo mergeAppsInfo(ArrayList<AppInfo> appsInfo, boolean returnPartialResult) { AppsInfo allApps = new AppsInfo(); Map<String, AppInfo> federationAM = new HashMap<>(); Map<String, AppInfo> federationUAMSum = new HashMap<>(); for (AppInfo a : appsInfo) { // Check if this App...
@Test public void testMerge2UAM() { AppsInfo apps = new AppsInfo(); AppInfo app1 = new AppInfo(); app1.setAppId(APPID1.toString()); app1.setName(UnmanagedApplicationManager.APP_NAME); app1.setState(YarnApplicationState.RUNNING); apps.add(app1); AppInfo app2 = new AppInfo(); app2.set...
@Override public String toString() { return "CamelContextRouteCoverage{" + "id='" + id + '\'' + ", exchangesTotal=" + exchangesTotal + ", totalProcessingTime=" + totalProcessingTime + ", routes=" + routes + '}'; }
@Test public void testToString() { String toString = getInstance().toString(); assertNotNull(toString); assertTrue(toString.contains("CamelContextRouteCoverage")); }
DecodedJWT verifyJWT(PublicKey publicKey, String publicKeyAlg, DecodedJWT jwt) throws AuthenticationException { if (publicKeyAlg == null) { incrementFailureMetric(AuthenticationExceptionCode.UNSUPPORTED_ALGORITHM); throw new...
@Test public void testThatSupportedAlgWithMismatchedPublicKeyFromDifferentAlgFamilyFails() throws IOException { KeyPair keyPair = Keys.keyPairFor(SignatureAlgorithm.RS256); @Cleanup AuthenticationProviderOpenID provider = new AuthenticationProviderOpenID(); DefaultJwtBuilder defaultJ...
@Override public int configInfoTagCount() { ConfigInfoTagMapper configInfoTagMapper = mapperManager.findMapper(dataSourceService.getDataSourceType(), TableConstant.CONFIG_INFO_TAG); String sql = configInfoTagMapper.count(null); Integer result = databaseOperate.queryOne(sql, I...
@Test void testConfigInfoTagCount() { Timestamp timestamp = new Timestamp(System.currentTimeMillis()); //mock count Mockito.when(databaseOperate.queryOne(anyString(), eq(Integer.class))).thenReturn(308); //execute & verify int count = embeddedConfigInfoTagPersistServ...
@Override public Consumer createConsumer(Processor aProcessor) throws Exception { // validate that all of the endpoint is configured properly if (getMonitorType() != null) { if (!isPlatformServer()) { throw new IllegalArgumentException(ERR_PLATFORM_SERVER); }...
@Test public void remoteServerWithMonitor() throws Exception { JMXEndpoint ep = context.getEndpoint( "jmx:service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi?objectDomain=FooDomain&key.name=theObjectName&monitorType=gauge", JMXEndpoint.class); try { ep.cre...
public Node deserializeObject(JsonReader reader) { Log.info("Deserializing JSON to Node."); JsonObject jsonObject = reader.readObject(); return deserializeObject(jsonObject); }
@Test void testNonMetaProperties() { CompilationUnit cu = parse("public class X{} class Z{}"); String serialized = serialize(cu, false); CompilationUnit deserialized = (CompilationUnit) deserializer.deserializeObject(Json.createReader(new StringReader(serialized))); ...
public static byte[] serialize(final Object body) throws IOException { final ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); final ObjectOutputStream outputStream = new ObjectOutputStream(byteArrayOutputStream); try { outputStream.writeObject(body); ...
@Test public void testSerialisationOnPrimitive() throws Exception { byte[] expected = PulsarMessageUtils.serialize(10); assertNotNull(expected); }
@Override public void pluginUnLoaded(GoPluginDescriptor pluginDescriptor) { super.pluginUnLoaded(pluginDescriptor); if (extension.canHandlePlugin(pluginDescriptor.id())) { for (PluginMetadataChangeListener listener : listeners) { listener.onPluginMetadataRemove(pluginDes...
@Test public void onPluginUnloaded_shouldRemoveTheCorrespondingPluginInfoFromStore() throws Exception { GoPluginDescriptor descriptor = GoPluginDescriptor.builder().id("plugin1").build(); AnalyticsMetadataLoader metadataLoader = new AnalyticsMetadataLoader(pluginManager, metadataStore, infoBuilder,...
public List<Instance> generateInstancesByIps(String serviceName, String rawProductName, String clusterName, String[] ipArray) { if (StringUtils.isEmpty(serviceName) || StringUtils.isEmpty(clusterName) || ipArray == null || ipArray.length == 0) { return Collections.emptyLi...
@Test void testGenerateInstancesByIps() { AddressServerGeneratorManager manager = new AddressServerGeneratorManager(); final List<Instance> empty = manager.generateInstancesByIps(null, null, null, null); assertNotNull(empty); assertTrue(empty.isEmpty()); String[] ipArray...
public Set<String> makeReady(final Map<String, InternalTopicConfig> topics) { // we will do the validation / topic-creation in a loop, until we have confirmed all topics // have existed with the expected number of partitions, or some create topic returns fatal errors. log.debug("Starting to vali...
@Test public void shouldNotCreateTopicIfExistsWithDifferentPartitions() { mockAdminClient.addTopic( false, topic1, new ArrayList<TopicPartitionInfo>() { { add(new TopicPartitionInfo(0, broker1, singleReplica, Collections.emptyList())); ...
@Override public Column convert(BasicTypeDefine typeDefine) { PhysicalColumn.PhysicalColumnBuilder builder = PhysicalColumn.builder() .name(typeDefine.getName()) .nullable(typeDefine.isNullable()) .defaultValue(typeDefin...
@Test public void testConvertImage() { BasicTypeDefine<Object> typeDefine = BasicTypeDefine.builder() .name("test") .columnType("image") .dataType("image") .length(2147483647L) ...
@Override public void run() { try { // We kill containers until the kernel reports the OOM situation resolved // Note: If the kernel has a delay this may kill more than necessary while (true) { String status = cgroups.getCGroupParam( CGroupsHandler.CGroupController.MEMORY, ...
@Test public void testNoGuaranteedContainerOverLimitOOM() throws Exception { ConcurrentHashMap<ContainerId, Container> containers = new ConcurrentHashMap<>(); Container c1 = createContainer(1, true, 1L, true); containers.put(c1.getContainerId(), c1); Container c2 = createContainer(2, true, 2L,...
public DropSourceCommand create(final DropStream statement) { return create( statement.getName(), statement.getIfExists(), statement.isDeleteTopic(), DataSourceType.KSTREAM ); }
@Test public void shouldFailDeleteTopicForSourceStream() { // Given: final DropStream dropStream = new DropStream(SOME_NAME, false, true); when(ksqlStream.isSource()).thenReturn(true); // When: final Exception e = assertThrows( KsqlException.class, () -> dropSourceFactory.create(d...
public ColumnMeta getColumnMeta(String colName) { return allColumns.get(colName); }
@Test public void testGetColumnMeta() { ColumnMeta columnMeta = new ColumnMeta(); tableMeta.getAllColumns().put("col1", columnMeta); assertEquals(columnMeta, tableMeta.getColumnMeta("col1"), "Should return the correct ColumnMeta object"); }
public static AuthorizationDoc fromDto(IndexType indexType, IndexPermissions dto) { AuthorizationDoc res = new AuthorizationDoc(indexType, dto.getEntityUuid()); if (dto.isAllowAnyone()) { return res.setAllowAnyone(); } return res.setRestricted(dto.getGroupUuids(), dto.getUserUuids()); }
@Test @UseDataProvider("dtos") public void getRouting_returns_projectUuid(IndexPermissions dto) { AuthorizationDoc underTest = AuthorizationDoc.fromDto(IndexType.main(Index.simple("foo"), "bar"), dto); assertThat(underTest.getRouting()).contains(dto.getEntityUuid()); }
public static Object project(Schema source, Object record, Schema target) throws SchemaProjectorException { checkMaybeCompatible(source, target); if (source.isOptional() && !target.isOptional()) { if (target.defaultValue() != null) { if (record != null) { ...
@Test public void testStructDefaultValue() { Schema source = SchemaBuilder.struct().optional() .field("field", Schema.INT32_SCHEMA) .field("field2", Schema.INT32_SCHEMA) .build(); SchemaBuilder builder = SchemaBuilder.struct() .field("...
Number applyCastInteger(double predictionDouble) { return targetField.getCastInteger() != null ? targetField.getCastInteger().getScaledValue(predictionDouble) : predictionDouble; }
@Test void applyCastInteger() { TargetField targetField = new TargetField(Collections.emptyList(), null, "string", null, null, null, null, null); KiePMMLTarget kiePMMLTarget = getBuilder(targetField).build(); assertThat((double) kiePMMLTarget...
public void registerNewEntity(final String id, final User user, final GRNType grnType) { final GRN grn = grnRegistry.newGRN(grnType, id); registerNewEntity(grn, user); }
@Test void registersNewEntityForEachType() { final User mockUser = mock(User.class); when(mockUser.getName()).thenReturn("mockuser"); when(mockUser.getId()).thenReturn("mockuser"); final String id = "1234"; for (GRNType type : GRNTypes.builtinTypes()) { entityOw...
public static Set<PathSpec> getPresentPaths(MaskTree filter, Set<PathSpec> paths) { // this emulates the behavior of Rest.li server // if client does not specify any mask, the server receives null when retrieving the MaskTree // in this case, all fields are returned if (filter == null) { ret...
@Test public void testPositiveMultiPaths() { final MaskTree filter = new MaskTree(); filter.addOperation(new PathSpec("foo", "bar", "baz"), MaskOperation.POSITIVE_MASK_OP); final Collection<PathSpec> positivePaths = new HashSet<>(Arrays.asList( new PathSpec("foo"), new PathSpec("foo", "bar"...
public MemorySize divide(long by) { if (by < 0) { throw new IllegalArgumentException("divisor must be != 0"); } return new MemorySize(bytes / by); }
@Test void testDivideByLong() { final MemorySize memory = new MemorySize(100L); assertThat(memory.divide(23)).isEqualTo(new MemorySize(4L)); }
public static String decodeName(ByteBuf in) { return DnsCodecUtil.decodeDomainName(in); }
@Test public void testDecodeName() { testDecodeName("netty.io.", Unpooled.wrappedBuffer(new byte[] { 5, 'n', 'e', 't', 't', 'y', 2, 'i', 'o', 0 })); }
public static MetricsReporter combine(MetricsReporter first, MetricsReporter second) { if (null == first) { return second; } else if (null == second || first == second) { return first; } Set<MetricsReporter> reporters = Sets.newIdentityHashSet(); if (first instanceof CompositeMetricsRe...
@Test public void combineSameClassButDifferentInstances() { MetricsReporter first = LoggingMetricsReporter.instance(); MetricsReporter second = new LoggingMetricsReporter(); MetricsReporter combined = MetricsReporters.combine(first, second); assertThat(combined).isInstanceOf(MetricsReporters.Composit...
@Override public Collection<SQLToken> generateSQLTokens(final InsertStatementContext insertStatementContext) { Optional<InsertColumnsSegment> insertColumnsSegment = insertStatementContext.getSqlStatement().getInsertColumns(); Preconditions.checkState(insertColumnsSegment.isPresent()); Collec...
@Test void assertGenerateSQLTokensWithInsertStatementContext() { assertThat(generator.generateSQLTokens(EncryptGeneratorFixtureBuilder.createInsertStatementContext(Collections.emptyList())).size(), is(1)); }
static int getMaskCharacter(final String mask) { if (mask == null) { return NO_MASK; } if (mask.length() != 1) { throw new KsqlException("Invalid mask character. " + "Must be only single character, but was '" + mask + "'"); } return mask.codePointAt(0); }
@Test(expected = KsqlException.class) public void shoudThrowOnEmptyMask() { Masker.getMaskCharacter(""); }
@Override public Stream<Pair<String, CompactionOperation>> getPendingCompactionOperations() { return execute(preferredView::getPendingCompactionOperations, () -> getSecondaryView().getPendingCompactionOperations()); }
@Test public void testGetPendingCompactionOperations() { Stream<Pair<String, CompactionOperation>> actual; Stream<Pair<String, CompactionOperation>> expected = Collections.singleton( (Pair<String, CompactionOperation>) new ImmutablePair<>("test", new CompactionOperation())) .stream(); ...
public static boolean isCreditCode(CharSequence creditCode) { if (false == isCreditCodeSimple(creditCode)) { return false; } final int parityBit = getParityBit(creditCode); if (parityBit < 0) { return false; } return creditCode.charAt(17) == BASE_CODE_ARRAY[parityBit]; }
@Test public void isCreditCode2() { // 由于早期部分试点地区推行 法人和其他组织统一社会信用代码 较早,会存在部分代码不符合国家标准的情况。 // 见:https://github.com/bluesky335/IDCheck String testCreditCode = "91350211M00013FA1N"; assertFalse(CreditCodeUtil.isCreditCode(testCreditCode)); }
public String process(final Expression expression) { return formatExpression(expression); }
@Test public void shouldGenerateCorrectCodeForTimestampDateGT() { // Given: final ComparisonExpression compExp = new ComparisonExpression( Type.GREATER_THAN, TIMESTAMPCOL, DATECOL ); // When: final String java = sqlToJavaVisitor.process(compExp); // Then: assertTh...
@Override public void metricChange(final KafkaMetric metric) { if (!THROUGHPUT_METRIC_NAMES.contains(metric.metricName().name()) || !StreamsMetricsImpl.TOPIC_LEVEL_GROUP.equals(metric.metricName().group())) { return; } addMetric( metric, getQueryId(metric), getTopic...
@Test public void shouldAggregateMetricsByQueryIdForTransientQueries() { // Given: final Map<String, String> transientQueryTags = ImmutableMap.of( "logical_cluster_id", "lksqlc-12345", "query-id", "blahblah_4", "member", TRANSIENT_THREAD_ID, "topic", TOPIC_NAME ); liste...
public static CompositeEvictionChecker newCompositeEvictionChecker(CompositionOperator compositionOperator, EvictionChecker... evictionCheckers) { Preconditions.isNotNull(compositionOperator, "composition"); Preconditions.isNotNull(e...
@Test public void resultShouldReturnFalse_whenAllIsFalse_withAndCompositionOperator() { EvictionChecker evictionChecker1ReturnsFalse = mock(EvictionChecker.class); EvictionChecker evictionChecker2ReturnsFalse = mock(EvictionChecker.class); when(evictionChecker1ReturnsFalse.isEvictionRequire...
List<Condition> run(boolean useKRaft) { List<Condition> warnings = new ArrayList<>(); checkKafkaReplicationConfig(warnings); checkKafkaBrokersStorage(warnings); if (useKRaft) { // Additional checks done for KRaft clusters checkKRaftControllerStorage(warnings);...
@Test public void testUnusedConfigInKRaftBasedClusters() { Kafka kafka = new KafkaBuilder(KAFKA) .editSpec() .editKafka() .addToConfig(Map.of( "inter.broker.protocol.version", "3.5", "...
@Override public Object read(final PostgreSQLPacketPayload payload, final int parameterValueLength) { return payload.getByteBuf().readDouble(); }
@Test void assertRead() { when(byteBuf.readDouble()).thenReturn(1D); assertThat(new PostgreSQLDoubleBinaryProtocolValue().read(new PostgreSQLPacketPayload(byteBuf, StandardCharsets.UTF_8), 8), is(1D)); }
@Override public Object getValue(final int columnIndex, final Class<?> type) throws SQLException { if (boolean.class == type) { return resultSet.getBoolean(columnIndex); } if (byte.class == type) { return resultSet.getByte(columnIndex); } if (short.cla...
@Test void assertGetValueByDouble() throws SQLException { ResultSet resultSet = mock(ResultSet.class); when(resultSet.getDouble(1)).thenReturn(1.0D); assertThat(new JDBCStreamQueryResult(resultSet).getValue(1, double.class), is(1.0D)); }
public static void info(final Logger logger, final String format, final Supplier<Object> supplier) { if (logger.isInfoEnabled()) { logger.info(format, supplier.get()); } }
@Test public void testNeverInfo() { when(logger.isInfoEnabled()).thenReturn(false); LogUtils.info(logger, supplier); verify(supplier, never()).get(); }
@Override public Column convert(BasicTypeDefine typeDefine) { PhysicalColumn.PhysicalColumnBuilder builder = PhysicalColumn.builder() .name(typeDefine.getName()) .sourceType(typeDefine.getColumnType()) .nullable(typeDefi...
@Test public void testConvertDate() { BasicTypeDefine<Object> typeDefine = BasicTypeDefine.builder().name("test").columnType("DATE").dataType("DATE").build(); Column column = DB2TypeConverter.INSTANCE.convert(typeDefine); Assertions.assertEquals(typeDefine.getName(), column.g...
public static void addConfiguredSecurityProviders(Map<String, ?> configs) { String securityProviderClassesStr = (String) configs.get(SecurityConfig.SECURITY_PROVIDERS_CONFIG); if (securityProviderClassesStr == null || securityProviderClassesStr.isEmpty()) { return; } try { ...
@Test public void testAddCustomSecurityProvider() { String customProviderClasses = testScramSaslServerProviderCreator.getClass().getName() + "," + testPlainSaslServerProviderCreator.getClass().getName(); Map<String, String> configs = new HashMap<>(); configs.put(SecurityConfi...
@VisibleForTesting void validateDictTypeNameUnique(Long id, String name) { DictTypeDO dictType = dictTypeMapper.selectByName(name); if (dictType == null) { return; } // 如果 id 为空,说明不用比较是否为相同 id 的字典类型 if (id == null) { throw exception(DICT_TYPE_NAME_DUPL...
@Test public void testValidateDictTypeNameUnique_nameDuplicateForCreate() { // 准备参数 String name = randomString(); // mock 数据 dictTypeMapper.insert(randomDictTypeDO(o -> o.setName(name))); // 调用,校验异常 assertServiceException(() -> dictTypeService.validateDictTypeNameUni...
@VisibleForTesting boolean parseArguments(String[] args) throws IOException { Options opts = new Options(); opts.addOption(Option.builder("h").build()); opts.addOption(Option.builder("help").build()); opts.addOption(Option.builder("input") .desc("Input class path. Defaults to the default class...
@Test void testHelp() throws IOException { String[] args = new String[]{"-help"}; FrameworkUploader uploader = new FrameworkUploader(); boolean success = uploader.parseArguments(args); assertFalse(success, "Expected to print help"); assertThat(uploader.input) .withFailMessage("Expected ign...
@Override public Long createArticleCategory(ArticleCategoryCreateReqVO createReqVO) { // 插入 ArticleCategoryDO category = ArticleCategoryConvert.INSTANCE.convert(createReqVO); articleCategoryMapper.insert(category); // 返回 return category.getId(); }
@Test public void testCreateArticleCategory_success() { // 准备参数 ArticleCategoryCreateReqVO reqVO = randomPojo(ArticleCategoryCreateReqVO.class); // 调用 Long articleCategoryId = articleCategoryService.createArticleCategory(reqVO); // 断言 assertNotNull(articleCategoryId)...
public boolean acceptsXml( String nodeName ) { if ( "transformation".equals( nodeName ) ) { return true; } return false; }
@Test public void testAcceptsXml() throws Exception { assertFalse( transFileListener.acceptsXml( null ) ); assertFalse( transFileListener.acceptsXml( "" ) ); assertFalse( transFileListener.acceptsXml( "Transformation" ) ); assertTrue( transFileListener.acceptsXml( "transformation" ) ); }
void removePartitionEpochs( Map<Uuid, Set<Integer>> assignment, int expectedEpoch ) { assignment.forEach((topicId, assignedPartitions) -> { currentPartitionEpoch.compute(topicId, (__, partitionsOrNull) -> { if (partitionsOrNull != null) { assig...
@Test public void testRemovePartitionEpochs() { Uuid fooTopicId = Uuid.randomUuid(); ConsumerGroup consumerGroup = createConsumerGroup("foo"); // Removing should fail because there is no epoch set. assertThrows(IllegalStateException.class, () -> consumerGroup.removePartitionEpochs( ...
@Override public DataflowPipelineJob run(Pipeline pipeline) { // Multi-language pipelines and pipelines that include upgrades should automatically be upgraded // to Runner v2. if (DataflowRunner.isMultiLanguagePipeline(pipeline) || includesTransformUpgrades(pipeline)) { List<String> experiments = fi...
@Test public void testBatchOnSuccessMatcherWhenPipelineSucceeds() throws Exception { Pipeline p = TestPipeline.create(options); PCollection<Integer> pc = p.apply(Create.of(1, 2, 3)); PAssert.that(pc).containsInAnyOrder(1, 2, 3); final DataflowPipelineJob mockJob = Mockito.mock(DataflowPipelineJob.cla...
public static List<Common.MessageFormatting> dbMessageFormattingListToWs(@Nullable List<DbIssues.MessageFormatting> dbFormattings) { if (dbFormattings == null) { return List.of(); } return dbFormattings.stream() .map(f -> Common.MessageFormatting.newBuilder() .setStart(f.getStart()) ...
@Test public void nullFormattingListShouldBeEmptyList() { assertThat(MessageFormattingUtils.dbMessageFormattingListToWs(null)).isEmpty(); }
@Override public void open() throws Exception { this.timerService = getInternalTimerService("processing timer", VoidNamespaceSerializer.INSTANCE, this); this.keySet = new HashSet<>(); super.open(); }
@Test void testProcessRecord() throws Exception { List<Integer> fromNonBroadcastInput = new ArrayList<>(); List<Long> fromBroadcastInput = new ArrayList<>(); KeyedTwoInputBroadcastProcessOperator<Long, Integer, Long, Long> processOperator = new KeyedTwoInputBroadcastProcessOp...
@Override @SuppressWarnings("unchecked") public <T> T get(final PluginConfigSpec<T> configSpec) { if (rawSettings.containsKey(configSpec.name())) { Object o = rawSettings.get(configSpec.name()); if (configSpec.type().isAssignableFrom(o.getClass())) { return (T) o;...
@Test public void testUriDefaultValue() { String defaultUri = "https://user:password@www.site.com:99"; PluginConfigSpec<URI> uriConfig = PluginConfigSpec.uriSetting("test", defaultUri); Configuration config = new ConfigurationImpl(Collections.emptyMap()); URI u = config.get(uriConfig...
public static JibContainerBuilder toJibContainerBuilder( ArtifactProcessor processor, CommonCliOptions commonCliOptions, CommonContainerConfigCliOptions commonContainerConfigCliOptions, ConsoleLogger logger) throws IOException, InvalidImageReferenceException { String baseImage = common...
@Test public void testToJibContainerBuilder_explodedStandard_basicInfo() throws IOException, InvalidImageReferenceException { FileEntriesLayer layer = FileEntriesLayer.builder() .setName("classes") .addEntry( Paths.get("path/to/tempDirectory/WEB-INF/classes/cl...
@VisibleForTesting void handleResponse(DiscoveryResponseData response) { ResourceType resourceType = response.getResourceType(); switch (resourceType) { case NODE: handleD2NodeResponse(response); break; case D2_URI_MAP: handleD2URIMapResponse(response); break;...
@Test public void testHandleD2URICollectionUpdateWithBadData() { DiscoveryResponseData badData = new DiscoveryResponseData( D2_URI, Collections.singletonList(Resource.newBuilder().setVersion(VERSION1).setName(URI_URN1) // resource field not set .build()), null, ...
public boolean isWatching() { BasicKeyChain.State basicState = basic.isWatching(); BasicKeyChain.State activeState = BasicKeyChain.State.EMPTY; if (chains != null && !chains.isEmpty()) { if (getActiveKeyChain().isWatching()) activeState = BasicKeyChain.State.WATCHING;...
@Test public void isWatching() { group = KeyChainGroup.builder(BitcoinNetwork.MAINNET) .addChain(DeterministicKeyChain.builder().watch(DeterministicKey.deserializeB58( "xpub69bjfJ91ikC5ghsqsVDHNq2dRGaV2HHVx7Y9LXi27LN9BWWAXPTQr4u8U3wAtap8bLdHdkqPpAcZmhMS5SnrMQC4ccaoBcc...
public static void checkCacheConfig(CacheSimpleConfig cacheSimpleConfig, SplitBrainMergePolicyProvider mergePolicyProvider) { checkCacheConfig(cacheSimpleConfig.getInMemoryFormat(), cacheSimpleConfig.getEvictionConfig(), cacheSimpleConfig.getMergePolicyCon...
@Test(expected = IllegalArgumentException.class) public void checkCacheConfig_withEntryCountMaxSizePolicy_NATIVE() { EvictionConfig evictionConfig = new EvictionConfig() .setMaxSizePolicy(MaxSizePolicy.ENTRY_COUNT); CacheSimpleConfig cacheSimpleConfig = new CacheSimpleConfig() ...
@NonNull public String processShownotes() { String shownotes = rawShownotes; if (TextUtils.isEmpty(shownotes)) { Log.d(TAG, "shownotesProvider contained no shownotes. Returning 'no shownotes' message"); shownotes = "<html><head></head><body><p id='apNoShownotes'>" + noShowno...
@Test public void testProcessShownotesAddTimecodeHhmmssNoChapters() { final String timeStr = "10:11:12"; final long time = 3600 * 1000 * 10 + 60 * 1000 * 11 + 12 * 1000; String shownotes = "<p> Some test text with a timecode " + timeStr + " here.</p>"; ShownotesCleaner t = new Shown...
public PrepareResult prepare(HostValidator hostValidator, DeployLogger logger, PrepareParams params, Optional<ApplicationVersions> activeApplicationVersions, Instant now, File serverDbSessionDir, ApplicationPackage applicationPackage, SessionZooKeeperCli...
@Test public void require_that_endpoint_certificate_metadata_is_written() throws IOException { var applicationId = applicationId("test"); var params = new PrepareParams.Builder().applicationId(applicationId).endpointCertificateMetadata("{\"keyName\": \"vespa.tlskeys.tenant1--app1-key\", \"certName\"...
static void parseAuthority(final StringReader reader, final Host host, final Consumer<HostParserException> decorator) throws HostParserException { parseUserInfo(reader, host, decorator); parseHostname(reader, host, decorator); parsePath(reader, host, false, decorator); }
@Test public void testParseAuthoritySimpleDomain() throws HostParserException { final Host host = new Host(new TestProtocol()); final String authority = "domain.tld"; final HostParser.StringReader reader = new HostParser.StringReader(authority); HostParser.parseAuthority(reader, hos...
static void sanityCheckExcludedRackIds(Builder builder) { if (builder._excludedRackIds != null && builder._numBrokers == DEFAULT_OPTIONAL_INT) { throw new IllegalArgumentException("Excluded rack ids can be specified only with the number of brokers."); } }
@Test public void testSanityCheckExcludedRackIds() { // Set excluded rack ids without numBrokers assertThrows(IllegalArgumentException.class, () -> ProvisionRecommendation.sanityCheckExcludedRackIds( new ProvisionRecommendation.Builder(ProvisionStatus.UNDER_PROVISIONED).numRacks(1).excludedRackIds(Col...
public static Identifier parse(String stringValue) { return parse(stringValue, -1); }
@Test(expected = IllegalArgumentException.class) public void testParseIntegerBelowMin() { Identifier.parse("-1"); }
public void deleteGroup(String groupName) { Iterator<PipelineConfigs> iterator = this.iterator(); while (iterator.hasNext()) { PipelineConfigs currentGroup = iterator.next(); if (currentGroup.isNamed(groupName)) { if (!currentGroup.isEmpty()) { ...
@Test public void shouldDeleteGroupWithSameNameWhenEmpty() { PipelineConfigs group = createGroup("group", new PipelineConfig[]{}); group.setAuthorization(new Authorization(new ViewConfig(new AdminUser(new CaseInsensitiveString("user"))))); PipelineGroups groups = new PipelineGroups(group); ...
public PriorityFutureTask<Void> submit(PriorityRunnable task) { if (task == null) { throw new NullPointerException(); } final PriorityFutureTask<Void> ftask = new PriorityFutureTask(task, null); execute(ftask); return ftask; }
@Test public void testDefault() throws InterruptedException, ExecutionException { PriorityBlockingQueue<Runnable> workQueue = new PriorityBlockingQueue<Runnable>(1000); PriorityThreadPoolExecutor pool = new PriorityThreadPoolExecutor(1, 1, 1, TimeUnit.MINUTES, workQueue); Future[] futures =...
@VisibleForTesting static void writeFileConservatively(Path file, String content) throws IOException { if (Files.exists(file)) { String oldContent = new String(Files.readAllBytes(file), StandardCharsets.UTF_8); if (oldContent.equals(content)) { return; } } Files.createDirectories...
@Test public void testWriteFileConservatively() throws IOException { Path file = temporaryFolder.getRoot().toPath().resolve("file.txt"); PluginConfigurationProcessor.writeFileConservatively(file, "some content"); String content = new String(Files.readAllBytes(file), StandardCharsets.UTF_8); assertTh...
@CanDistro @PostMapping @TpsControl(pointName = "NamingInstanceRegister", name = "HttpNamingInstanceRegister") @Secured(action = ActionTypes.WRITE) public String register(HttpServletRequest request) throws Exception { final String namespaceId = WebUtils.optional(request, CommonParams.NA...
@Test void testRegister() throws Exception { assertEquals("ok", instanceController.register(request)); verify(instanceServiceV2).registerInstance(eq(Constants.DEFAULT_NAMESPACE_ID), eq(TEST_GROUP_NAME + "@@" + TEST_SERVICE_NAME), any(Instance.class)); TimeUnit.SECONDS.sleep(1...
public boolean produce(T data) { if (driver != null) { if (!driver.isRunning(channels)) { return false; } } return this.channels.save(data); }
@Test public void testIfPossibleProduce() { DataCarrier<SampleData> carrier = new DataCarrier<>(2, 100, BufferStrategy.IF_POSSIBLE); for (int i = 0; i < 200; i++) { assertTrue(carrier.produce(new SampleData().setName("d" + i))); } for (int i = 0; i < 200; i++) { ...
void doSubmit(final Runnable action) { CONTINUATION.get().submit(action); }
@Test public void testDeepRecursion() { final Continuations CONT = new Continuations(); final AtomicInteger result = new AtomicInteger(); CONT.doSubmit(() -> { deepRecursion(CONT, result, 0); }); assertEquals(result.get(), 1000001); }
@Nullable static String channelName(@Nullable Destination destination) { if (destination == null) return null; boolean isQueue = isQueue(destination); try { if (isQueue) { return ((Queue) destination).getQueueName(); } else { return ((Topic) destination).getTopicName(); } ...
@Test void channelName_queueAndTopic_queueOnQueueName() throws JMSException { QueueAndTopic destination = mock(QueueAndTopic.class); when(destination.getQueueName()).thenReturn("queue-foo"); assertThat(MessageParser.channelName(destination)) .isEqualTo("queue-foo"); }
@Override public Float parse(final String value) { return Float.parseFloat(value); }
@Test void assertParse() { assertThat(new PostgreSQLFloatValueParser().parse("1"), is(1F)); }