Exemplo n.º 1
0
  @Test
  public void save() {
    Map<String, List<String>> properties = new HashMap<String, List<String>>();
    properties.put("type", Arrays.asList("video", "show"));

    DBObject object = new DBObject();
    object.setObjectId("testId");
    object.setDate(new Date());
    object.setObjectProperties(properties);

    datastore.save(object);

    assertThat(datastore.find(DBObject.class).countAll()).isEqualTo(1);
    DBObject dbObject = datastore.find(DBObject.class).field("objectId").equal("testId").get();
    assertThat(dbObject.getObjectProperties() == properties);
  }
Exemplo n.º 2
0
  @Test
  public void containsValue() {
    DBObject object = DBObject.fromObject(TestData.testObject());

    assertThat(object.containsValue("musique")).isTrue();
  }