/** * <p>Returns the next pseudorandom, uniformly distributed boolean value * from the Math.random() sequence.</p> * * @return the random boolean */ public static boolean nextBoolean() { return nextBoolean(JVM_RANDOM); }
public static PermissionTemplateCharacteristicDto newPermissionTemplateCharacteristicDto() { return new PermissionTemplateCharacteristicDto() .setPermission(PermissionsTestHelper.ALL_PERMISSIONS.toArray(new String[0])[RandomUtils.nextInt(PermissionsTestHelper.ALL_PERMISSIONS.size())]) .setWithProjectCreator(RandomUtils.nextBoolean()) .setCreatedAt(System.currentTimeMillis()) .setUpdatedAt(System.currentTimeMillis()); }
private void insertWebhookDelivery(String uuid, @Nullable String analysisUuid, String ceTaskUuid) { db.executeInsert(TABLE_WEBHOOK_DELIVERY, "UUID", uuid, "COMPONENT_UUID", randomAlphanumeric(30), "ANALYSIS_UUID", analysisUuid, "CE_TASK_UUID", ceTaskUuid, "NAME", randomAlphanumeric(15), "URL", randomAlphanumeric(15), "SUCCESS", RandomUtils.nextBoolean(), "PAYLOAD", randomAlphanumeric(200), "CREATED_AT", RandomUtils.nextInt() ); } }
public static MetricDto newMetricDto() { Metric.ValueType[] metricTypes = Metric.ValueType.values(); return new MetricDto() .setId(RandomUtils.nextInt()) .setKey(RandomStringUtils.randomAlphanumeric(64)) .setShortName(RandomStringUtils.randomAlphanumeric(64)) .setValueType(metricTypes[RandomUtils.nextInt(metricTypes.length - 1)].name()) .setDomain(RandomStringUtils.randomAlphanumeric(64)) .setDescription(RandomStringUtils.randomAlphanumeric(250)) .setBestValue(RandomUtils.nextDouble()) .setDeleteHistoricalData(RandomUtils.nextBoolean()) .setDirection(RandomUtils.nextInt()) .setHidden(RandomUtils.nextBoolean()) .setEnabled(true) .setOptimizedBestValue(RandomUtils.nextBoolean()) .setQualitative(RandomUtils.nextBoolean()) .setUserManaged(RandomUtils.nextBoolean()) .setWorstValue(RandomUtils.nextDouble()); } }
private void insertCeActivity(String uuid, String analysisUuid) { db.executeInsert(TABLE_CE_ACTIVITIY, "UUID", uuid, "TASK_TYPE", randomAlphanumeric(5), "ANALYSIS_UUID", analysisUuid, "STATUS", randomAlphanumeric(5), "IS_LAST", RandomUtils.nextBoolean(), "IS_LAST_KEY", randomAlphanumeric(50), "EXECUTION_COUNT", RandomUtils.nextInt(10), "SUBMITTED_AT", RandomUtils.nextInt(), "CREATED_AT", RandomUtils.nextInt(), "UPDATED_AT", RandomUtils.nextInt() ); }
public static UserDto newUserDto() { return new UserDto() .setId(nextInt()) .setUuid(randomAlphanumeric(40)) .setActive(true) .setLocal(nextBoolean()) .setLogin(randomAlphanumeric(30)) .setName(randomAlphanumeric(30)) .setEmail(randomAlphanumeric(30)) .setOnboarded(nextBoolean()) .setScmAccounts(singletonList(randomAlphanumeric(40))) .setExternalId(randomAlphanumeric(40)) .setExternalLogin(randomAlphanumeric(40)) .setExternalIdentityProvider(randomAlphanumeric(40)) .setSalt(randomAlphanumeric(40)) .setCryptedPassword(randomAlphanumeric(40)) .setCreatedAt(nextLong()) .setUpdatedAt(nextLong()); }
public static WebhookDeliveryDto newDto() { return new WebhookDeliveryDto() .setUuid(Uuids.createFast()) .setWebhookUuid(randomAlphanumeric(40)) .setComponentUuid(randomAlphanumeric(40)) .setCeTaskUuid(randomAlphanumeric(40)) .setAnalysisUuid(randomAlphanumeric(40)) .setName(randomAlphanumeric(10)) .setUrl(randomAlphanumeric(10)) .setDurationMs(nextInt()) .setHttpStatus(nextInt()) .setSuccess(nextBoolean()) .setPayload(randomAlphanumeric(10)) .setCreatedAt(nextLong()); }
/** * <p>Returns the next pseudorandom, uniformly distributed boolean value * from the Math.random() sequence.</p> * * @return the random boolean */ public static boolean nextBoolean() { return nextBoolean(JVM_RANDOM); }
/** * <p>Returns the next pseudorandom, uniformly distributed boolean value * from the Math.random() sequence.</p> * * @return the random boolean */ public static boolean nextBoolean() { return nextBoolean(JVM_RANDOM); }
/** * <p>Returns the next pseudorandom, uniformly distributed boolean value * from the Math.random() sequence.</p> * * @return the random boolean */ public static boolean nextBoolean() { return nextBoolean(JVM_RANDOM); }
/** * <p>Returns the next pseudorandom, uniformly distributed boolean value * from the Math.random() sequence.</p> * * @return the random boolean */ public static boolean nextBoolean() { return nextBoolean(JVM_RANDOM); }
/** * <p>Returns the next pseudorandom, uniformly distributed boolean value * from the Math.random() sequence.</p> * * @return the random boolean */ public static boolean nextBoolean() { return nextBoolean(JVM_RANDOM); }
@Override public Boolean random() { return RandomUtils.nextBoolean(); }
/** * Build a random {@link Boolean}. For example * <p/> * <code> * Boolean aRandomHasSibilings = RandomBuilder.aRandomBoolean(); * </code> * * @return a random {@link Boolean}. */ public static Boolean aRandomBoolean() { return Boolean.valueOf(nextBoolean()); }
public RegistrationConfirmation process(Contact contact) { // TODO 01 take a look at the (dummy) business logic // it's about confirming the contact is registered return new RegistrationConfirmation( UUID.randomUUID().toString(), contact, RandomUtils.nextBoolean() ); }
public RegistrationConfirmation process(Contact contact) { return new RegistrationConfirmation( UUID.randomUUID().toString(), contact, RandomUtils.nextBoolean() ); }
public static List<MethodSensorAssignment> getMethodSensorAssignment(int size) { if (size == 0) { return null; } List<MethodSensorAssignment> assignments = new ArrayList<>(size); for (int i = 0; i < size; i++) { if (RandomUtils.nextBoolean()) { assignments.add(getSqlMethodSensorAssignment()); } else { assignments.add(getTimerMethodSensorAssignment()); } } return assignments; }
private static void populateClassSensorAssignment(AbstractClassSensorAssignment<?> assignment) { assignment.setClassName(getRandomClass()); if (RandomUtils.nextBoolean()) { assignment.setInterf(true); } else if (RandomUtils.nextBoolean()) { assignment.setSuperclass(true); } if (RandomUtils.nextBoolean()) { assignment.setAnnotation("javax.Service"); } }
public static AgentMapping getAgentMapping(List<Environment> environments) { AgentMapping mapping = new AgentMapping(); mapping.setActive(RandomUtils.nextBoolean()); mapping.setAgentName(RandomStringUtils.randomAlphabetic(20)); mapping.setIpAddress(RandomStringUtils.randomNumeric(16)); return mapping; }
private void doWrite(BlockCompressedDataOutputStream outputStream) throws IOException { outputStream.writeFloat(RandomUtils.nextFloat()); outputStream.writeDouble(RandomUtils.nextDouble()); outputStream.writeLong(RandomUtils.nextLong()); outputStream.writeInt(RandomUtils.nextInt()); outputStream.writeShort(0); outputStream.writeBoolean(RandomUtils.nextBoolean()); outputStream.writeBytes("test"); outputStream.writeByte(RandomUtils.nextInt()); outputStream.writeChar(TEST_CHAR_ID); outputStream.writeChars("test"); outputStream.flush(); }