@Override
  public boolean equals(Object obj) {
    if (this == obj) return true;
    if (obj == null) return false;

    if (obj instanceof DescribeTableRequest == false) return false;
    DescribeTableRequest other = (DescribeTableRequest) obj;

    if (other.getTableName() == null ^ this.getTableName() == null) return false;
    if (other.getTableName() != null && other.getTableName().equals(this.getTableName()) == false)
      return false;
    return true;
  }
Ejemplo n.º 2
0
 @Override
 public DescribeTableResult describeTable(DescribeTableRequest describeTableRequest) {
   this.describeTableRequest = describeTableRequest;
   String tableName = describeTableRequest.getTableName();
   if ("activeTable".equals(tableName)) {
     return tableWithStatus(TableStatus.ACTIVE);
   } else if ("creatibleTable".equals(tableName) && createTableRequest != null) {
     return tableWithStatus(TableStatus.ACTIVE);
   } else if ("FULL_DESCRIBE_TABLE".equals(tableName)) {
     return new DescribeTableResult()
         .withTable(
             new TableDescription()
                 .withTableName(tableName)
                 .withTableStatus(TableStatus.ACTIVE)
                 .withCreationDateTime(new Date(NOW))
                 .withItemCount(100L)
                 .withKeySchema(new KeySchemaElement().withAttributeName("name"))
                 .withProvisionedThroughput(
                     new ProvisionedThroughputDescription()
                         .withReadCapacityUnits(20L)
                         .withWriteCapacityUnits(10L))
                 .withTableSizeBytes(1000L));
   }
   throw new ResourceNotFoundException(tableName + " is missing");
 }