From 0a687733c67dbb49f17773b371c652bb3a5234d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vicen=C3=ADkov=C3=A1=20Jitka?= <Jitka.Vicenikova@partners.cz> Date: Tue, 11 Apr 2023 12:49:39 +0200 Subject: [PATCH] refactor --- .editorconfig | 36 ++-- README.md | 53 +++-- application/pom.xml | 194 ++++++++--------- .../pa165/rest/ApplicationController.java | 130 ++++++------ .../pa165/rest/ApplicationControllerTest.java | 5 +- .../cz/muni/pa165/rest/IntegrationTests.java | 36 ++-- core/pom.xml | 200 +++++++++--------- .../src/main/resources/application.properties | 2 - core/src/test/resources/logback.xml | 20 +- .../pa165/rest/NotificationController.java | 2 +- .../cz/muni/pa165/rest/IntegrationTests.java | 36 ++-- pom.xml | 184 ++++++++-------- visualization/pom.xml | 190 ++++++++--------- .../pa165/rest/VisualizationController.java | 16 +- .../cz/muni/pa165/rest/IntegrationTests.java | 36 ++-- .../rest/VisualizationControllerTest.java | 20 +- 16 files changed, 593 insertions(+), 567 deletions(-) diff --git a/.editorconfig b/.editorconfig index 4e4147d..d54ff1a 100644 --- a/.editorconfig +++ b/.editorconfig @@ -28,7 +28,7 @@ ij_css_hex_color_upper_case = false ij_css_keep_blank_lines_in_code = 2 ij_css_keep_indents_on_empty_lines = false ij_css_keep_single_line_blocks = false -ij_css_properties_order = font,font-family,font-size,font-weight,font-style,font-variant,font-size-adjust,font-stretch,line-height,position,z-index,top,right,bottom,left,display,visibility,float,clear,overflow,overflow-x,overflow-y,clip,zoom,align-content,align-items,align-self,flex,flex-flow,flex-basis,flex-direction,flex-grow,flex-shrink,flex-wrap,justify-content,order,box-sizing,width,min-width,max-width,height,min-height,max-height,margin,margin-top,margin-right,margin-bottom,margin-left,padding,padding-top,padding-right,padding-bottom,padding-left,table-layout,empty-cells,caption-side,border-spacing,border-collapse,list-style,list-style-position,list-style-type,list-style-image,content,quotes,counter-reset,counter-increment,resize,cursor,user-select,nav-index,nav-up,nav-right,nav-down,nav-left,transition,transition-delay,transition-timing-function,transition-duration,transition-property,transform,transform-origin,animation,animation-name,animation-duration,animation-play-state,animation-timing-function,animation-delay,animation-iteration-count,animation-direction,text-align,text-align-last,vertical-align,white-space,text-decoration,text-emphasis,text-emphasis-color,text-emphasis-style,text-emphasis-position,text-indent,text-justify,letter-spacing,word-spacing,text-outline,text-transform,text-wrap,text-overflow,text-overflow-ellipsis,text-overflow-mode,word-wrap,word-break,tab-size,hyphens,pointer-events,opacity,color,border,border-width,border-style,border-color,border-top,border-top-width,border-top-style,border-top-color,border-right,border-right-width,border-right-style,border-right-color,border-bottom,border-bottom-width,border-bottom-style,border-bottom-color,border-left,border-left-width,border-left-style,border-left-color,border-radius,border-top-left-radius,border-top-right-radius,border-bottom-right-radius,border-bottom-left-radius,border-image,border-image-source,border-image-slice,border-image-width,border-image-outset,border-image-repeat,outline,outline-width,outline-style,outline-color,outline-offset,background,background-color,background-image,background-repeat,background-attachment,background-position,background-position-x,background-position-y,background-clip,background-origin,background-size,box-decoration-break,box-shadow,text-shadow +ij_css_properties_order = font, font-family, font-size, font-weight, font-style, font-variant, font-size-adjust, font-stretch, line-height, position, z-index, top, right, bottom, left, display, visibility, float, clear, overflow, overflow-x, overflow-y, clip, zoom, align-content, align-items, align-self, flex, flex-flow, flex-basis, flex-direction, flex-grow, flex-shrink, flex-wrap, justify-content, order, box-sizing, width, min-width, max-width, height, min-height, max-height, margin, margin-top, margin-right, margin-bottom, margin-left, padding, padding-top, padding-right, padding-bottom, padding-left, table-layout, empty-cells, caption-side, border-spacing, border-collapse, list-style, list-style-position, list-style-type, list-style-image, content, quotes, counter-reset, counter-increment, resize, cursor, user-select, nav-index, nav-up, nav-right, nav-down, nav-left, transition, transition-delay, transition-timing-function, transition-duration, transition-property, transform, transform-origin, animation, animation-name, animation-duration, animation-play-state, animation-timing-function, animation-delay, animation-iteration-count, animation-direction, text-align, text-align-last, vertical-align, white-space, text-decoration, text-emphasis, text-emphasis-color, text-emphasis-style, text-emphasis-position, text-indent, text-justify, letter-spacing, word-spacing, text-outline, text-transform, text-wrap, text-overflow, text-overflow-ellipsis, text-overflow-mode, word-wrap, word-break, tab-size, hyphens, pointer-events, opacity, color, border, border-width, border-style, border-color, border-top, border-top-width, border-top-style, border-top-color, border-right, border-right-width, border-right-style, border-right-color, border-bottom, border-bottom-width, border-bottom-style, border-bottom-color, border-left, border-left-width, border-left-style, border-left-color, border-radius, border-top-left-radius, border-top-right-radius, border-bottom-right-radius, border-bottom-left-radius, border-image, border-image-source, border-image-slice, border-image-width, border-image-outset, border-image-repeat, outline, outline-width, outline-style, outline-color, outline-offset, background, background-color, background-image, background-repeat, background-attachment, background-position, background-position-x, background-position-y, background-clip, background-origin, background-size, box-decoration-break, box-shadow, text-shadow ij_css_space_after_colon = true ij_css_space_before_opening_brace = true ij_css_use_double_quotes = true @@ -144,7 +144,7 @@ ij_java_for_statement_wrap = off ij_java_generate_final_locals = false ij_java_generate_final_parameters = false ij_java_if_brace_force = never -ij_java_imports_layout = *,|,javax.**,java.**,|,$* +ij_java_imports_layout = *, |, javax.**, java.**, |, $* ij_java_indent_case_from_switch = true ij_java_insert_inner_class_imports = false ij_java_insert_override_annotation = true @@ -182,7 +182,7 @@ ij_java_multi_catch_types_wrap = normal ij_java_names_count_to_use_import_on_demand = 3 ij_java_new_line_after_lparen_in_annotation = false ij_java_new_line_after_lparen_in_record_header = false -ij_java_packages_to_use_import_on_demand = java.awt.*,javax.swing.* +ij_java_packages_to_use_import_on_demand = java.awt.*, javax.swing.* ij_java_parameter_annotation_wrap = off ij_java_parentheses_expression_new_line_after_left_paren = false ij_java_parentheses_expression_right_paren_on_new_line = false @@ -318,7 +318,7 @@ ij_less_keep_indents_on_empty_lines = false ij_less_keep_single_line_blocks = false ij_less_line_comment_add_space = false ij_less_line_comment_at_first_column = false -ij_less_properties_order = font,font-family,font-size,font-weight,font-style,font-variant,font-size-adjust,font-stretch,line-height,position,z-index,top,right,bottom,left,display,visibility,float,clear,overflow,overflow-x,overflow-y,clip,zoom,align-content,align-items,align-self,flex,flex-flow,flex-basis,flex-direction,flex-grow,flex-shrink,flex-wrap,justify-content,order,box-sizing,width,min-width,max-width,height,min-height,max-height,margin,margin-top,margin-right,margin-bottom,margin-left,padding,padding-top,padding-right,padding-bottom,padding-left,table-layout,empty-cells,caption-side,border-spacing,border-collapse,list-style,list-style-position,list-style-type,list-style-image,content,quotes,counter-reset,counter-increment,resize,cursor,user-select,nav-index,nav-up,nav-right,nav-down,nav-left,transition,transition-delay,transition-timing-function,transition-duration,transition-property,transform,transform-origin,animation,animation-name,animation-duration,animation-play-state,animation-timing-function,animation-delay,animation-iteration-count,animation-direction,text-align,text-align-last,vertical-align,white-space,text-decoration,text-emphasis,text-emphasis-color,text-emphasis-style,text-emphasis-position,text-indent,text-justify,letter-spacing,word-spacing,text-outline,text-transform,text-wrap,text-overflow,text-overflow-ellipsis,text-overflow-mode,word-wrap,word-break,tab-size,hyphens,pointer-events,opacity,color,border,border-width,border-style,border-color,border-top,border-top-width,border-top-style,border-top-color,border-right,border-right-width,border-right-style,border-right-color,border-bottom,border-bottom-width,border-bottom-style,border-bottom-color,border-left,border-left-width,border-left-style,border-left-color,border-radius,border-top-left-radius,border-top-right-radius,border-bottom-right-radius,border-bottom-left-radius,border-image,border-image-source,border-image-slice,border-image-width,border-image-outset,border-image-repeat,outline,outline-width,outline-style,outline-color,outline-offset,background,background-color,background-image,background-repeat,background-attachment,background-position,background-position-x,background-position-y,background-clip,background-origin,background-size,box-decoration-break,box-shadow,text-shadow +ij_less_properties_order = font, font-family, font-size, font-weight, font-style, font-variant, font-size-adjust, font-stretch, line-height, position, z-index, top, right, bottom, left, display, visibility, float, clear, overflow, overflow-x, overflow-y, clip, zoom, align-content, align-items, align-self, flex, flex-flow, flex-basis, flex-direction, flex-grow, flex-shrink, flex-wrap, justify-content, order, box-sizing, width, min-width, max-width, height, min-height, max-height, margin, margin-top, margin-right, margin-bottom, margin-left, padding, padding-top, padding-right, padding-bottom, padding-left, table-layout, empty-cells, caption-side, border-spacing, border-collapse, list-style, list-style-position, list-style-type, list-style-image, content, quotes, counter-reset, counter-increment, resize, cursor, user-select, nav-index, nav-up, nav-right, nav-down, nav-left, transition, transition-delay, transition-timing-function, transition-duration, transition-property, transform, transform-origin, animation, animation-name, animation-duration, animation-play-state, animation-timing-function, animation-delay, animation-iteration-count, animation-direction, text-align, text-align-last, vertical-align, white-space, text-decoration, text-emphasis, text-emphasis-color, text-emphasis-style, text-emphasis-position, text-indent, text-justify, letter-spacing, word-spacing, text-outline, text-transform, text-wrap, text-overflow, text-overflow-ellipsis, text-overflow-mode, word-wrap, word-break, tab-size, hyphens, pointer-events, opacity, color, border, border-width, border-style, border-color, border-top, border-top-width, border-top-style, border-top-color, border-right, border-right-width, border-right-style, border-right-color, border-bottom, border-bottom-width, border-bottom-style, border-bottom-color, border-left, border-left-width, border-left-style, border-left-color, border-radius, border-top-left-radius, border-top-right-radius, border-bottom-right-radius, border-bottom-left-radius, border-image, border-image-source, border-image-slice, border-image-width, border-image-outset, border-image-repeat, outline, outline-width, outline-style, outline-color, outline-offset, background, background-color, background-image, background-repeat, background-attachment, background-position, background-position-x, background-position-y, background-clip, background-origin, background-size, box-decoration-break, box-shadow, text-shadow ij_less_space_after_colon = true ij_less_space_before_opening_brace = true ij_less_use_double_quotes = true @@ -353,7 +353,7 @@ ij_sass_keep_indents_on_empty_lines = false ij_sass_keep_single_line_blocks = false ij_sass_line_comment_add_space = false ij_sass_line_comment_at_first_column = false -ij_sass_properties_order = font,font-family,font-size,font-weight,font-style,font-variant,font-size-adjust,font-stretch,line-height,position,z-index,top,right,bottom,left,display,visibility,float,clear,overflow,overflow-x,overflow-y,clip,zoom,align-content,align-items,align-self,flex,flex-flow,flex-basis,flex-direction,flex-grow,flex-shrink,flex-wrap,justify-content,order,box-sizing,width,min-width,max-width,height,min-height,max-height,margin,margin-top,margin-right,margin-bottom,margin-left,padding,padding-top,padding-right,padding-bottom,padding-left,table-layout,empty-cells,caption-side,border-spacing,border-collapse,list-style,list-style-position,list-style-type,list-style-image,content,quotes,counter-reset,counter-increment,resize,cursor,user-select,nav-index,nav-up,nav-right,nav-down,nav-left,transition,transition-delay,transition-timing-function,transition-duration,transition-property,transform,transform-origin,animation,animation-name,animation-duration,animation-play-state,animation-timing-function,animation-delay,animation-iteration-count,animation-direction,text-align,text-align-last,vertical-align,white-space,text-decoration,text-emphasis,text-emphasis-color,text-emphasis-style,text-emphasis-position,text-indent,text-justify,letter-spacing,word-spacing,text-outline,text-transform,text-wrap,text-overflow,text-overflow-ellipsis,text-overflow-mode,word-wrap,word-break,tab-size,hyphens,pointer-events,opacity,color,border,border-width,border-style,border-color,border-top,border-top-width,border-top-style,border-top-color,border-right,border-right-width,border-right-style,border-right-color,border-bottom,border-bottom-width,border-bottom-style,border-bottom-color,border-left,border-left-width,border-left-style,border-left-color,border-radius,border-top-left-radius,border-top-right-radius,border-bottom-right-radius,border-bottom-left-radius,border-image,border-image-source,border-image-slice,border-image-width,border-image-outset,border-image-repeat,outline,outline-width,outline-style,outline-color,outline-offset,background,background-color,background-image,background-repeat,background-attachment,background-position,background-position-x,background-position-y,background-clip,background-origin,background-size,box-decoration-break,box-shadow,text-shadow +ij_sass_properties_order = font, font-family, font-size, font-weight, font-style, font-variant, font-size-adjust, font-stretch, line-height, position, z-index, top, right, bottom, left, display, visibility, float, clear, overflow, overflow-x, overflow-y, clip, zoom, align-content, align-items, align-self, flex, flex-flow, flex-basis, flex-direction, flex-grow, flex-shrink, flex-wrap, justify-content, order, box-sizing, width, min-width, max-width, height, min-height, max-height, margin, margin-top, margin-right, margin-bottom, margin-left, padding, padding-top, padding-right, padding-bottom, padding-left, table-layout, empty-cells, caption-side, border-spacing, border-collapse, list-style, list-style-position, list-style-type, list-style-image, content, quotes, counter-reset, counter-increment, resize, cursor, user-select, nav-index, nav-up, nav-right, nav-down, nav-left, transition, transition-delay, transition-timing-function, transition-duration, transition-property, transform, transform-origin, animation, animation-name, animation-duration, animation-play-state, animation-timing-function, animation-delay, animation-iteration-count, animation-direction, text-align, text-align-last, vertical-align, white-space, text-decoration, text-emphasis, text-emphasis-color, text-emphasis-style, text-emphasis-position, text-indent, text-justify, letter-spacing, word-spacing, text-outline, text-transform, text-wrap, text-overflow, text-overflow-ellipsis, text-overflow-mode, word-wrap, word-break, tab-size, hyphens, pointer-events, opacity, color, border, border-width, border-style, border-color, border-top, border-top-width, border-top-style, border-top-color, border-right, border-right-width, border-right-style, border-right-color, border-bottom, border-bottom-width, border-bottom-style, border-bottom-color, border-left, border-left-width, border-left-style, border-left-color, border-radius, border-top-left-radius, border-top-right-radius, border-bottom-right-radius, border-bottom-left-radius, border-image, border-image-source, border-image-slice, border-image-width, border-image-outset, border-image-repeat, outline, outline-width, outline-style, outline-color, outline-offset, background, background-color, background-image, background-repeat, background-attachment, background-position, background-position-x, background-position-y, background-clip, background-origin, background-size, box-decoration-break, box-shadow, text-shadow ij_sass_space_after_colon = true ij_sass_space_before_opening_brace = true ij_sass_use_double_quotes = true @@ -376,7 +376,7 @@ ij_scss_keep_indents_on_empty_lines = false ij_scss_keep_single_line_blocks = false ij_scss_line_comment_add_space = false ij_scss_line_comment_at_first_column = false -ij_scss_properties_order = font,font-family,font-size,font-weight,font-style,font-variant,font-size-adjust,font-stretch,line-height,position,z-index,top,right,bottom,left,display,visibility,float,clear,overflow,overflow-x,overflow-y,clip,zoom,align-content,align-items,align-self,flex,flex-flow,flex-basis,flex-direction,flex-grow,flex-shrink,flex-wrap,justify-content,order,box-sizing,width,min-width,max-width,height,min-height,max-height,margin,margin-top,margin-right,margin-bottom,margin-left,padding,padding-top,padding-right,padding-bottom,padding-left,table-layout,empty-cells,caption-side,border-spacing,border-collapse,list-style,list-style-position,list-style-type,list-style-image,content,quotes,counter-reset,counter-increment,resize,cursor,user-select,nav-index,nav-up,nav-right,nav-down,nav-left,transition,transition-delay,transition-timing-function,transition-duration,transition-property,transform,transform-origin,animation,animation-name,animation-duration,animation-play-state,animation-timing-function,animation-delay,animation-iteration-count,animation-direction,text-align,text-align-last,vertical-align,white-space,text-decoration,text-emphasis,text-emphasis-color,text-emphasis-style,text-emphasis-position,text-indent,text-justify,letter-spacing,word-spacing,text-outline,text-transform,text-wrap,text-overflow,text-overflow-ellipsis,text-overflow-mode,word-wrap,word-break,tab-size,hyphens,pointer-events,opacity,color,border,border-width,border-style,border-color,border-top,border-top-width,border-top-style,border-top-color,border-right,border-right-width,border-right-style,border-right-color,border-bottom,border-bottom-width,border-bottom-style,border-bottom-color,border-left,border-left-width,border-left-style,border-left-color,border-radius,border-top-left-radius,border-top-right-radius,border-bottom-right-radius,border-bottom-left-radius,border-image,border-image-source,border-image-slice,border-image-width,border-image-outset,border-image-repeat,outline,outline-width,outline-style,outline-color,outline-offset,background,background-color,background-image,background-repeat,background-attachment,background-position,background-position-x,background-position-y,background-clip,background-origin,background-size,box-decoration-break,box-shadow,text-shadow +ij_scss_properties_order = font, font-family, font-size, font-weight, font-style, font-variant, font-size-adjust, font-stretch, line-height, position, z-index, top, right, bottom, left, display, visibility, float, clear, overflow, overflow-x, overflow-y, clip, zoom, align-content, align-items, align-self, flex, flex-flow, flex-basis, flex-direction, flex-grow, flex-shrink, flex-wrap, justify-content, order, box-sizing, width, min-width, max-width, height, min-height, max-height, margin, margin-top, margin-right, margin-bottom, margin-left, padding, padding-top, padding-right, padding-bottom, padding-left, table-layout, empty-cells, caption-side, border-spacing, border-collapse, list-style, list-style-position, list-style-type, list-style-image, content, quotes, counter-reset, counter-increment, resize, cursor, user-select, nav-index, nav-up, nav-right, nav-down, nav-left, transition, transition-delay, transition-timing-function, transition-duration, transition-property, transform, transform-origin, animation, animation-name, animation-duration, animation-play-state, animation-timing-function, animation-delay, animation-iteration-count, animation-direction, text-align, text-align-last, vertical-align, white-space, text-decoration, text-emphasis, text-emphasis-color, text-emphasis-style, text-emphasis-position, text-indent, text-justify, letter-spacing, word-spacing, text-outline, text-transform, text-wrap, text-overflow, text-overflow-ellipsis, text-overflow-mode, word-wrap, word-break, tab-size, hyphens, pointer-events, opacity, color, border, border-width, border-style, border-color, border-top, border-top-width, border-top-style, border-top-color, border-right, border-right-width, border-right-style, border-right-color, border-bottom, border-bottom-width, border-bottom-style, border-bottom-color, border-left, border-left-width, border-left-style, border-left-color, border-radius, border-top-left-radius, border-top-right-radius, border-bottom-right-radius, border-bottom-left-radius, border-image, border-image-source, border-image-slice, border-image-width, border-image-outset, border-image-repeat, outline, outline-width, outline-style, outline-color, outline-offset, background, background-color, background-image, background-repeat, background-attachment, background-position, background-position-x, background-position-y, background-clip, background-origin, background-size, box-decoration-break, box-shadow, text-shadow ij_scss_space_after_colon = true ij_scss_space_before_opening_brace = true ij_scss_use_double_quotes = true @@ -396,7 +396,7 @@ ij_stylus_hex_color_upper_case = false ij_stylus_keep_blank_lines_in_code = 2 ij_stylus_keep_indents_on_empty_lines = false ij_stylus_keep_single_line_blocks = false -ij_stylus_properties_order = font,font-family,font-size,font-weight,font-style,font-variant,font-size-adjust,font-stretch,line-height,position,z-index,top,right,bottom,left,display,visibility,float,clear,overflow,overflow-x,overflow-y,clip,zoom,align-content,align-items,align-self,flex,flex-flow,flex-basis,flex-direction,flex-grow,flex-shrink,flex-wrap,justify-content,order,box-sizing,width,min-width,max-width,height,min-height,max-height,margin,margin-top,margin-right,margin-bottom,margin-left,padding,padding-top,padding-right,padding-bottom,padding-left,table-layout,empty-cells,caption-side,border-spacing,border-collapse,list-style,list-style-position,list-style-type,list-style-image,content,quotes,counter-reset,counter-increment,resize,cursor,user-select,nav-index,nav-up,nav-right,nav-down,nav-left,transition,transition-delay,transition-timing-function,transition-duration,transition-property,transform,transform-origin,animation,animation-name,animation-duration,animation-play-state,animation-timing-function,animation-delay,animation-iteration-count,animation-direction,text-align,text-align-last,vertical-align,white-space,text-decoration,text-emphasis,text-emphasis-color,text-emphasis-style,text-emphasis-position,text-indent,text-justify,letter-spacing,word-spacing,text-outline,text-transform,text-wrap,text-overflow,text-overflow-ellipsis,text-overflow-mode,word-wrap,word-break,tab-size,hyphens,pointer-events,opacity,color,border,border-width,border-style,border-color,border-top,border-top-width,border-top-style,border-top-color,border-right,border-right-width,border-right-style,border-right-color,border-bottom,border-bottom-width,border-bottom-style,border-bottom-color,border-left,border-left-width,border-left-style,border-left-color,border-radius,border-top-left-radius,border-top-right-radius,border-bottom-right-radius,border-bottom-left-radius,border-image,border-image-source,border-image-slice,border-image-width,border-image-outset,border-image-repeat,outline,outline-width,outline-style,outline-color,outline-offset,background,background-color,background-image,background-repeat,background-attachment,background-position,background-position-x,background-position-y,background-clip,background-origin,background-size,box-decoration-break,box-shadow,text-shadow +ij_stylus_properties_order = font, font-family, font-size, font-weight, font-style, font-variant, font-size-adjust, font-stretch, line-height, position, z-index, top, right, bottom, left, display, visibility, float, clear, overflow, overflow-x, overflow-y, clip, zoom, align-content, align-items, align-self, flex, flex-flow, flex-basis, flex-direction, flex-grow, flex-shrink, flex-wrap, justify-content, order, box-sizing, width, min-width, max-width, height, min-height, max-height, margin, margin-top, margin-right, margin-bottom, margin-left, padding, padding-top, padding-right, padding-bottom, padding-left, table-layout, empty-cells, caption-side, border-spacing, border-collapse, list-style, list-style-position, list-style-type, list-style-image, content, quotes, counter-reset, counter-increment, resize, cursor, user-select, nav-index, nav-up, nav-right, nav-down, nav-left, transition, transition-delay, transition-timing-function, transition-duration, transition-property, transform, transform-origin, animation, animation-name, animation-duration, animation-play-state, animation-timing-function, animation-delay, animation-iteration-count, animation-direction, text-align, text-align-last, vertical-align, white-space, text-decoration, text-emphasis, text-emphasis-color, text-emphasis-style, text-emphasis-position, text-indent, text-justify, letter-spacing, word-spacing, text-outline, text-transform, text-wrap, text-overflow, text-overflow-ellipsis, text-overflow-mode, word-wrap, word-break, tab-size, hyphens, pointer-events, opacity, color, border, border-width, border-style, border-color, border-top, border-top-width, border-top-style, border-top-color, border-right, border-right-width, border-right-style, border-right-color, border-bottom, border-bottom-width, border-bottom-style, border-bottom-color, border-left, border-left-width, border-left-style, border-left-color, border-radius, border-top-left-radius, border-top-right-radius, border-bottom-right-radius, border-bottom-left-radius, border-image, border-image-source, border-image-slice, border-image-width, border-image-outset, border-image-repeat, outline, outline-width, outline-style, outline-color, outline-offset, background, background-color, background-image, background-repeat, background-attachment, background-position, background-position-x, background-position-y, background-clip, background-origin, background-size, box-decoration-break, box-shadow, text-shadow ij_stylus_space_after_colon = true ij_stylus_space_before_opening_brace = true ij_stylus_use_double_quotes = true @@ -450,7 +450,7 @@ ij_typescript_array_initializer_wrap = off ij_typescript_assignment_wrap = off ij_typescript_binary_operation_sign_on_next_line = false ij_typescript_binary_operation_wrap = off -ij_typescript_blacklist_imports = rxjs/Rx,node_modules/**,**/node_modules/**,@angular/material,@angular/material/typings/** +ij_typescript_blacklist_imports = rxjs/Rx, node_modules/**, **/node_modules/**, @angular/material, @angular/material/typings/** ij_typescript_blank_lines_after_imports = 1 ij_typescript_blank_lines_around_class = 1 ij_typescript_blank_lines_around_field = 0 @@ -631,7 +631,7 @@ ij_javascript_array_initializer_wrap = off ij_javascript_assignment_wrap = off ij_javascript_binary_operation_sign_on_next_line = false ij_javascript_binary_operation_wrap = off -ij_javascript_blacklist_imports = rxjs/Rx,node_modules/**,**/node_modules/**,@angular/material,@angular/material/typings/** +ij_javascript_blacklist_imports = rxjs/Rx, node_modules/**, **/node_modules/**, @angular/material, @angular/material/typings/** ij_javascript_blank_lines_after_imports = 1 ij_javascript_blank_lines_around_class = 1 ij_javascript_blank_lines_around_field = 0 @@ -845,7 +845,7 @@ ij_groovy_ginq_on_wrap_policy = 1 ij_groovy_ginq_space_after_keyword = true ij_groovy_if_brace_force = never ij_groovy_import_annotation_wrap = 2 -ij_groovy_imports_layout = *,|,javax.**,java.**,|,$* +ij_groovy_imports_layout = *, |, javax.**, java.**, |, $* ij_groovy_indent_case_from_switch = true ij_groovy_indent_label_blocks = true ij_groovy_insert_inner_class_imports = false @@ -876,7 +876,7 @@ ij_groovy_method_parameters_right_paren_on_new_line = false ij_groovy_method_parameters_wrap = off ij_groovy_modifier_list_wrap = false ij_groovy_names_count_to_use_import_on_demand = 3 -ij_groovy_packages_to_use_import_on_demand = java.awt.*,javax.swing.* +ij_groovy_packages_to_use_import_on_demand = java.awt.*, javax.swing.* ij_groovy_parameter_annotation_wrap = off ij_groovy_parentheses_expression_new_line_after_left_paren = false ij_groovy_parentheses_expression_right_paren_on_new_line = false @@ -990,23 +990,23 @@ ij_json_spaces_within_brackets = false ij_json_wrap_long_lines = false [{*.htm,*.html,*.ng,*.sht,*.shtm,*.shtml}] -ij_html_add_new_line_before_tags = body,div,p,form,h1,h2,h3 +ij_html_add_new_line_before_tags = body, div, p, form, h1, h2, h3 ij_html_align_attributes = true ij_html_align_text = false ij_html_attribute_wrap = normal ij_html_block_comment_add_space = false ij_html_block_comment_at_first_column = true ij_html_do_not_align_children_of_min_lines = 0 -ij_html_do_not_break_if_inline_tags = title,h1,h2,h3,h4,h5,h6,p -ij_html_do_not_indent_children_of_tags = html,body,thead,tbody,tfoot +ij_html_do_not_break_if_inline_tags = title, h1, h2, h3, h4, h5, h6, p +ij_html_do_not_indent_children_of_tags = html, body, thead, tbody, tfoot ij_html_enforce_quotes = false -ij_html_inline_tags = a,abbr,acronym,b,basefont,bdo,big,br,cite,cite,code,dfn,em,font,i,img,input,kbd,label,q,s,samp,select,small,span,strike,strong,sub,sup,textarea,tt,u,var +ij_html_inline_tags = a, abbr, acronym, b, basefont, bdo, big, br, cite, cite, code, dfn, em, font, i, img, input, kbd, label, q, s, samp, select, small, span, strike, strong, sub, sup, textarea, tt, u, var ij_html_keep_blank_lines = 2 ij_html_keep_indents_on_empty_lines = false ij_html_keep_line_breaks = true ij_html_keep_line_breaks_in_text = true ij_html_keep_whitespaces = false -ij_html_keep_whitespaces_inside = span,pre,textarea +ij_html_keep_whitespaces_inside = span, pre, textarea ij_html_line_comment_at_first_column = true ij_html_new_line_after_last_attribute = never ij_html_new_line_before_first_attribute = never @@ -1058,7 +1058,7 @@ ij_kotlin_field_annotation_wrap = split_into_lines ij_kotlin_finally_on_new_line = false ij_kotlin_if_rparen_on_new_line = false ij_kotlin_import_nested_classes = false -ij_kotlin_imports_layout = *,java.**,javax.**,kotlin.**,^ +ij_kotlin_imports_layout = *, java.**, javax.**, kotlin.**, ^ ij_kotlin_insert_whitespaces_in_simple_one_line_method = true ij_kotlin_keep_blank_lines_before_right_brace = 2 ij_kotlin_keep_blank_lines_in_code = 2 @@ -1078,7 +1078,7 @@ ij_kotlin_method_parameters_right_paren_on_new_line = false ij_kotlin_method_parameters_wrap = off ij_kotlin_name_count_to_use_star_import = 5 ij_kotlin_name_count_to_use_star_import_for_members = 3 -ij_kotlin_packages_to_use_import_on_demand = java.util.*,kotlinx.android.synthetic.**,io.ktor.** +ij_kotlin_packages_to_use_import_on_demand = java.util.*, kotlinx.android.synthetic.**, io.ktor.** ij_kotlin_parameter_annotation_wrap = off ij_kotlin_space_after_comma = true ij_kotlin_space_after_extend_colon = true diff --git a/README.md b/README.md index c560170..01b6287 100644 --- a/README.md +++ b/README.md @@ -1,30 +1,44 @@ # Formula team management ## About Project + - **Name**: Formula One Team - **Technologies**: Java 17, Spring, Maven, Tomcat - **Developers**: - - AlĹľbeta Hajná [xhajna](https://gitlab.fi.muni.cz/xhajna) - - Jitka VicenĂková [xvicenik](https://gitlab.fi.muni.cz/xvicenik) - - Andrej Ĺ˝abka [xzabka](https://gitlab.fi.muni.cz/xzabka) - - Michal Badin [xbadin](https://gitlab.fi.muni.cz/xbadin) + - AlĹľbeta Hajná [xhajna](https://gitlab.fi.muni.cz/xhajna) + - Jitka VicenĂková [xvicenik](https://gitlab.fi.muni.cz/xvicenik) + - Andrej Ĺ˝abka [xzabka](https://gitlab.fi.muni.cz/xzabka) + - Michal Badin [xbadin](https://gitlab.fi.muni.cz/xbadin) - **Assigment**: - - A Formula 1 team is in need to manage its participation to the world championship. The team has two cars participating to each race, each one driven by one driver, with other test drivers available to develop the car further. The manager of the team can set the driver for each car and manage a list of other (test) drivers that are under contract and he can also set as main drivers if unhappy about results. Each driver has a name, surname, nationality, and set of characteristics (e.g. driving on the wet, aggressiveness, etc..) that the manager can visualize. The car is composed of several components (engine, suspensions), that the different departments of the team (e.g. engine, aerodynamics) evolve during time. The manager can pick from a list of components and assemble the cars that will participate to the next race. Engineers from other departments can login to the system and put newer components available. The manager is notified that those components are available and that they can be used to improve the car. + - A Formula 1 team is in need to manage its participation to the world championship. The team has two cars + participating to each race, each one driven by one driver, with other test drivers available to develop the car + further. The manager of the team can set the driver for each car and manage a list of other (test) drivers that + are under contract and he can also set as main drivers if unhappy about results. Each driver has a name, surname, + nationality, and set of characteristics (e.g. driving on the wet, aggressiveness, etc..) that the manager can + visualize. The car is composed of several components (engine, suspensions), that the different departments of the + team (e.g. engine, aerodynamics) evolve during time. The manager can pick from a list of components and assemble + the cars that will participate to the next race. Engineers from other departments can login to the system and put + newer components available. The manager is notified that those components are available and that they can be used + to improve the car. - **Modules**: <br>Our application is divided into 4 separate spring boot modules, as shown on the class diagram + 1) Core module: - <br>Core module contains most of the functionality of the project assignment. It communicates with the other modules via their REST api's. + <br>Core module contains most of the functionality of the project assignment. It communicates with the other modules + via their REST api's. 2) Notifications module: - <br>Notifications module sends e-mail (or other) notifications to team members. + <br>Notifications module sends e-mail (or other) notifications to team members. 3) Visualisation module: - <br>Visualization module provides a visualization of given JSON data in readable HTML (or other) format. Team manager will be able to visualize current state of both cars. + <br>Visualization module provides a visualization of given JSON data in readable HTML (or other) format. Team manager + will be able to visualize current state of both cars. 4) Applications module: - <br>Applications module allows people to send an application to this team. Manager can view these applications and hire new drivers for his team. + <br>Applications module allows people to send an application to this team. Manager can view these applications and + hire new drivers for his team. - **Diagrams**: @@ -32,40 +46,53 @@  # Build and run the app -Build the app (all modules) by running + +Build the app (all modules) by running + ```bash mvn clean install ``` -in the project's parent directory, or build separate modules by running the same command inside the module's parent directory. For example, to build notifications module: + +in the project's parent directory, or build separate modules by running the same command inside the module's parent +directory. For example, to build notifications module: + ```bash cd notification mvn clean install ``` + Tests are run automatically during the build, but if you want to run them again, use: + ```bash mvn test ``` + again, either in the parent directory to test all modules, or inside separate modules to only test one at a time. To run a module, just run: + ```bash cd core mvn ``` + or alternatively: + ```bash cd core mvn spring-boot:run ``` To see the running REST api's in action, use CURL or swagger UI: - http://localhost:8080/swagger-ui/index.html +http://localhost:8080/swagger-ui/index.html Just note that each module runs on a different port by default, so care where you send your requests.<br> **Default ports:** + - core module: 8080 - notifications module: 8083 - visualization module: 8082 - applications module: 8081 -These ports can be overridden either in the application.properties file of each module, or by specifying the port manually when running the "mvn" command to run the module. +These ports can be overridden either in the application.properties file of each module, or by specifying the port +manually when running the "mvn" command to run the module. diff --git a/application/pom.xml b/application/pom.xml index 1dceb05..28b4afc 100644 --- a/application/pom.xml +++ b/application/pom.xml @@ -1,109 +1,109 @@ <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> - <modelVersion>4.0.0</modelVersion> + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> - <parent> - <artifactId>formula-team-management</artifactId> - <groupId>cz.muni.pa165</groupId> - <version>0.0.1-SNAPSHOT</version> - </parent> + <parent> + <artifactId>formula-team-management</artifactId> + <groupId>cz.muni.pa165</groupId> + <version>0.0.1-SNAPSHOT</version> + </parent> - <artifactId>application</artifactId> - <version>0.0.1-SNAPSHOT</version> - <name>Application module</name> - <description>Application generated using OpenAPI Generator "java"</description> + <artifactId>application</artifactId> + <version>0.0.1-SNAPSHOT</version> + <name>Application module</name> + <description>Application generated using OpenAPI Generator "java"</description> - <build> - <defaultGoal>spring-boot:run</defaultGoal> - <!-- name of executable JAR file --> - <finalName>application_module</finalName> + <build> + <defaultGoal>spring-boot:run</defaultGoal> + <!-- name of executable JAR file --> + <finalName>application_module</finalName> - <plugins> - <plugin> - <groupId>org.openapitools</groupId> - <artifactId>openapi-generator-maven-plugin</artifactId> - <executions> - <execution> - <goals> - <goal>generate</goal> - </goals> - <configuration> - <inputSpec>${project.basedir}/openapi.yaml</inputSpec> - <generatorName>spring</generatorName> - <apiPackage>cz.muni.pa165.generated.api</apiPackage> - <modelPackage>cz.muni.pa165.generated.model</modelPackage> - <!-- https://openapi-generator.tech/docs/generators/spring --> - <configOptions> - <basePackage>cz.muni.pa165.rest</basePackage> - <configPackage>cz.muni.pa165.generated.config</configPackage> - <useSpringBoot3>true</useSpringBoot3> - <useTags>true</useTags> - <delegatePattern>true</delegatePattern> - </configOptions> - </configuration> - </execution> - </executions> - </plugin> - <!-- create executable jar --> - <plugin> - <groupId>org.springframework.boot</groupId> - <artifactId>spring-boot-maven-plugin</artifactId> - <configuration> - <executable>true</executable> - </configuration> - </plugin> - <!-- run integration tests in "mvn verify" phase --> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-failsafe-plugin</artifactId> - </plugin> - </plugins> - </build> + <plugins> + <plugin> + <groupId>org.openapitools</groupId> + <artifactId>openapi-generator-maven-plugin</artifactId> + <executions> + <execution> + <goals> + <goal>generate</goal> + </goals> + <configuration> + <inputSpec>${project.basedir}/openapi.yaml</inputSpec> + <generatorName>spring</generatorName> + <apiPackage>cz.muni.pa165.generated.api</apiPackage> + <modelPackage>cz.muni.pa165.generated.model</modelPackage> + <!-- https://openapi-generator.tech/docs/generators/spring --> + <configOptions> + <basePackage>cz.muni.pa165.rest</basePackage> + <configPackage>cz.muni.pa165.generated.config</configPackage> + <useSpringBoot3>true</useSpringBoot3> + <useTags>true</useTags> + <delegatePattern>true</delegatePattern> + </configOptions> + </configuration> + </execution> + </executions> + </plugin> + <!-- create executable jar --> + <plugin> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-maven-plugin</artifactId> + <configuration> + <executable>true</executable> + </configuration> + </plugin> + <!-- run integration tests in "mvn verify" phase --> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-failsafe-plugin</artifactId> + </plugin> + </plugins> + </build> - <dependencies> - <dependency> - <groupId>org.springframework.boot</groupId> - <artifactId>spring-boot-starter-web</artifactId> - </dependency> - <dependency> - <groupId>jakarta.annotation</groupId> - <artifactId>jakarta.annotation-api</artifactId> - </dependency> - <dependency> - <groupId>jakarta.validation</groupId> - <artifactId>jakarta.validation-api</artifactId> - </dependency> - <dependency> - <groupId>io.swagger.core.v3</groupId> - <artifactId>swagger-models-jakarta</artifactId> - </dependency> - <dependency> - <groupId>io.swagger.core.v3</groupId> - <artifactId>swagger-annotations-jakarta</artifactId> - </dependency> - <dependency> - <groupId>org.openapitools</groupId> - <artifactId>jackson-databind-nullable</artifactId> - </dependency> - <dependency> - <groupId>javax.validation</groupId> - <artifactId>validation-api</artifactId> - </dependency> + <dependencies> + <dependency> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-starter-web</artifactId> + </dependency> + <dependency> + <groupId>jakarta.annotation</groupId> + <artifactId>jakarta.annotation-api</artifactId> + </dependency> + <dependency> + <groupId>jakarta.validation</groupId> + <artifactId>jakarta.validation-api</artifactId> + </dependency> + <dependency> + <groupId>io.swagger.core.v3</groupId> + <artifactId>swagger-models-jakarta</artifactId> + </dependency> + <dependency> + <groupId>io.swagger.core.v3</groupId> + <artifactId>swagger-annotations-jakarta</artifactId> + </dependency> + <dependency> + <groupId>org.openapitools</groupId> + <artifactId>jackson-databind-nullable</artifactId> + </dependency> + <dependency> + <groupId>javax.validation</groupId> + <artifactId>validation-api</artifactId> + </dependency> - <!-- for including Swagger UI --> - <dependency> - <groupId>org.springdoc</groupId> - <artifactId>springdoc-openapi-starter-webmvc-ui</artifactId> - </dependency> + <!-- for including Swagger UI --> + <dependency> + <groupId>org.springdoc</groupId> + <artifactId>springdoc-openapi-starter-webmvc-ui</artifactId> + </dependency> - <!-- for testing --> - <dependency> - <groupId>org.springframework.boot</groupId> - <artifactId>spring-boot-starter-test</artifactId> - <scope>test</scope> - </dependency> + <!-- for testing --> + <dependency> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-starter-test</artifactId> + <scope>test</scope> + </dependency> - </dependencies> + </dependencies> </project> diff --git a/application/src/main/java/cz/muni/pa165/rest/ApplicationController.java b/application/src/main/java/cz/muni/pa165/rest/ApplicationController.java index f8f65c9..f40e359 100644 --- a/application/src/main/java/cz/muni/pa165/rest/ApplicationController.java +++ b/application/src/main/java/cz/muni/pa165/rest/ApplicationController.java @@ -1,8 +1,8 @@ package cz.muni.pa165.rest; import cz.muni.pa165.generated.api.ApplicationServiceApiDelegate; -import cz.muni.pa165.generated.model.ApplicationDto; import cz.muni.pa165.generated.model.ApplicationCreateDto; +import cz.muni.pa165.generated.model.ApplicationDto; import cz.muni.pa165.generated.model.ApplicationUpdateDto; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -20,68 +20,68 @@ import java.util.List; @Component public class ApplicationController implements ApplicationServiceApiDelegate { - private static final Logger log = LoggerFactory.getLogger(ApplicationController.class); - - private final List<ApplicationDto> applications = new ArrayList<>(); - - @Override - public ResponseEntity<List<ApplicationDto>> getAllApplications() { - log.debug("getAllApplications() called"); - return new ResponseEntity<>(applications, HttpStatus.OK); - } - - @Override - public ResponseEntity<ApplicationDto> createApplication(ApplicationCreateDto applicationCreateDto) { - log.debug("createApplication() called"); - var application = new ApplicationDto() - .id(getNewId()) - .name(applicationCreateDto.getName()) - .surname(applicationCreateDto.getSurname()) - .birthday(applicationCreateDto.getBirthday()) - .fillingOutDate(applicationCreateDto.getFillingOutDate()); - - applications.add(application); - - return new ResponseEntity<>(application, HttpStatus.OK); - } - - @Override - public ResponseEntity<ApplicationDto> getApplication(Integer id) { - ApplicationDto application = findById(id); - - if (application == null) { - return new ResponseEntity<>(HttpStatus.NOT_FOUND); - } - - return new ResponseEntity<>(application, HttpStatus.OK); - } - - @Override - public ResponseEntity<ApplicationDto> updateApplication(Integer id, ApplicationUpdateDto applicationUpdateDto) { - ApplicationDto application = findById(id); - - if(application == null) { - return new ResponseEntity<>(HttpStatus.NOT_FOUND); - } - - application.setStatus(applicationUpdateDto.getStatus()); - return new ResponseEntity<>(application, HttpStatus.OK); - } - - private ApplicationDto findById(int id) { - for (ApplicationDto a : applications){ - if (a.getId() == id) { - return a; - } - } - return null; - } - - private int getNewId(){ - int highestId = 0; - for (ApplicationDto application : applications) { - if(application.getId() > highestId) highestId = application.getId(); - } - return highestId + 1; - } + private static final Logger log = LoggerFactory.getLogger(ApplicationController.class); + + private final List<ApplicationDto> applications = new ArrayList<>(); + + @Override + public ResponseEntity<List<ApplicationDto>> getAllApplications() { + log.debug("getAllApplications() called"); + return new ResponseEntity<>(applications, HttpStatus.OK); + } + + @Override + public ResponseEntity<ApplicationDto> createApplication(ApplicationCreateDto applicationCreateDto) { + log.debug("createApplication() called"); + var application = new ApplicationDto() + .id(getNewId()) + .name(applicationCreateDto.getName()) + .surname(applicationCreateDto.getSurname()) + .birthday(applicationCreateDto.getBirthday()) + .fillingOutDate(applicationCreateDto.getFillingOutDate()); + + applications.add(application); + + return new ResponseEntity<>(application, HttpStatus.OK); + } + + @Override + public ResponseEntity<ApplicationDto> getApplication(Integer id) { + ApplicationDto application = findById(id); + + if (application == null) { + return new ResponseEntity<>(HttpStatus.NOT_FOUND); + } + + return new ResponseEntity<>(application, HttpStatus.OK); + } + + @Override + public ResponseEntity<ApplicationDto> updateApplication(Integer id, ApplicationUpdateDto applicationUpdateDto) { + ApplicationDto application = findById(id); + + if (application == null) { + return new ResponseEntity<>(HttpStatus.NOT_FOUND); + } + + application.setStatus(applicationUpdateDto.getStatus()); + return new ResponseEntity<>(application, HttpStatus.OK); + } + + private ApplicationDto findById(int id) { + for (ApplicationDto a : applications) { + if (a.getId() == id) { + return a; + } + } + return null; + } + + private int getNewId() { + int highestId = 0; + for (ApplicationDto application : applications) { + if (application.getId() > highestId) highestId = application.getId(); + } + return highestId + 1; + } } diff --git a/application/src/test/java/cz/muni/pa165/rest/ApplicationControllerTest.java b/application/src/test/java/cz/muni/pa165/rest/ApplicationControllerTest.java index c38c3df..acd6afb 100644 --- a/application/src/test/java/cz/muni/pa165/rest/ApplicationControllerTest.java +++ b/application/src/test/java/cz/muni/pa165/rest/ApplicationControllerTest.java @@ -1,8 +1,8 @@ package cz.muni.pa165.rest; +import cz.muni.pa165.generated.model.ApplicationCreateDto; import cz.muni.pa165.generated.model.ApplicationDto; import cz.muni.pa165.generated.model.ApplicationStatus; -import cz.muni.pa165.generated.model.ApplicationCreateDto; import cz.muni.pa165.generated.model.ApplicationUpdateDto; import org.junit.jupiter.api.Test; import org.slf4j.Logger; @@ -14,7 +14,8 @@ import java.time.LocalDate; import java.util.Arrays; import java.util.List; -import static org.junit.jupiter.api.Assertions.*; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotEquals; class ApplicationControllerTest { diff --git a/application/src/test/java/cz/muni/pa165/rest/IntegrationTests.java b/application/src/test/java/cz/muni/pa165/rest/IntegrationTests.java index 2ac9f89..1303226 100644 --- a/application/src/test/java/cz/muni/pa165/rest/IntegrationTests.java +++ b/application/src/test/java/cz/muni/pa165/rest/IntegrationTests.java @@ -21,28 +21,28 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers. @AutoConfigureMockMvc class IntegrationTests { - private static final Logger log = LoggerFactory.getLogger(IntegrationTests.class); + private static final Logger log = LoggerFactory.getLogger(IntegrationTests.class); - @Autowired - private MockMvc mockMvc; + @Autowired + private MockMvc mockMvc; - @Test - void testApplicationModuleResponse() throws Exception { - log.info("testApplicationModuleResponse() running"); + @Test + void testApplicationModuleResponse() throws Exception { + log.info("testApplicationModuleResponse() running"); - String testRequestContent = "{\"name\":\"John\",\"surname\":\"Doe\",\"fillingOutDate\":\"2023-01-01\"}"; + String testRequestContent = "{\"name\":\"John\",\"surname\":\"Doe\",\"fillingOutDate\":\"2023-01-01\"}"; - String response = mockMvc.perform( - post("/application") - .accept(MediaType.APPLICATION_JSON) - .contentType(MediaType.APPLICATION_JSON) - .content(testRequestContent)) - .andExpect(status().isOk()) - .andReturn().getResponse().getContentAsString(); - log.info("response: {}", response); + String response = mockMvc.perform( + post("/application") + .accept(MediaType.APPLICATION_JSON) + .contentType(MediaType.APPLICATION_JSON) + .content(testRequestContent)) + .andExpect(status().isOk()) + .andReturn().getResponse().getContentAsString(); + log.info("response: {}", response); - String expectedResponse = "{\"id\":1,\"name\":\"John\",\"surname\":\"Doe\",\"birthday\":null,\"fillingOutDate\":\"2023-01-01\",\"status\":null}"; + String expectedResponse = "{\"id\":1,\"name\":\"John\",\"surname\":\"Doe\",\"birthday\":null,\"fillingOutDate\":\"2023-01-01\",\"status\":null}"; - assertEquals(expectedResponse, response); - } + assertEquals(expectedResponse, response); + } } \ No newline at end of file diff --git a/core/pom.xml b/core/pom.xml index 65dfa61..62e068b 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -1,120 +1,120 @@ <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <modelVersion>4.0.0</modelVersion> + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> - <!-- definition of parent Maven project --> - <parent> - <artifactId>formula-team-management</artifactId> - <groupId>cz.muni.pa165</groupId> - <version>0.0.1-SNAPSHOT</version> - </parent> + <!-- definition of parent Maven project --> + <parent> + <artifactId>formula-team-management</artifactId> + <groupId>cz.muni.pa165</groupId> + <version>0.0.1-SNAPSHOT</version> + </parent> - <!-- this module definition --> - <artifactId>core</artifactId> - <packaging>jar</packaging> - <name>Core module</name> - <description>Core generated using OpenAPI Generator "java"</description> + <!-- this module definition --> + <artifactId>core</artifactId> + <packaging>jar</packaging> + <name>Core module</name> + <description>Core generated using OpenAPI Generator "java"</description> - <build> - <defaultGoal>spring-boot:run</defaultGoal> - <!-- name of executable JAR file --> - <finalName>core_module</finalName> + <build> + <defaultGoal>spring-boot:run</defaultGoal> + <!-- name of executable JAR file --> + <finalName>core_module</finalName> - <plugins> - <plugin> - <groupId>org.openapitools</groupId> - <artifactId>openapi-generator-maven-plugin</artifactId> - <executions> - <execution> - <goals> - <goal>generate</goal> - </goals> - <configuration> - <inputSpec>${project.basedir}/openapi.yaml</inputSpec> - <generatorName>spring</generatorName> - <apiPackage>cz.muni.pa165.generated.core.api</apiPackage> - <modelPackage>cz.muni.pa165.generated.core.model</modelPackage> - <!-- https://openapi-generator.tech/docs/generators/spring --> - <configOptions> - <basePackage>cz.muni.pa165</basePackage> - <configPackage>cz.muni.pa165.generated.core.config</configPackage> - <useSpringBoot3>true</useSpringBoot3> - <useTags>true</useTags> - <delegatePattern>true</delegatePattern> - </configOptions> - </configuration> - </execution> - </executions> - </plugin> - <!-- create executable jar --> - <plugin> - <groupId>org.springframework.boot</groupId> - <artifactId>spring-boot-maven-plugin</artifactId> - <configuration> - <executable>true</executable> - </configuration> - </plugin> - <!-- run integration tests in "mvn verify" phase --> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-failsafe-plugin</artifactId> - </plugin> + <plugins> + <plugin> + <groupId>org.openapitools</groupId> + <artifactId>openapi-generator-maven-plugin</artifactId> + <executions> + <execution> + <goals> + <goal>generate</goal> + </goals> + <configuration> + <inputSpec>${project.basedir}/openapi.yaml</inputSpec> + <generatorName>spring</generatorName> + <apiPackage>cz.muni.pa165.generated.core.api</apiPackage> + <modelPackage>cz.muni.pa165.generated.core.model</modelPackage> + <!-- https://openapi-generator.tech/docs/generators/spring --> + <configOptions> + <basePackage>cz.muni.pa165</basePackage> + <configPackage>cz.muni.pa165.generated.core.config</configPackage> + <useSpringBoot3>true</useSpringBoot3> + <useTags>true</useTags> + <delegatePattern>true</delegatePattern> + </configOptions> + </configuration> + </execution> + </executions> + </plugin> + <!-- create executable jar --> + <plugin> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-maven-plugin</artifactId> + <configuration> + <executable>true</executable> + </configuration> + </plugin> + <!-- run integration tests in "mvn verify" phase --> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-failsafe-plugin</artifactId> + </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <version>3.0.0-M7</version> </plugin> - </plugins> - </build> + </plugins> + </build> - <dependencies> + <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-validation</artifactId> </dependency> - <dependency> - <groupId>org.springframework.boot</groupId> - <artifactId>spring-boot-starter-web</artifactId> - </dependency> - <dependency> - <groupId>jakarta.annotation</groupId> - <artifactId>jakarta.annotation-api</artifactId> - </dependency> - <dependency> - <groupId>jakarta.validation</groupId> - <artifactId>jakarta.validation-api</artifactId> - </dependency> - <dependency> - <groupId>io.swagger.core.v3</groupId> - <artifactId>swagger-models-jakarta</artifactId> - </dependency> - <dependency> - <groupId>io.swagger.core.v3</groupId> - <artifactId>swagger-annotations-jakarta</artifactId> - </dependency> - <dependency> - <groupId>org.openapitools</groupId> - <artifactId>jackson-databind-nullable</artifactId> - </dependency> - <dependency> - <groupId>javax.validation</groupId> - <artifactId>validation-api</artifactId> - </dependency> + <dependency> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-starter-web</artifactId> + </dependency> + <dependency> + <groupId>jakarta.annotation</groupId> + <artifactId>jakarta.annotation-api</artifactId> + </dependency> + <dependency> + <groupId>jakarta.validation</groupId> + <artifactId>jakarta.validation-api</artifactId> + </dependency> + <dependency> + <groupId>io.swagger.core.v3</groupId> + <artifactId>swagger-models-jakarta</artifactId> + </dependency> + <dependency> + <groupId>io.swagger.core.v3</groupId> + <artifactId>swagger-annotations-jakarta</artifactId> + </dependency> + <dependency> + <groupId>org.openapitools</groupId> + <artifactId>jackson-databind-nullable</artifactId> + </dependency> + <dependency> + <groupId>javax.validation</groupId> + <artifactId>validation-api</artifactId> + </dependency> - <!-- for including Swagger UI --> - <dependency> - <groupId>org.springdoc</groupId> - <artifactId>springdoc-openapi-starter-webmvc-ui</artifactId> - </dependency> + <!-- for including Swagger UI --> + <dependency> + <groupId>org.springdoc</groupId> + <artifactId>springdoc-openapi-starter-webmvc-ui</artifactId> + </dependency> - <!-- for testing --> - <dependency> - <groupId>org.springframework.boot</groupId> - <artifactId>spring-boot-starter-test</artifactId> - <scope>test</scope> - </dependency> + <!-- for testing --> + <dependency> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-starter-test</artifactId> + <scope>test</scope> + </dependency> <dependency> <groupId>org.springframework.boot</groupId> @@ -154,6 +154,6 @@ <artifactId>caffeine</artifactId> </dependency> - </dependencies> + </dependencies> </project> \ No newline at end of file diff --git a/core/src/main/resources/application.properties b/core/src/main/resources/application.properties index 2c84cb6..4f2723c 100644 --- a/core/src/main/resources/application.properties +++ b/core/src/main/resources/application.properties @@ -3,7 +3,6 @@ logging.level.cz.muni=debug server.port=8080 server.servlet.context-path=/pa165/rest/api/v1 # tady nevim jestli neni potreba zmenit - spring.jpa.open-in-view=false spring.datasource.url=jdbc:h2:mem:formula-core;MODE=PostgreSQL spring.datasource.driverClassName=org.h2.Driver @@ -14,5 +13,4 @@ spring.jpa.database-platform=org.hibernate.dialect.H2Dialect spring.jpa.show-sql=true spring.jackson.property-naming-strategy=SNAKE_CASE spring.cache.type=NONE - appconfig.enablecache=false \ No newline at end of file diff --git a/core/src/test/resources/logback.xml b/core/src/test/resources/logback.xml index e449f9c..6690d6a 100644 --- a/core/src/test/resources/logback.xml +++ b/core/src/test/resources/logback.xml @@ -1,16 +1,16 @@ <?xml version="1.0" encoding="UTF-8"?> <configuration> - <appender name="console" class="ch.qos.logback.core.ConsoleAppender"> - <encoder> - <pattern>%d %5p %40.40c:%4L - %m%n</pattern> - </encoder> - </appender> + <appender name="console" class="ch.qos.logback.core.ConsoleAppender"> + <encoder> + <pattern>%d %5p %40.40c:%4L - %m%n</pattern> + </encoder> + </appender> - <root level="info"> - <appender-ref ref="console" /> - </root> -<!-- TODO remove solution--> - <logger name="org.hibernate.SQL" level="DEBUG"/> + <root level="info"> + <appender-ref ref="console"/> + </root> + <!-- TODO remove solution--> + <logger name="org.hibernate.SQL" level="DEBUG"/> </configuration> \ No newline at end of file diff --git a/notification/src/main/java/cz/muni/pa165/rest/NotificationController.java b/notification/src/main/java/cz/muni/pa165/rest/NotificationController.java index da55e94..981d1bb 100644 --- a/notification/src/main/java/cz/muni/pa165/rest/NotificationController.java +++ b/notification/src/main/java/cz/muni/pa165/rest/NotificationController.java @@ -26,7 +26,7 @@ public class NotificationController implements NotificationServiceApiDelegate { SenderDto sender = new SenderDto().emailAddress("noreply@formula1.com"); - for (ReceiverDto receiver: notificationDto.getReceivers()) { + for (ReceiverDto receiver : notificationDto.getReceivers()) { log.debug("Sending mail with subject " + notificationDto.getSubject() + " and body " + notificationDto.getMessage() + " to " + receiver.getEmailAddress() + " from " + sender.getEmailAddress()); diff --git a/notification/src/test/java/cz/muni/pa165/rest/IntegrationTests.java b/notification/src/test/java/cz/muni/pa165/rest/IntegrationTests.java index fc766d6..ab495e9 100644 --- a/notification/src/test/java/cz/muni/pa165/rest/IntegrationTests.java +++ b/notification/src/test/java/cz/muni/pa165/rest/IntegrationTests.java @@ -21,28 +21,28 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers. @AutoConfigureMockMvc class IntegrationTests { - private static final Logger log = LoggerFactory.getLogger(IntegrationTests.class); + private static final Logger log = LoggerFactory.getLogger(IntegrationTests.class); - @Autowired - private MockMvc mockMvc; + @Autowired + private MockMvc mockMvc; - @Test - void testNotificationModuleResponse() throws Exception { - log.info("testNotificationModuleResponse() running"); + @Test + void testNotificationModuleResponse() throws Exception { + log.info("testNotificationModuleResponse() running"); - String testRequestContent = "{\"message\":\"Hello\",\"receivers\":[]}"; + String testRequestContent = "{\"message\":\"Hello\",\"receivers\":[]}"; - String response = mockMvc.perform( - post("/notification") - .accept(MediaType.APPLICATION_JSON) - .contentType(MediaType.APPLICATION_JSON) - .content(testRequestContent)) - .andExpect(status().isOk()) - .andReturn().getResponse().getContentAsString(); - log.info("response: {}", response); + String response = mockMvc.perform( + post("/notification") + .accept(MediaType.APPLICATION_JSON) + .contentType(MediaType.APPLICATION_JSON) + .content(testRequestContent)) + .andExpect(status().isOk()) + .andReturn().getResponse().getContentAsString(); + log.info("response: {}", response); - String expectedResponse = "{\"message\":\"Hello\",\"subject\":null,\"receivers\":[],\"sender\":{\"emailAddress\":\"noreply@formula1.com\"}}"; + String expectedResponse = "{\"message\":\"Hello\",\"subject\":null,\"receivers\":[],\"sender\":{\"emailAddress\":\"noreply@formula1.com\"}}"; - assertEquals(expectedResponse, response); - } + assertEquals(expectedResponse, response); + } } \ No newline at end of file diff --git a/pom.xml b/pom.xml index 394de5f..4c6ef32 100644 --- a/pom.xml +++ b/pom.xml @@ -1,112 +1,112 @@ <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> - <modelVersion>4.0.0</modelVersion> + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> - <!-- parent project --> - <parent> - <groupId>org.springframework.boot</groupId> - <artifactId>spring-boot-starter-parent</artifactId> + <!-- parent project --> + <parent> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-starter-parent</artifactId> <version>3.0.3</version> <relativePath/> - </parent> + </parent> - <!-- this project --> - <groupId>cz.muni.pa165</groupId> - <artifactId>formula-team-management</artifactId> - <version>0.0.1-SNAPSHOT</version> - <packaging>pom</packaging> - <name>formula-team-management</name> - <description>Formula team management</description> + <!-- this project --> + <groupId>cz.muni.pa165</groupId> + <artifactId>formula-team-management</artifactId> + <version>0.0.1-SNAPSHOT</version> + <packaging>pom</packaging> + <name>formula-team-management</name> + <description>Formula team management</description> - <!-- modules --> - <modules> - <module>core</module> - <module>application</module> - <module>visualization</module> + <!-- modules --> + <modules> + <module>core</module> + <module>application</module> + <module>visualization</module> <module>notification</module> </modules> - <!-- properties are inherited into children projects and can be used anywhere with ${property} --> - <properties> - <java.version>17</java.version> - <swagger-jakarta-version>2.2.8</swagger-jakarta-version> + <!-- properties are inherited into children projects and can be used anywhere with ${property} --> + <properties> + <java.version>17</java.version> + <swagger-jakarta-version>2.2.8</swagger-jakarta-version> <org.mapstruct.version>1.5.3.Final</org.mapstruct.version> - </properties> + </properties> - <build> - <!-- sets that "mvn" alone means "mvn install" --> - <defaultGoal>install</defaultGoal> + <build> + <!-- sets that "mvn" alone means "mvn install" --> + <defaultGoal>install</defaultGoal> - <!-- + <!-- Sets versions of plugins for all modules in one place. This does not include the listed plugins into modules, modules still must be declared in each module that uses them, just without <version>. --> - <pluginManagement> - <plugins> - <plugin> - <groupId>org.openapitools</groupId> - <artifactId>openapi-generator-maven-plugin</artifactId> - <version>6.4.0</version> - </plugin> - <plugin> - <groupId>org.springdoc</groupId> - <artifactId>springdoc-openapi-maven-plugin</artifactId> - <version>1.4</version> - </plugin> - </plugins> - </pluginManagement> - </build> + <pluginManagement> + <plugins> + <plugin> + <groupId>org.openapitools</groupId> + <artifactId>openapi-generator-maven-plugin</artifactId> + <version>6.4.0</version> + </plugin> + <plugin> + <groupId>org.springdoc</groupId> + <artifactId>springdoc-openapi-maven-plugin</artifactId> + <version>1.4</version> + </plugin> + </plugins> + </pluginManagement> + </build> - <dependencyManagement> - <dependencies> - <dependency> - <groupId>org.springdoc</groupId> - <artifactId>springdoc-openapi-starter-webmvc-ui</artifactId> - <version>2.0.2</version> - </dependency> - <dependency> - <groupId>org.apache.commons</groupId> - <artifactId>commons-text</artifactId> - <version>1.10.0</version> - </dependency> - <dependency> - <groupId>com.google.code.findbugs</groupId> - <artifactId>jsr305</artifactId> - <version>3.0.2</version> - </dependency> - <dependency> - <groupId>org.openapitools</groupId> - <artifactId>jackson-databind-nullable</artifactId> - <version>0.2.4</version> - </dependency> - <dependency> - <groupId>io.swagger</groupId> - <artifactId>swagger-annotations</artifactId> - <version>1.6.9</version> - </dependency> - <dependency> - <groupId>javax.validation</groupId> - <artifactId>validation-api</artifactId> - <version>2.0.1.Final</version> - </dependency> - <dependency> - <groupId>io.swagger.core.v3</groupId> - <artifactId>swagger-models-jakarta</artifactId> - <version>${swagger-jakarta-version}</version> - </dependency> - <dependency> - <groupId>io.swagger.core.v3</groupId> - <artifactId>swagger-annotations-jakarta</artifactId> - <version>${swagger-jakarta-version}</version> - </dependency> - <dependency> - <groupId>javax.annotation</groupId> - <artifactId>javax.annotation-api</artifactId> - <version>1.3.2</version> - </dependency> + <dependencyManagement> + <dependencies> + <dependency> + <groupId>org.springdoc</groupId> + <artifactId>springdoc-openapi-starter-webmvc-ui</artifactId> + <version>2.0.2</version> + </dependency> + <dependency> + <groupId>org.apache.commons</groupId> + <artifactId>commons-text</artifactId> + <version>1.10.0</version> + </dependency> + <dependency> + <groupId>com.google.code.findbugs</groupId> + <artifactId>jsr305</artifactId> + <version>3.0.2</version> + </dependency> + <dependency> + <groupId>org.openapitools</groupId> + <artifactId>jackson-databind-nullable</artifactId> + <version>0.2.4</version> + </dependency> + <dependency> + <groupId>io.swagger</groupId> + <artifactId>swagger-annotations</artifactId> + <version>1.6.9</version> + </dependency> + <dependency> + <groupId>javax.validation</groupId> + <artifactId>validation-api</artifactId> + <version>2.0.1.Final</version> + </dependency> + <dependency> + <groupId>io.swagger.core.v3</groupId> + <artifactId>swagger-models-jakarta</artifactId> + <version>${swagger-jakarta-version}</version> + </dependency> + <dependency> + <groupId>io.swagger.core.v3</groupId> + <artifactId>swagger-annotations-jakarta</artifactId> + <version>${swagger-jakarta-version}</version> + </dependency> + <dependency> + <groupId>javax.annotation</groupId> + <artifactId>javax.annotation-api</artifactId> + <version>1.3.2</version> + </dependency> <dependency> <groupId>org.mapstruct</groupId> <artifactId>mapstruct</artifactId> @@ -117,7 +117,7 @@ <artifactId>mapstruct-processor</artifactId> <version>${org.mapstruct.version}</version> </dependency> - </dependencies> - </dependencyManagement> + </dependencies> + </dependencyManagement> </project> diff --git a/visualization/pom.xml b/visualization/pom.xml index 7511660..caa6b19 100644 --- a/visualization/pom.xml +++ b/visualization/pom.xml @@ -1,107 +1,107 @@ <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <modelVersion>4.0.0</modelVersion> + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> - <!-- definition of parent Maven project --> - <parent> - <artifactId>formula-team-management</artifactId> - <groupId>cz.muni.pa165</groupId> - <version>0.0.1-SNAPSHOT</version> - </parent> + <!-- definition of parent Maven project --> + <parent> + <artifactId>formula-team-management</artifactId> + <groupId>cz.muni.pa165</groupId> + <version>0.0.1-SNAPSHOT</version> + </parent> - <!-- this module definition --> - <artifactId>visualization</artifactId> - <version>0.0.1-SNAPSHOT</version> - <packaging>jar</packaging> - <name>Visualization module</name> - <description>Visualization generated using OpenAPI Generator "java"</description> + <!-- this module definition --> + <artifactId>visualization</artifactId> + <version>0.0.1-SNAPSHOT</version> + <packaging>jar</packaging> + <name>Visualization module</name> + <description>Visualization generated using OpenAPI Generator "java"</description> - <build> - <defaultGoal>spring-boot:run</defaultGoal> - <finalName>visualization_module</finalName> + <build> + <defaultGoal>spring-boot:run</defaultGoal> + <finalName>visualization_module</finalName> - <plugins> - <plugin> - <groupId>org.openapitools</groupId> - <artifactId>openapi-generator-maven-plugin</artifactId> - <executions> - <execution> - <goals> - <goal>generate</goal> - </goals> - <configuration> - <inputSpec>${project.basedir}/openapi.yaml</inputSpec> - <generatorName>spring</generatorName> - <apiPackage>cz.muni.pa165.generated.api</apiPackage> - <modelPackage>cz.muni.pa165.generated.model</modelPackage> - <configOptions> - <basePackage>cz.muni.pa165.rest</basePackage> - <configPackage>cz.muni.pa165.generated.config</configPackage> - <useSpringBoot3>true</useSpringBoot3> - <useTags>true</useTags> - <delegatePattern>true</delegatePattern> - </configOptions> - </configuration> - </execution> - </executions> - </plugin> - <plugin> - <groupId>org.springframework.boot</groupId> - <artifactId>spring-boot-maven-plugin</artifactId> - <configuration> - <executable>true</executable> - </configuration> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-failsafe-plugin</artifactId> - </plugin> - </plugins> - </build> + <plugins> + <plugin> + <groupId>org.openapitools</groupId> + <artifactId>openapi-generator-maven-plugin</artifactId> + <executions> + <execution> + <goals> + <goal>generate</goal> + </goals> + <configuration> + <inputSpec>${project.basedir}/openapi.yaml</inputSpec> + <generatorName>spring</generatorName> + <apiPackage>cz.muni.pa165.generated.api</apiPackage> + <modelPackage>cz.muni.pa165.generated.model</modelPackage> + <configOptions> + <basePackage>cz.muni.pa165.rest</basePackage> + <configPackage>cz.muni.pa165.generated.config</configPackage> + <useSpringBoot3>true</useSpringBoot3> + <useTags>true</useTags> + <delegatePattern>true</delegatePattern> + </configOptions> + </configuration> + </execution> + </executions> + </plugin> + <plugin> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-maven-plugin</artifactId> + <configuration> + <executable>true</executable> + </configuration> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-failsafe-plugin</artifactId> + </plugin> + </plugins> + </build> - <dependencies> - <dependency> - <groupId>org.springframework.boot</groupId> - <artifactId>spring-boot-starter-web</artifactId> - </dependency> - <dependency> - <groupId>jakarta.annotation</groupId> - <artifactId>jakarta.annotation-api</artifactId> - </dependency> - <dependency> - <groupId>jakarta.validation</groupId> - <artifactId>jakarta.validation-api</artifactId> - </dependency> - <dependency> - <groupId>io.swagger.core.v3</groupId> - <artifactId>swagger-models-jakarta</artifactId> - </dependency> - <dependency> - <groupId>io.swagger.core.v3</groupId> - <artifactId>swagger-annotations-jakarta</artifactId> - </dependency> - <dependency> - <groupId>org.openapitools</groupId> - <artifactId>jackson-databind-nullable</artifactId> - </dependency> - <dependency> - <groupId>javax.validation</groupId> - <artifactId>validation-api</artifactId> - </dependency> + <dependencies> + <dependency> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-starter-web</artifactId> + </dependency> + <dependency> + <groupId>jakarta.annotation</groupId> + <artifactId>jakarta.annotation-api</artifactId> + </dependency> + <dependency> + <groupId>jakarta.validation</groupId> + <artifactId>jakarta.validation-api</artifactId> + </dependency> + <dependency> + <groupId>io.swagger.core.v3</groupId> + <artifactId>swagger-models-jakarta</artifactId> + </dependency> + <dependency> + <groupId>io.swagger.core.v3</groupId> + <artifactId>swagger-annotations-jakarta</artifactId> + </dependency> + <dependency> + <groupId>org.openapitools</groupId> + <artifactId>jackson-databind-nullable</artifactId> + </dependency> + <dependency> + <groupId>javax.validation</groupId> + <artifactId>validation-api</artifactId> + </dependency> - <dependency> - <groupId>org.springdoc</groupId> - <artifactId>springdoc-openapi-starter-webmvc-ui</artifactId> - </dependency> + <dependency> + <groupId>org.springdoc</groupId> + <artifactId>springdoc-openapi-starter-webmvc-ui</artifactId> + </dependency> - <dependency> - <groupId>org.springframework.boot</groupId> - <artifactId>spring-boot-starter-test</artifactId> - <scope>test</scope> - </dependency> + <dependency> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-starter-test</artifactId> + <scope>test</scope> + </dependency> - </dependencies> + </dependencies> </project> \ No newline at end of file diff --git a/visualization/src/main/java/cz/muni/pa165/rest/VisualizationController.java b/visualization/src/main/java/cz/muni/pa165/rest/VisualizationController.java index 6b7b044..9c976ef 100644 --- a/visualization/src/main/java/cz/muni/pa165/rest/VisualizationController.java +++ b/visualization/src/main/java/cz/muni/pa165/rest/VisualizationController.java @@ -3,21 +3,21 @@ package cz.muni.pa165.rest; import cz.muni.pa165.generated.api.VisualizationApiDelegate; import cz.muni.pa165.generated.model.VisualizationSchemaCreateDto; import cz.muni.pa165.generated.model.VisualizationSchemaDto; -import org.springframework.http.HttpStatus; -import org.springframework.http.ResponseEntity; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Component; @Component public class VisualizationController implements VisualizationApiDelegate { - private static final Logger log = LoggerFactory.getLogger(VisualizationController.class); + private static final Logger log = LoggerFactory.getLogger(VisualizationController.class); - @Override - public ResponseEntity<VisualizationSchemaDto> getVisualization(VisualizationSchemaCreateDto visualizationSchemaCreateDto) { - log.debug("getVisualization() called"); + @Override + public ResponseEntity<VisualizationSchemaDto> getVisualization(VisualizationSchemaCreateDto visualizationSchemaCreateDto) { + log.debug("getVisualization() called"); - return new ResponseEntity<>(new VisualizationSchemaDto().message("--VISUALIZATION--"), HttpStatus.OK); - } + return new ResponseEntity<>(new VisualizationSchemaDto().message("--VISUALIZATION--"), HttpStatus.OK); + } } diff --git a/visualization/src/test/java/cz/muni/pa165/rest/IntegrationTests.java b/visualization/src/test/java/cz/muni/pa165/rest/IntegrationTests.java index 59b6bd9..cfadef6 100644 --- a/visualization/src/test/java/cz/muni/pa165/rest/IntegrationTests.java +++ b/visualization/src/test/java/cz/muni/pa165/rest/IntegrationTests.java @@ -21,29 +21,29 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers. @AutoConfigureMockMvc class IntegrationTests { - private static final Logger log = LoggerFactory.getLogger(IntegrationTests.class); + private static final Logger log = LoggerFactory.getLogger(IntegrationTests.class); - @Autowired - private MockMvc mockMvc; + @Autowired + private MockMvc mockMvc; - @Test - void testVisualizationModuleResponse() throws Exception { - log.info("testVisualizationModuleResponse() running"); + @Test + void testVisualizationModuleResponse() throws Exception { + log.info("testVisualizationModuleResponse() running"); - String testRequestContent = "{\"data\":\"Hello\"}"; + String testRequestContent = "{\"data\":\"Hello\"}"; - String response = mockMvc.perform( - post("/visualization") - .accept(MediaType.APPLICATION_JSON) - .contentType(MediaType.APPLICATION_JSON) - .content(testRequestContent)) - .andExpect(status().isOk()) - .andReturn().getResponse().getContentAsString(); - log.info("response: {}", response); + String response = mockMvc.perform( + post("/visualization") + .accept(MediaType.APPLICATION_JSON) + .contentType(MediaType.APPLICATION_JSON) + .content(testRequestContent)) + .andExpect(status().isOk()) + .andReturn().getResponse().getContentAsString(); + log.info("response: {}", response); - String expectedResponse = "{\"message\":\"--VISUALIZATION--\"}"; + String expectedResponse = "{\"message\":\"--VISUALIZATION--\"}"; - assertEquals(expectedResponse, response); - } + assertEquals(expectedResponse, response); + } } \ No newline at end of file diff --git a/visualization/src/test/java/cz/muni/pa165/rest/VisualizationControllerTest.java b/visualization/src/test/java/cz/muni/pa165/rest/VisualizationControllerTest.java index 4056c05..892a522 100644 --- a/visualization/src/test/java/cz/muni/pa165/rest/VisualizationControllerTest.java +++ b/visualization/src/test/java/cz/muni/pa165/rest/VisualizationControllerTest.java @@ -15,16 +15,16 @@ import static org.junit.jupiter.api.Assertions.assertNotNull; * @author Michal Badin */ class VisualizationControllerTest { - private static final Logger log = LoggerFactory.getLogger(VisualizationControllerTest.class); - private final VisualizationController visualizationController = new VisualizationController(); + private static final Logger log = LoggerFactory.getLogger(VisualizationControllerTest.class); + private final VisualizationController visualizationController = new VisualizationController(); - @Test - void testGetVisualization() { - log.debug("testGetVisualization() running"); + @Test + void testGetVisualization() { + log.debug("testGetVisualization() running"); - ResponseEntity<VisualizationSchemaDto> responseEntity = visualizationController.getVisualization(new VisualizationSchemaCreateDto().data("test")); - assertEquals(HttpStatus.OK, responseEntity.getStatusCode()); - assertNotNull(responseEntity.getBody()); - assertEquals("--VISUALIZATION--", responseEntity.getBody().getMessage()); - } + ResponseEntity<VisualizationSchemaDto> responseEntity = visualizationController.getVisualization(new VisualizationSchemaCreateDto().data("test")); + assertEquals(HttpStatus.OK, responseEntity.getStatusCode()); + assertNotNull(responseEntity.getBody()); + assertEquals("--VISUALIZATION--", responseEntity.getBody().getMessage()); + } } \ No newline at end of file -- GitLab