-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
106 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
src/integrationTest/java/cloud/cosmin/checklister/ItemUpdateIT.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package cloud.cosmin.checklister; | ||
|
||
import cloud.cosmin.checklister.dto.ItemPostDto; | ||
import org.junit.Test; | ||
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; | ||
import org.springframework.boot.test.context.SpringBootTest; | ||
|
||
import java.util.UUID; | ||
|
||
import static org.junit.Assert.assertEquals; | ||
import static org.junit.Assert.assertNotNull; | ||
|
||
public class ItemUpdateIT extends BaseIT { | ||
@Test | ||
public void itemUpdate() { | ||
var newList = createList("testlist"); | ||
var itemPost = new ItemPostDto("content", "text/plain", null); | ||
UUID itemId; | ||
{ | ||
var itemAdded = addItem(newList.getId(), itemPost); | ||
assertNotNull(itemAdded); | ||
assertEquals("content", itemAdded.getContent()); | ||
assertEquals("text/plain", itemAdded.getContentType()); | ||
assertEquals(0, itemAdded.getRank()); | ||
itemId = itemAdded.getId(); | ||
}{ | ||
itemPost.setContent("content1"); | ||
itemPost.setContentType("application/json"); | ||
var itemAdded = addItem(newList.getId(), itemPost); | ||
assertNotNull(itemAdded); | ||
assertEquals("content1", itemAdded.getContent()); | ||
assertEquals("application/json", itemAdded.getContentType()); | ||
assertEquals(1, itemAdded.getRank()); | ||
}{ | ||
var item = getItem(itemId); | ||
assertEquals("content", item.getContent()); | ||
assertEquals("text/plain", item.getContentType()); | ||
assertEquals(0, item.getRank()); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters