Skip to content

Commit 7d7ecb8

Browse files
committed
Added integration test for saving Accounts.
1 parent 81269e7 commit 7d7ecb8

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

spring-data-jpa-showcase/src/test/java/org/springframework/data/jpa/showcase/after/AccountRepositoryIntegrationTest.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package org.springframework.data.jpa.showcase.after;
22

3-
import static org.hamcrest.Matchers.*;
3+
import static org.hamcrest.CoreMatchers.*;
44
import static org.junit.Assert.*;
55

66
import java.util.List;
@@ -24,6 +24,13 @@ public class AccountRepositoryIntegrationTest extends AbstractShowcaseTest {
2424
@Autowired
2525
CustomerRepository customerRepository;
2626

27+
@Test
28+
public void savesAccount() {
29+
30+
Account account = accountRepository.save(new Account());
31+
assertThat(account.getId(), is(notNullValue()));
32+
}
33+
2734
@Test
2835
public void findsCustomersAccounts() {
2936

spring-data-jpa-showcase/src/test/java/org/springframework/data/jpa/showcase/before/AccountServiceIntegrationTest.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,13 @@ public class AccountServiceIntegrationTest extends AbstractShowcaseTest {
2424
@Autowired
2525
CustomerService customerService;
2626

27+
@Test
28+
public void savesAccount() {
29+
30+
Account account = accountService.save(new Account());
31+
assertThat(account.getId(), is(notNullValue()));
32+
}
33+
2734
@Test
2835
public void testname() throws Exception {
2936

0 commit comments

Comments
 (0)