Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ jobs:
java-version: '17'
distribution: 'temurin'
cache: maven
- name: Check formatting
run: mvn spotless:check
- name: Build with Maven
run: mvn clean package

Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## 2026-08-11
### Added
- Spotless Maven plugin for Java sources with Google Java Format (AOSP), matching ZAP (`mvn spotless:apply` / `mvn spotless:check`). CI runs `spotless:check`.

### Changed
- Applied Spotless to Java sources under `src/`.

## 2026-05-11
### Changed
- Updated to use Tomcat 9.0.117.
Expand Down
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@ To build and run WAVSEP run the following commands:

WAVSEP will then be accessible via [http://localhost:8080/wavsep/](http://localhost:8080/wavsep/)

## Formatting

WAVSEP uses [Spotless](https://github.com/diffplug/spotless) with Google Java Format (AOSP), matching ZAP core and zap-extensions. Spotless needs JRE 17+ (same as CI).

* Apply formatting: `mvn spotless:apply`
* Check formatting: `mvn spotless:check`

## Debugging

To show the output of WAVSEP run it using the command:
Expand Down
31 changes: 31 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.source>1.8</maven.compiler.source>
<spotless.version>3.9.0</spotless.version>
</properties>

<dependencies>
Expand Down Expand Up @@ -105,6 +106,36 @@
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>

<!-- Java formatting (Google Java Format AOSP, same as ZAP / zap-extensions) -->
<plugin>
<groupId>com.diffplug.spotless</groupId>
<artifactId>spotless-maven-plugin</artifactId>
<version>${spotless.version}</version>
<configuration>
<java>
<!-- Sources live under src/ (not src/main/java) -->
<includes>
<include>src/**/*.java</include>
</includes>
<!-- 1.28.0 is Spotless default on JDK 17 (CI); 1.29+ needs JDK 21 to run -->
<googleJavaFormat>
<version>1.28.0</version>
<style>AOSP</style>
</googleJavaFormat>
<removeUnusedImports/>
<trimTrailingWhitespace/>
<endWithNewline/>
</java>
</configuration>
<executions>
<execution>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Expand Down
35 changes: 19 additions & 16 deletions src/com/sectooladdict/constants/ContentConstants.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,30 +7,33 @@
* @since 1.2
*/
public class ContentConstants {
//**************************
//* CONTENT TYPE CONSTANTS *
//**************************
/**
// **************************
// * CONTENT TYPE CONSTANTS *
// **************************
/**
* This constant contains a text/html content type string.
*
* @since 1.2
*/
public static final String CONTENT_TYPE_TEXT_HTML = "text/html";
/**
public static final String CONTENT_TYPE_TEXT_HTML = "text/html";

/**
* This constant contains an octet stram content type string (download).
*
* @since 1.2
*/
public static final String CONTENT_TYPE_STREAM = "application/octet-stream";
//****************
//* CONSTRUCTORS *
//****************
public static final String CONTENT_TYPE_STREAM = "application/octet-stream";

// ****************
// * CONSTRUCTORS *
// ****************
/**
* The default constructor is disabled to prevent the creation
* of class instances.
* @throws Exception Default constructor not supported
* The default constructor is disabled to prevent the creation of class instances.
*
* @throws Exception Default constructor not supported
* @since 1.0
*/
private ContentConstants() throws Exception {
throw new Exception("Default constructor not supported");
} //end of constructor
} //end of class
} // end of constructor
} // end of class
88 changes: 49 additions & 39 deletions src/com/sectooladdict/constants/DatabaseConstants.java
Original file line number Diff line number Diff line change
@@ -1,97 +1,107 @@
/**
*
*/
/** */
package com.sectooladdict.constants;

/**
* This class contains constants used for database
* related activities.
* This class contains constants used for database related activities.
*
* The class contains various non-secure fields that are
* used for the purpose of testing web application scanners,
* and therefore, most of the fields in this class are NOT
* suitable for implementing applications.
* <p>The class contains various non-secure fields that are used for the purpose of testing web
* application scanners, and therefore, most of the fields in this class are NOT suitable for
* implementing applications.
*
* @author Shay Chen
* @since 1.0
*/
public final class DatabaseConstants {
//*******************
//* MySQL CONSTANTS *
//*******************

// *******************
// * MySQL CONSTANTS *
// *******************
/**
* This constant is used as the global database driver string.
*
* @since 1.0
*/
public static final String DATABASE_DRIVER =
"com.mysql.jdbc.Driver";
public static final String DATABASE_DRIVER = "com.mysql.jdbc.Driver";

/**
* This constant is used as the global wavsep database name string.
*
* @since 1.0
*/
public static final String DATABASE_NAME =
"wavsepDB";
public static final String DATABASE_NAME = "wavsepDB";

/**
* This constant is used as the global database connection string (dynamic).
*
* @since 1.0.2
*/
public static String CONNECTION_STRING_WITHOUT_CREDENTIALS =
"jdbc:mysql://localhost:3306/wavsepDB";
"jdbc:mysql://localhost:3306/wavsepDB";

/**
* This constant is used to store the database account user name (dynamic).
*
* @since 1.0.2
*/
public static String USERNAME = "wavsep";
//original: wavsep, not final

// original: wavsep, not final
/**
* This constant is used to store the database account password (dynamic).
*
* @since 1.0.2
*/
public static String PASSWORD = "wavsepPass782";
//original: wavsepPass782, not final

// original: wavsepPass782, not final
/**
* This constant is used to store the connection pool name.
*
* @since 1.0.2
*/
public static final String CONNECTION_POOL_NAME = "WavsepConnectionPool";
//*******************
//* DERBY CONSTANTS *
//*******************

// *******************
// * DERBY CONSTANTS *
// *******************
/**
* This constant is used to store the derby database name.
*
* @since 1.1.0
*/
public static final String DERBY_DATABASE_NAME = "db/WavsepConfigDB";

/**
* This constant is used to store the derby database connection string.
*
* @since 1.1.0
*/
public static final String DERBY_CONNECTION_STRING =
"jdbc:derby:" + DERBY_DATABASE_NAME + ";";
/**
public static final String DERBY_CONNECTION_STRING = "jdbc:derby:" + DERBY_DATABASE_NAME + ";";

/**
* This constant is used to store the derby database driver string.
*
* @since 1.1.0
*/
public static final String DERBY_DATABASE_DRIVER =
"org.apache.derby.jdbc.EmbeddedDriver";
/**
public static final String DERBY_DATABASE_DRIVER = "org.apache.derby.jdbc.EmbeddedDriver";

/**
* This constant is used to store the configuration row identifier.
*
* @since 1.1.0
*/
public static final int DERBY_DATABASE_CONFIGURATION_ID = 2;
public static final int DERBY_DATABASE_CONFIGURATION_ID = 2;

//****************
//* CONSTRUCTORS *
//****************
// ****************
// * CONSTRUCTORS *
// ****************
/**
* The default constructor is disabled to prevent the creation
* of class instances.
* @throws Exception Default constructor not supported
* The default constructor is disabled to prevent the creation of class instances.
*
* @throws Exception Default constructor not supported
* @since 1.0
*/
private DatabaseConstants() throws Exception {
throw new Exception("Default constructor not supported");
} //end of constructor

} //end of class
} // end of constructor
} // end of class
Loading
Loading