michaellavelle / spring-data-dynamodb

Simplifies the development of creating an Amazon DynamoDB-based Java data access layer
https://derjust.github.io/spring-data-dynamodb/
Apache License 2.0
169 stars 284 forks source link

Updated Test case #68

Closed ascooper57 closed 4 years ago

ascooper57 commented 8 years ago

package org.socialsignin.springframework.data.dynamodb.demo.repository;

import org.junit.Test; import org.junit.runner.RunWith; import org.socialsignin.springframework.data.dynamodb.demo.domain.User; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.test.context.web.WebAppConfiguration; import java.util.List; import static org.junit.Assert.assertThat; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.Matchers.hasItem;

@RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration("classpath:spring-servlet.xml") @WebAppConfiguration public class UserRepositoryIntegrationTest {

@Autowired
UserRepository repository;

@Test
public void sampleTestCase() {
    repository.deleteAll();

    User dave = new User("Dave", "Matthews");
    repository.save(dave);

    User carter = new User("Carter", "Beauford");
    repository.save(carter);

    List<User> result = repository.findByLastName("Matthews");
    assertThat(result.size(), is(1));
    ///assertThat(result, hasItem(dave));
}

}

derjust commented 8 years ago

What exactly does this new unit test code helps for? Please use derjust#19 for followup comments.

As (privately) communicated with @michaellavelle, the project will continue under https://github.com/derjust/spring-data-dynamodb.