@@ -16,10 +16,10 @@ public class CustomizationIT {
1616 static String docroot ;
1717 @ BeforeAll
1818 public static void setup () {
19+ // setup docroot for running test either in docker or in Jenkins
1920 if (Files .exists (Paths .get ("docker-dev-volumes" ))) {
2021 docroot = "./appserver/glassfish/domains/domain1/docroot/" ;
2122 } else {
22- // /usr/local/payara6/glassfish/domains/domain1/config
2323 docroot = "../docroot/" ;
2424 }
2525 }
@@ -34,17 +34,15 @@ public void testGetCustomAnalytics() {
3434 UtilIT .setSetting (SettingsServiceBean .Key .WebAnalyticsCode , setting ).prettyPrint ();
3535
3636 Response getResponse = UtilIT .getCustomizationFile ("analytics" );
37- getResponse .prettyPrint ();
3837 getResponse .then ().assertThat ()
39- .body ( containsString ( "<!doctype html>" ) )
40- .statusCode ( 200 );
38+ .statusCode ( 200 )
39+ .body ( containsString ( "<!doctype html>" ) );
4140
4241 assert (getResponse .getHeaders ().get ("Content-Type" ).getValue ().startsWith ("text/html" ));
4342
4443 UtilIT .deleteSetting (SettingsServiceBean .Key .WebAnalyticsCode ).prettyPrint ();
4544
4645 getResponse = UtilIT .getCustomizationFile ("analytics" );
47- getResponse .prettyPrint ();
4846 getResponse .then ().assertThat ()
4947 .statusCode (404 )
5048 .body (containsString ("not found." ));
@@ -56,7 +54,6 @@ public void testGetCustomLogo() {
5654 UtilIT .setSetting (SettingsServiceBean .Key .LogoCustomizationFile , setting ).prettyPrint ();
5755
5856 Response getResponse = UtilIT .getCustomizationFile ("logo" );
59- getResponse .prettyPrint ();
6057 getResponse .then ().assertThat ()
6158 .statusCode (200 )
6259 .body (containsString ("PNG" ));
@@ -71,4 +68,12 @@ public void testGetCustomLogo() {
7168 .statusCode (404 )
7269 .body (containsString ("not found." ));
7370 }
71+
72+ @ Test
73+ public void testGetCustomUnknown () {
74+ Response getResponse = UtilIT .getCustomizationFile ("unknownType" );
75+ getResponse .then ().assertThat ()
76+ .statusCode (400 )
77+ .body (containsString ("Customization type unknown or missing. Must be one of the following: [homePage, header" ));
78+ }
7479}
0 commit comments