Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 28 additions & 28 deletions test/ru/javawebinar/basejava/storage/AbstractArrayStorageTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ public void update() throws Exception {
Assertions.assertSame(newResume, storage.get(UUID_1));
}

@Test
public void updateNotExist() throws Exception {
Assertions.assertThrows(NotExistStorageException.class,
() -> storage.get("dummy"));
}

@Test
public void size() throws Exception {
assertSize(3);
Expand All @@ -53,33 +59,6 @@ public void save() throws Exception {
assertGet(RESUME_4);
}

@Test
public void delete() throws Exception {
storage.delete(UUID_1);
assertSize(2);
Assertions.assertThrows(NotExistStorageException.class,
() -> storage.delete(UUID_1));
}

@Test
public void get() throws Exception {
assertGet(RESUME_1);
assertGet(RESUME_2);
assertGet(RESUME_3);
}

@Test
public void getNotExist() throws Exception {
Assertions.assertThrows(NotExistStorageException.class,
() -> storage.get("dummy"));
}

@Test
public void deleteNotExist() throws Exception {
Assertions.assertThrows(NotExistStorageException.class,
() -> storage.delete("dummy"));
}

@Test
public void saveExist() throws Exception {
Assertions.assertThrows(ExistStorageException.class,
Expand All @@ -100,7 +79,28 @@ public void saveOverflow() throws Exception {
}

@Test
public void updateNotExist() throws Exception {
public void delete() throws Exception {
storage.delete(UUID_1);
assertSize(2);
Assertions.assertThrows(NotExistStorageException.class,
() -> storage.delete(UUID_1));
}

@Test
public void deleteNotExist() throws Exception {
Assertions.assertThrows(NotExistStorageException.class,
() -> storage.delete("dummy"));
}

@Test
public void get() throws Exception {
assertGet(RESUME_1);
assertGet(RESUME_2);
assertGet(RESUME_3);
}

@Test
public void getNotExist() throws Exception {
Assertions.assertThrows(NotExistStorageException.class,
() -> storage.get("dummy"));
}
Expand Down