Skip to content

Commit

Permalink
Fix enum naming convention.
Browse files Browse the repository at this point in the history
Signed-off-by: Danny Baumann <[email protected]>
  • Loading branch information
maniac103 committed Sep 25, 2023
1 parent 667dae5 commit d8ce4c5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,17 @@
* @author Danny Baumann - Initial contribution
*/
public enum WidgetLabelSource {
SitemapDefinition,
ItemLabel,
None;
SITEMAP,
ITEM,
NONE;

public static WidgetLabelSource forWidget(Widget w, String label) {
if (label == null || label.isEmpty()) {
return None;
return NONE;
} else if (w.getLabel() != null) {
return SitemapDefinition;
return SITEMAP;
} else {
return ItemLabel;
return ITEM;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ public void whenGetPageDataShouldReturnPageBean() throws ItemNotFoundException {

assertThat(pageDTO.widgets.get(0).widgetId, is(WIDGET1_ID));
assertThat(pageDTO.widgets.get(0).label, is(WIDGET1_LABEL));
assertThat(pageDTO.widgets.get(0).labelSource, is(WidgetLabelSource.SitemapDefinition));
assertThat(pageDTO.widgets.get(0).labelSource, is(WidgetLabelSource.SITEMAP));
assertThat(pageDTO.widgets.get(0).labelcolor, is("GREEN"));
assertThat(pageDTO.widgets.get(0).valuecolor, is("BLUE"));
assertThat(pageDTO.widgets.get(0).iconcolor, is("ORANGE"));
Expand All @@ -284,7 +284,7 @@ public void whenGetPageDataShouldReturnPageBean() throws ItemNotFoundException {

assertThat(pageDTO.widgets.get(1).widgetId, is(WIDGET2_ID));
assertThat(pageDTO.widgets.get(1).label, is(ITEM_LABEL));
assertThat(pageDTO.widgets.get(1).labelSource, is(WidgetLabelSource.ItemLabel));
assertThat(pageDTO.widgets.get(1).labelSource, is(WidgetLabelSource.ITEM));
assertThat(pageDTO.widgets.get(1).labelcolor, nullValue());
assertThat(pageDTO.widgets.get(1).valuecolor, nullValue());
assertThat(pageDTO.widgets.get(1).iconcolor, nullValue());
Expand Down

0 comments on commit d8ce4c5

Please sign in to comment.