Skip to content
This repository has been archived by the owner on Jul 29, 2021. It is now read-only.

Commit

Permalink
feat(view): add picture to a portal view
Browse files Browse the repository at this point in the history
  • Loading branch information
tcompiegne authored and brasseld committed Feb 5, 2019
1 parent d22ee39 commit 742d81a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/test/java/io/gravitee/repository/ViewRepositoryTest.java
Expand Up @@ -24,6 +24,10 @@

import static org.junit.Assert.*;

/**
* @author Titouan COMPIEGNE (titouan.compiegne at graviteesource.com)
* @author GraviteeSource Team
*/
public class ViewRepositoryTest extends AbstractRepositoryTest {

@Override
Expand All @@ -50,6 +54,7 @@ public void shouldCreate() throws Exception {
view.setHidden(true);
view.setOrder(1);
view.setDefaultView(true);
view.setPicture("New picture");

int nbViewsBeforeCreation = viewRepository.findAll().size();
viewRepository.create(view);
Expand All @@ -68,6 +73,7 @@ public void shouldCreate() throws Exception {
Assert.assertEquals("Invalid view hidden.", view.isHidden(), viewSaved.isHidden());
Assert.assertEquals("Invalid view order.", view.getOrder(), viewSaved.getOrder());
Assert.assertEquals("Invalid view defaultView.", view.isDefaultView(), viewSaved.isDefaultView());
Assert.assertEquals("Invalid view picture.", "New picture", viewSaved.getPicture());
}

@Test
Expand All @@ -85,6 +91,7 @@ public void shouldUpdate() throws Exception {
view.setCreatedAt(new Date(1486771200000L));
view.setUpdatedAt(new Date(1486771200000L));
view.setHighlightApi("new Highlighted API");
view.setPicture("New picture");

int nbViewsBeforeUpdate = viewRepository.findAll().size();
viewRepository.update(view);
Expand All @@ -104,6 +111,7 @@ public void shouldUpdate() throws Exception {
Assert.assertEquals("Invalid view order.", view.getOrder(), viewUpdated.getOrder());
Assert.assertEquals("Invalid view defaultView.", view.isDefaultView(), viewUpdated.isDefaultView());
Assert.assertEquals("Invalid view highlight API.", view.getHighlightApi(), viewUpdated.getHighlightApi());
Assert.assertEquals("Invalid view picture.", "New picture", viewUpdated.getPicture());
}

@Test
Expand Down
Expand Up @@ -48,6 +48,7 @@ void prepare(ViewRepository viewRepository) throws Exception {
when(newView.isHidden()).thenReturn(true);
when(newView.getOrder()).thenReturn(1);
when(newView.isDefaultView()).thenReturn(true);
when(newView.getPicture()).thenReturn("New picture");


final View viewProducts = new View();
Expand All @@ -68,6 +69,7 @@ void prepare(ViewRepository viewRepository) throws Exception {
when(viewProductsUpdated.getOrder()).thenReturn(10);
when(viewProductsUpdated.isDefaultView()).thenReturn(true);
when(viewProductsUpdated.getHighlightApi()).thenReturn("new Highlighted API");
when(viewProductsUpdated.getPicture()).thenReturn("New picture");

final Set<View> views = newSet(newView, viewProducts, mock(View.class));
final Set<View> viewsAfterDelete = newSet(newView, viewProducts);
Expand Down

0 comments on commit 742d81a

Please sign in to comment.