com.googlecode.objectify.Key Java Examples

The following examples show how to use com.googlecode.objectify.Key. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ConferenceApiTest.java    From ud859 with GNU General Public License v3.0 6 votes vote down vote up
@Test
public void testUpdateProfileWithNulls() throws Exception {
    conferenceApi.saveProfile(user, new ProfileForm(DISPLAY_NAME, TEE_SHIRT_SIZE));
    // Update the Profile with null values.
    Profile profile = conferenceApi.saveProfile(user, new ProfileForm(null, null));
    // Expected behavior is that the existing properties do not get overwritten

    // Check the return value first.
    assertEquals(USER_ID, profile.getUserId());
    assertEquals(EMAIL, profile.getMainEmail());
    assertEquals(TEE_SHIRT_SIZE, profile.getTeeShirtSize());
    assertEquals(DISPLAY_NAME, profile.getDisplayName());
    // Fetch the Profile via Objectify.
    profile = ofy().load().key(Key.create(Profile.class, user.getUserId())).now();
    assertEquals(USER_ID, profile.getUserId());
    assertEquals(EMAIL, profile.getMainEmail());
    assertEquals(TEE_SHIRT_SIZE, profile.getTeeShirtSize());
    assertEquals(DISPLAY_NAME, profile.getDisplayName());
}
 
Example #2
Source File: DomainCheckFlowTest.java    From nomulus with Apache License 2.0 6 votes vote down vote up
@Test
public void testSuccess_oneExists_allocationTokenIsRedeemed() throws Exception {
  setEppInput("domain_check_allocationtoken.xml");
  persistActiveDomain("example1.tld");
  persistResource(
      new AllocationToken.Builder()
          .setToken("abc123")
          .setTokenType(SINGLE_USE)
          .setRedemptionHistoryEntry(Key.create(HistoryEntry.class, 1L))
          .build());
  doCheckTest(
      create(false, "example1.tld", "In use"),
      create(false, "example2.tld", "Alloc token was already redeemed"),
      create(false, "reserved.tld", "Reserved"),
      create(false, "specificuse.tld", "Allocation token required"));
}
 
Example #3
Source File: MessagingEndpoint.java    From watchpresenter with Apache License 2.0 6 votes vote down vote up
/**
 * Check if the user Id has, at least, one registered device
 *
 */
@ApiMethod(name = "checkRegistration")
public RegisteredResponse checkRegistration(User user) throws OAuthRequestException {
    if(user == null){
        throw new OAuthRequestException("Not authorized");
    }
    RegisteredResponse result = new RegisteredResponse();
    final String userId = PresenterRecord.getUserId(user.getEmail());
    log.info("Checking for registration. userId: " + userId);
    PresenterRecord record = ofy().load().
            key(Key.create(PresenterRecord.class, userId)).now();
    if(record != null){
        result.setRegistered(true);
    }
    return result;
}
 
Example #4
Source File: ExportCommitLogDiffAction.java    From nomulus with Apache License 2.0 6 votes vote down vote up
/**
 * Loads all the diff keys, sorted in a transaction-consistent chronological order.
 *
 * @param lowerCheckpoint exclusive lower bound on keys in this diff, or null if no lower bound
 * @param upperCheckpoint inclusive upper bound on keys in this diff
 */
private ImmutableList<Key<CommitLogManifest>> loadAllDiffKeys(
    @Nullable final CommitLogCheckpoint lowerCheckpoint,
    final CommitLogCheckpoint upperCheckpoint) {
  // Fetch the keys (no data) between these checkpoints, and sort by timestamp. This ordering is
  // transaction-consistent by virtue of our checkpoint strategy and our customized Ofy; see
  // CommitLogCheckpointStrategy for the proof. We break ties by sorting on bucket ID to ensure
  // a deterministic order.
  return upperCheckpoint
      .getBucketTimestamps()
      .keySet()
      .stream()
      .flatMap(
          bucketNum ->
              Streams.stream(loadDiffKeysFromBucket(lowerCheckpoint, upperCheckpoint, bucketNum)))
      .sorted(
          comparingLong(Key<CommitLogManifest>::getId)
              .thenComparingLong(a -> a.getParent().getId()))
      .collect(toImmutableList());
}
 
Example #5
Source File: ConferenceApiTest.java    From ud859 with GNU General Public License v3.0 6 votes vote down vote up
@Test
public void testSaveProfileWithNull() throws Exception {
    // Save the profile for the first time with null values.
    Profile profile = conferenceApi.saveProfile(user, new ProfileForm(null, null));
    String displayName = EMAIL.substring(0, EMAIL.indexOf("@"));
    // Check the return value first.
    assertEquals(USER_ID, profile.getUserId());
    assertEquals(EMAIL, profile.getMainEmail());
    assertEquals(TEE_SHIRT_SIZE, profile.getTeeShirtSize());
    assertEquals(displayName, profile.getDisplayName());
    // Fetch the Profile via Objectify.
    profile = ofy().load().key(Key.create(Profile.class, user.getUserId())).now();
    assertEquals(USER_ID, profile.getUserId());
    assertEquals(EMAIL, profile.getMainEmail());
    assertEquals(TEE_SHIRT_SIZE, profile.getTeeShirtSize());
    assertEquals(displayName, profile.getDisplayName());
}
 
Example #6
Source File: ObjectifyGalleryStorageIo.java    From appinventor-extensions with Apache License 2.0 6 votes vote down vote up
/**
 * get moderation actions associated with given reportId
 * @param reportId
 */
@Override
public List<GalleryModerationAction> getModerationActions(final long reportId){
  final List<GalleryModerationAction> moderationActions = new ArrayList<GalleryModerationAction>();
  try {
    runJobWithRetries(new JobRetryHelper() {
      @Override
      public void run(Objectify datastore) {
        Key<GalleryAppReportData> galleryReportKey = galleryReportKey(reportId);
        for (GalleryModerationActionData moderationActionData : datastore.query(GalleryModerationActionData.class)
            .ancestor(galleryReportKey).order("-date")) {
          GalleryModerationAction moderationAction = new GalleryModerationAction(reportId, moderationActionData.galleryId,
              moderationActionData.emailId, moderationActionData.moderatorId, moderationActionData.actionType,
              moderationActionData.moderatorName, moderationActionData.emailPreview, moderationActionData.date);
          moderationActions.add(moderationAction);
        }
      }
    });
  } catch (ObjectifyException e) {
      throw CrashReport.createAndLogError(LOG, null, "error in galleryStorageIo.getCommentReports", e);
  }
  return moderationActions;
}
 
Example #7
Source File: ObjectifyGalleryStorageIo.java    From appinventor-extensions with Apache License 2.0 6 votes vote down vote up
/**
 * check if gallery app is activated
 * @param galleryId the id of the gallery app
 */
@Override
public boolean isGalleryAppActivated(final long galleryId){
  final Result<Boolean> success = new Result<Boolean>();
  try {
    runJobWithRetries(new JobRetryHelper() {
      @Override
      public void run(Objectify datastore) {
          datastore = ObjectifyService.begin();
          success.t = false;
          Key<GalleryAppData> galleryKey = galleryKey(galleryId);
          GalleryAppData appData = datastore.find(galleryKey);
          if(appData != null){
            if(appData.active){
              success.t = true;
            }
          }
       }
    });
  } catch (ObjectifyException e) {
     throw CrashReport.createAndLogError(LOG, null, "error in galleryStorageIo.markReportAsResolved", e);
  }
  return success.t;
}
 
Example #8
Source File: ConferenceApi.java    From ud859 with GNU General Public License v3.0 6 votes vote down vote up
/**
 * Queries against the datastore with the given filters and returns the result.
 *
 * Normally this kind of method is supposed to get invoked by a GET HTTP method,
 * but we do it with POST, in order to receive conferenceQueryForm Object via the POST body.
 *
 * @param conferenceQueryForm A form object representing the query.
 * @return A List of Conferences that match the query.
 */
@ApiMethod(
        name = "queryConferences",
        path = "queryConferences",
        httpMethod = HttpMethod.POST
)
public List<Conference> queryConferences(ConferenceQueryForm conferenceQueryForm) {
    Iterable<Conference> conferenceIterable = conferenceQueryForm.getQuery();
    List<Conference> result = new ArrayList<>(0);
    List<Key<Profile>> organizersKeyList = new ArrayList<>(0);
    for (Conference conference : conferenceIterable) {
        organizersKeyList.add(Key.create(Profile.class, conference.getOrganizerUserId()));
        result.add(conference);
    }
    // To avoid separate datastore gets for each Conference, pre-fetch the Profiles.
    ofy().load().keys(organizersKeyList);
    return result;
}
 
Example #9
Source File: ObjectifyGalleryStorageIo.java    From appinventor-extensions with Apache License 2.0 6 votes vote down vote up
/**
 * Returns a list of reports (flags) for an app
 * @param galleryId id of gallery app
 * @param start start index
 * @param count number to return
 * @return list of {@link GalleryAppReport}
 */
@Override
public List<GalleryAppReport> getAppReports(final long galleryId, final int start, final int count) {
 final List<GalleryAppReport> reports = new ArrayList<GalleryAppReport>();
  try {
    runJobWithRetries(new JobRetryHelper() {
      @Override
      public void run(Objectify datastore) {
        Key<GalleryAppData> galleryKey = galleryKey(galleryId);
        for (GalleryAppReportData reportData : datastore.query(GalleryAppReportData.class).filter("resolved", false).order("-dateCreated").offset(start).limit(count)) {
          User reporter = storageIo.getUser(reportData.reporterId);
          User offender = storageIo.getUser(reportData.offenderId);
          GalleryApp app = getGalleryApp(galleryId);
          GalleryAppReport galleryReport = new GalleryAppReport(reportData.id,reportData.reportText, app, offender, reporter,
              reportData.dateCreated, reportData.resolved);
          reports.add(galleryReport);
        }
      }
    });
  } catch (ObjectifyException e) {
      throw CrashReport.createAndLogError(LOG, null, "error in galleryStorageIo.getAppReports", e);
  }
  return reports;
}
 
Example #10
Source File: EppResourceUtils.java    From nomulus with Apache License 2.0 6 votes vote down vote up
/**
 * Returns an asynchronous result holding the most recent Datastore revision of a given
 * EppResource before or at the provided timestamp using the EppResource revisions map, falling
 * back to using the earliest revision or the resource as-is if there are no revisions.
 *
 * @see #loadAtPointInTime(EppResource, DateTime)
 */
private static <T extends EppResource> Result<T> loadMostRecentRevisionAtTime(
    final T resource, final DateTime timestamp) {
  final Key<T> resourceKey = Key.create(resource);
  final Key<CommitLogManifest> revision = findMostRecentRevisionAtTime(resource, timestamp);
  if (revision == null) {
    logger.atSevere().log("No revision found for %s, falling back to resource.", resourceKey);
    return new ResultNow<>(resource);
  }
  final Result<CommitLogMutation> mutationResult =
      ofy().load().key(CommitLogMutation.createKey(revision, resourceKey));
  return () -> {
    CommitLogMutation mutation = mutationResult.now();
    if (mutation != null) {
      return ofy().load().fromEntity(mutation.getEntity());
    }
    logger.atSevere().log(
        "Couldn't load mutation for revision at %s for %s, falling back to resource."
            + " Revision: %s",
        timestamp, resourceKey, revision);
    return resource;
  };
}
 
Example #11
Source File: CommitLoggedWork.java    From nomulus with Apache License 2.0 6 votes vote down vote up
/** Find the set of {@link BackupGroupRoot} ancestors of the given keys. */
private Map<Key<BackupGroupRoot>, BackupGroupRoot> getBackupGroupRoots(Iterable<Key<?>> keys) {
  Set<Key<BackupGroupRoot>> rootKeys = new HashSet<>();
  for (Key<?> key : keys) {
    while (key != null
        && !BackupGroupRoot.class
            .isAssignableFrom(ofy().factory().getMetadata(key).getEntityClass())) {
      key = key.getParent();
    }
    if (key != null) {
      @SuppressWarnings("unchecked")
      Key<BackupGroupRoot> rootKey = (Key<BackupGroupRoot>) key;
      rootKeys.add(rootKey);
    }
  }
  return ImmutableMap.copyOf(ofy().load().keys(rootKeys));
}
 
Example #12
Source File: ConferenceApiTest.java    From ud859 with GNU General Public License v3.0 6 votes vote down vote up
@Test
public void testUpdateProfile() throws Exception {
    // Save for the first time.
    conferenceApi.saveProfile(user, new ProfileForm(DISPLAY_NAME, TEE_SHIRT_SIZE));
    Profile profile = ofy().load().key(Key.create(Profile.class, user.getUserId())).now();
    assertEquals(USER_ID, profile.getUserId());
    assertEquals(EMAIL, profile.getMainEmail());
    assertEquals(TEE_SHIRT_SIZE, profile.getTeeShirtSize());
    assertEquals(DISPLAY_NAME, profile.getDisplayName());
    // Then try to update it.
    String newDisplayName = "Kay's Daddy";
    TeeShirtSize newTeeShirtSize = TeeShirtSize.L;
    conferenceApi.saveProfile(user, new ProfileForm(newDisplayName, newTeeShirtSize));
    profile = ofy().load().key(Key.create(Profile.class, user.getUserId())).now();
    assertEquals(USER_ID, profile.getUserId());
    assertEquals(EMAIL, profile.getMainEmail());
    assertEquals(newTeeShirtSize, profile.getTeeShirtSize());
    assertEquals(newDisplayName, profile.getDisplayName());
}
 
Example #13
Source File: ConferenceApiTest.java    From ud859 with GNU General Public License v3.0 6 votes vote down vote up
@Test
public void testSaveProfile() throws Exception {
    // Save the profile for the first time.
    Profile profile = conferenceApi.saveProfile(
            user, new ProfileForm(DISPLAY_NAME, TEE_SHIRT_SIZE));
    // Check the return value first.
    assertEquals(USER_ID, profile.getUserId());
    assertEquals(EMAIL, profile.getMainEmail());
    assertEquals(TEE_SHIRT_SIZE, profile.getTeeShirtSize());
    assertEquals(DISPLAY_NAME, profile.getDisplayName());
    // Fetch the Profile via Objectify.
    profile = ofy().load().key(Key.create(Profile.class, user.getUserId())).now();
    assertEquals(USER_ID, profile.getUserId());
    assertEquals(EMAIL, profile.getMainEmail());
    assertEquals(TEE_SHIRT_SIZE, profile.getTeeShirtSize());
    assertEquals(DISPLAY_NAME, profile.getDisplayName());
}
 
Example #14
Source File: CourseToInstituteCache.java    From teammates with GNU General Public License v2.0 6 votes vote down vote up
public CourseToInstituteCache() {
    cache = CacheBuilder.newBuilder()
            .maximumSize(2000000) // will approximately occupy 100MB memory space
            .build(new CacheLoader<String, String>() {
                @Override
                public String load(String courseId) {
                    List<Instructor> instructors =
                            ofy().load().type(Instructor.class).filter("courseId =", courseId).list();

                    for (Instructor instructor : instructors) {
                        if (StringHelper.isEmpty(instructor.getGoogleId())) {
                            continue;
                        }

                        Account account = ofy().load().key(Key.create(Account.class, instructor.getGoogleId())).now();
                        if (account != null && !StringHelper.isEmpty(account.getInstitute())) {
                            return account.getInstitute();
                        }
                    }

                    return UNKNOWN_INSTITUTE;
                }
            });
}
 
Example #15
Source File: CommitLogManifestInput.java    From nomulus with Apache License 2.0 5 votes vote down vote up
@Override
public List<InputReader<Key<CommitLogManifest>>> createReaders() {
  ImmutableList.Builder<InputReader<Key<CommitLogManifest>>> readers =
      new ImmutableList.Builder<>();
  for (Key<CommitLogBucket> bucketKey : CommitLogBucket.getAllBucketKeys()) {
    readers.add(bucketToReader(bucketKey));
  }
  return readers.build();
}
 
Example #16
Source File: ConferenceApiTest.java    From ud859 with GNU General Public License v3.0 5 votes vote down vote up
@Test
public void testGetProfileFirstTime() throws Exception {
    Profile profile = ofy().load().key(Key.create(Profile.class, user.getUserId())).now();
    assertNull(profile);
    profile = conferenceApi.getProfile(user);
    assertNull(profile);
}
 
Example #17
Source File: BackupTestStore.java    From nomulus with Apache License 2.0 5 votes vote down vote up
private void exportOneKind(File perKindFile, Class<?> pojoType, Set<Key<?>> excludes)
    throws IOException {
  LevelDbFileBuilder builder = new LevelDbFileBuilder(perKindFile);
  for (Object pojo : ofy().load().type(pojoType).iterable()) {
    if (!excludes.contains(Key.create(pojo))) {
      try {
        // Must preserve UpdateTimestamp. Do not use ofy().save().toEntity(pojo)!
        builder.addEntity(datastoreService.get(Key.create(pojo).getRaw()));
      } catch (Exception e) {
        throw new RuntimeException(e);
      }
    }
  }
  builder.build();
}
 
Example #18
Source File: ClaimsListShard.java    From nomulus with Apache License 2.0 5 votes vote down vote up
@VisibleForTesting
public static Key<ClaimsListRevision> createKey(ClaimsListSingleton singleton) {
  ClaimsListRevision revision = new ClaimsListRevision();
  revision.versionId = allocateId();
  revision.parent = Key.create(singleton);
  return Key.create(revision);
}
 
Example #19
Source File: BillingEventTest.java    From nomulus with Apache License 2.0 5 votes vote down vote up
@Test
public void testSuccess_cancellation_forGracePeriod_withRecurring() {
  BillingEvent.Cancellation newCancellation = BillingEvent.Cancellation.forGracePeriod(
      GracePeriod.createForRecurring(
          GracePeriodStatus.AUTO_RENEW,
          now.plusYears(1).plusDays(45),
          "a registrar",
          Key.create(recurring)),
      historyEntry2,
      "foo.tld");
  // Set ID to be the same to ignore for the purposes of comparison.
  newCancellation = newCancellation.asBuilder().setId(cancellationRecurring.getId()).build();
  assertThat(newCancellation).isEqualTo(cancellationRecurring);
}
 
Example #20
Source File: SignGuestbookServletTest.java    From java-docs-samples with Apache License 2.0 5 votes vote down vote up
@Test
public void doPost_userNotLoggedIn() throws Exception {
  servletUnderTest.doPost(mockRequest, mockResponse);

  Greeting greeting = ObjectifyService.ofy().load().type(Greeting.class)
      .ancestor(Key.create(Guestbook.class, "default2")).first().now();
  assertEquals(greeting.content, testPhrase);
}
 
Example #21
Source File: EntitiesDb.java    From teammates with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates a key from a web safe string.
 */
protected Optional<Key<E>> makeKeyFromWebSafeString(String webSafeString) {
    if (webSafeString == null) {
        return Optional.empty();
    }
    try {
        return Optional.of(Key.create(webSafeString));
    } catch (IllegalArgumentException e) {
        return Optional.empty();
    }
}
 
Example #22
Source File: ShardedCounterServiceImplTest.java    From appengine-counter with Apache License 2.0 5 votes vote down vote up
@Test(expected = IllegalArgumentException.class)
public void testDecrementCounterOperationResult_NegativeAmount()
{
	final UUID operationUuid = UUID.randomUUID();
	final Key<CounterData> counterDataKey = CounterData.key(TEST_COUNTER1);
	final Key<CounterShardData> counterShardDataKey = CounterShardData.key(counterDataKey, 0);
	new CounterOperation.Impl(operationUuid, counterShardDataKey, CounterOperationType.DECREMENT, -1,
		DateTime.now(DateTimeZone.UTC), false);
}
 
Example #23
Source File: BillingEvent.java    From nomulus with Apache License 2.0 5 votes vote down vote up
public static VKey<Modification> createVKey(Key<Modification> key) {
  // TODO(b/159207551): As it stands, the SQL key generated here doesn't mesh with the primary
  // key type for the table, which is a single long integer.
  if (key == null) {
    return null;
  }
  String path =
      key.getParent().getParent().getName() + "/" + key.getParent().getId() + "/" + key.getId();
  return VKey.create(Modification.class, path, key);
}
 
Example #24
Source File: RdapSearchActionBase.java    From nomulus with Apache License 2.0 5 votes vote down vote up
/** Handles searches by key using a simple string. */
static <T extends EppResource> Query<T> queryItemsByKey(
    Class<T> clazz,
    String queryString,
    DeletedItemHandling deletedItemHandling,
    int resultSetMaxSize) {
  if (queryString.length() < RdapSearchPattern.MIN_INITIAL_STRING_LENGTH) {
    throw new UnprocessableEntityException(
        String.format(
            "Initial search string must be at least %d characters",
            RdapSearchPattern.MIN_INITIAL_STRING_LENGTH));
  }
  Query<T> query = ofy().load().type(clazz).filterKey("=", Key.create(clazz, queryString));
  return setOtherQueryAttributes(query, deletedItemHandling, resultSetMaxSize);
}
 
Example #25
Source File: Ofy.java    From nomulus with Apache License 2.0 5 votes vote down vote up
/**
 * Returns the @Entity-annotated base class for an object that is either an {@code Key<?>} or an
 * object of an entity class registered with Objectify.
 */
@VisibleForTesting
static Class<?> getBaseEntityClassFromEntityOrKey(Object entityOrKey) {
  // Convert both keys and entities into keys, so that we get consistent behavior in either case.
  Key<?> key = (entityOrKey instanceof Key<?> ? (Key<?>) entityOrKey : Key.create(entityOrKey));
  // Get the entity class associated with this key's kind, which should be the base @Entity class
  // from which the kind name is derived.  Don't be tempted to use getMetadata(String kind) or
  // getMetadataForEntity(T pojo) instead; the former won't throw an exception for an unknown
  // kind (it just returns null) and the latter will return the @EntitySubclass if there is one.
  return ofy().factory().getMetadata(key).getEntityClass();
}
 
Example #26
Source File: CommitLogMutationTest.java    From nomulus with Apache License 2.0 5 votes vote down vote up
@Test
public void test_create_createsExpectedMutation() {
  Entity rawEntity = convertToEntityInTxn(someObject);
  // Needs to be in a transaction so that registry-saving-to-entity will work.
  CommitLogMutation mutation =
      tm().transact(() -> CommitLogMutation.create(manifestKey, someObject));
  assertThat(Key.create(mutation))
      .isEqualTo(CommitLogMutation.createKey(manifestKey, Key.create(someObject)));
  assertThat(mutation.getEntity()).isEqualTo(rawEntity);
  assertThat(EntityTranslator.createFromPbBytes(mutation.getEntityProtoBytes()))
      .isEqualTo(rawEntity);
}
 
Example #27
Source File: AllocationTokenTest.java    From nomulus with Apache License 2.0 5 votes vote down vote up
@Test
public void testBuild_redemptionHistoryEntryOnlyInSingleUse() {
  AllocationToken.Builder builder =
      new AllocationToken.Builder()
          .setToken("foobar")
          .setTokenType(TokenType.UNLIMITED_USE)
          .setRedemptionHistoryEntry(Key.create(HistoryEntry.class, "hi"));
  IllegalArgumentException thrown = assertThrows(IllegalArgumentException.class, builder::build);
  assertThat(thrown)
      .hasMessageThat()
      .isEqualTo("Redemption history entry can only be specified for SINGLE_USE tokens");
}
 
Example #28
Source File: KeyJsonDeserializer.java    From gwt-jackson with Apache License 2.0 5 votes vote down vote up
@Override
protected Key<T> doDeserialize( JsonReader reader, JsonDeserializationContext ctx, JsonDeserializerParameters params ) {
    reader.beginObject();
    if ( !KeyConstant.RAW.equals( reader.nextName() ) ) {
        throw ctx.traceError( "Missing " + KeyConstant.RAW + " property.", reader );
    }
    com.google.appengine.api.datastore.Key raw = RawKeyJsonDeserializer.getInstance().deserialize( reader, ctx, params );
    reader.endObject();
    return Key.create( raw );
}
 
Example #29
Source File: KmsUpdaterTest.java    From nomulus with Apache License 2.0 5 votes vote down vote up
private static void verifySecretAndSecretRevisionWritten(
    String secretName, String expectedCryptoKeyVersionName, String expectedEncryptedValue) {
  KmsSecret secret =
      ofy().load().key(Key.create(getCrossTldKey(), KmsSecret.class, secretName)).now();
  assertThat(secret).isNotNull();
  KmsSecretRevision secretRevision = ofy().load().key(secret.getLatestRevision()).now();
  assertThat(secretRevision.getKmsCryptoKeyVersionName()).isEqualTo(expectedCryptoKeyVersionName);
  assertThat(secretRevision.getEncryptedValue()).isEqualTo(expectedEncryptedValue);
}
 
Example #30
Source File: EppResourceBaseInput.java    From nomulus with Apache License 2.0 5 votes vote down vote up
@Override
public List<InputReader<I>> createReaders() {
  ImmutableList.Builder<InputReader<I>> readers = new ImmutableList.Builder<>();
  for (Key<EppResourceIndexBucket> bucketKey : EppResourceIndexBucket.getAllBuckets()) {
    readers.add(bucketToReader(bucketKey));
  }
  return readers.build();
}