Jean-Francois Leveque

Tour des tests pour when/should.

......@@ -47,7 +47,7 @@ public class ListPublisherActionsViewTest {
}
@Test
@DisplayName("should show all")
@DisplayName("when publisher is not set, should be in all actions no filter state")
public void showAll(@Mock PublisherService publisherServiceMock) {
listPublisherActionsView.setPublisherId(null);
listPublisherActionsView.setViewAll(false);
......@@ -58,7 +58,7 @@ public class ListPublisherActionsViewTest {
}
@Test
@DisplayName("should show filtered")
@DisplayName("when publisher is set, should be in filtered not all actions state")
public void showFiltered(@Mock PublisherService publisherServiceMock) {
listPublisherActionsView.setPublisherId(1);
listPublisherActionsView.setViewAll(true);
......@@ -70,7 +70,7 @@ public class ListPublisherActionsViewTest {
}
@Test
@DisplayName("filterId should filter")
@DisplayName("when publisher is set, should show only its actions")
public void testFilter(@Mock PublisherService publisherServiceMock) {
List<PublisherAction> publisherActions = new ArrayList<PublisherAction>();
......
......@@ -76,7 +76,7 @@ public class ListPublisherVersionsViewTest {
}
@Test
@DisplayName("List of all versions")
@DisplayName("when publisher is not set, should list all versions")
public void testSetViewAll() {
listPublisherVersionsView.setPublisherId(null);
listPublisherVersionsView.setView();
......@@ -86,7 +86,7 @@ public class ListPublisherVersionsViewTest {
}
@Test
@DisplayName("List of a pulisher's versions")
@DisplayName("when publisher is set, should list pulisher's versions")
public void testSetViewNotAllAlsoTestingFilterOnId() {
listPublisherVersionsView.setPublisherId(1);
listPublisherVersionsView.setView();
......@@ -96,7 +96,7 @@ public class ListPublisherVersionsViewTest {
}
@Test
@DisplayName("Validates a publisher version using service")
@DisplayName("when validating a publisher version, should call service method")
public void testValidate() {
listPublisherVersionsView.setPublisherId(0);
listPublisherVersionsView.validate(publisherVersion2);
......@@ -104,13 +104,13 @@ public class ListPublisherVersionsViewTest {
}
@Test
@DisplayName("Gets last validate for a publisher")
@DisplayName("when requested the last validate for a publisher, should call service method")
public void testGetLastValidate() {
assertThat(listPublisherVersionsView.getLastValidate(publisher)).isEqualTo(publisherAction);
}
@Test
@DisplayName("Returns null when publisher has no validate action")
@DisplayName("when requested the last validate for a publisher that has none, should get null")
public void testGetLastValidateNull() {
assertThat(listPublisherVersionsView.getLastValidate(publisher1)).isNull();
}
......
......@@ -37,7 +37,7 @@ public class AddCountryViewTest {
}
@Test
@DisplayName("uses the SharedService add with right argument")
@DisplayName("should use the SharedService with right argument when a country is added")
public void testSharedServiceAdd(@Mock SharedService sharedServiceMock) {
Mockito.verify(sharedServiceMock).addCountry(countryArgumentCaptor.capture());
Country country = countryArgumentCaptor.getValue();
......