diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..eac943d --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,23 @@ +name: ci + +on: + push: + branches: [main] + pull_request: + branches: [main] + +jobs: + test: + runs-on: self-hosted + + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: "25" + cache: maven + + - working-directory: helpmehelpapplication + run: mvn -B test diff --git a/.github/workflows/maven-publish.yml b/.github/workflows/maven-publish.yml new file mode 100644 index 0000000..4a20d1a --- /dev/null +++ b/.github/workflows/maven-publish.yml @@ -0,0 +1,34 @@ +# This workflow will build a package using Maven and then publish it to GitHub packages when a release is created +# For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#apache-maven-with-a-settings-path + +name: Maven Package + +on: + release: + types: [created] + +jobs: + build: + + runs-on: [ self-hosted ] + permissions: + contents: read + packages: write + + steps: + - uses: actions/checkout@v4 + - name: Set up JDK 11 + uses: actions/setup-java@v4 + with: + java-version: '11' + distribution: 'temurin' + server-id: github # Value of the distributionManagement/repository/id field of the pom.xml + settings-path: ${{ github.workspace }} # location for the settings.xml file + + - name: Build with Maven + run: mvn -B package --file pom.xml + + - name: Publish to GitHub Packages Apache Maven + run: mvn deploy -s $GITHUB_WORKSPACE/settings.xml + env: + GITHUB_TOKEN: ${{ github.token }} diff --git a/README.md b/README.md index 9c58d6b..c2b4d1f 100644 --- a/README.md +++ b/README.md @@ -57,7 +57,7 @@ Planned core functionalities (3–4 will be fully implemented): ## Technology Stack -- **Programming Language:** Java +- **Programming Language:** Java 25 - **Application Type:** Desktop application - **UI:** JavaFX - **Database:** Relational database diff --git "a/docs/M\303\270tedokumenter/Team Meeting 1.pdf" "b/docs/M\303\270tedokumenter/Team Meeting 1.pdf" new file mode 100644 index 0000000..e383f4b Binary files /dev/null and "b/docs/M\303\270tedokumenter/Team Meeting 1.pdf" differ diff --git a/docs/sequence_diagram/Org_Onboard.png b/docs/sequence_diagram/Org_Onboard.png new file mode 100644 index 0000000..fa3974a Binary files /dev/null and b/docs/sequence_diagram/Org_Onboard.png differ diff --git a/docs/sequence_diagram/Organization_message.png b/docs/sequence_diagram/Organization_message.png new file mode 100644 index 0000000..416cdd3 Binary files /dev/null and b/docs/sequence_diagram/Organization_message.png differ diff --git a/docs/sequence_diagram/Organization_update_profile.png b/docs/sequence_diagram/Organization_update_profile.png new file mode 100644 index 0000000..a5d8036 Binary files /dev/null and b/docs/sequence_diagram/Organization_update_profile.png differ diff --git a/docs/sequence_diagram/Sequence_diagram_user_donate.png b/docs/sequence_diagram/Sequence_diagram_user_donate.png new file mode 100644 index 0000000..b45d8be Binary files /dev/null and b/docs/sequence_diagram/Sequence_diagram_user_donate.png differ diff --git a/docs/sequence_diagram/User_Browser_sequence_diagram.png b/docs/sequence_diagram/User_Browser_sequence_diagram.png new file mode 100644 index 0000000..f3498f3 Binary files /dev/null and b/docs/sequence_diagram/User_Browser_sequence_diagram.png differ diff --git a/docs/sequence_diagram/user_authentication_sequence_diagram.png b/docs/sequence_diagram/user_authentication_sequence_diagram.png new file mode 100644 index 0000000..3403802 Binary files /dev/null and b/docs/sequence_diagram/user_authentication_sequence_diagram.png differ diff --git a/helpmehelpapplication/.github/workflows/ci.yml b/helpmehelpapplication/.github/workflows/ci.yml new file mode 100644 index 0000000..ae74021 --- /dev/null +++ b/helpmehelpapplication/.github/workflows/ci.yml @@ -0,0 +1,20 @@ +name: ci + +on: + push: + branches: main + pull_request: + branches: main + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 + with: + distribition: temurin + java-version: "25" + cache: maven + - run: + mvn -B test diff --git a/helpmehelpapplication/.gitignore b/helpmehelpapplication/.gitignore new file mode 100644 index 0000000..e673575 --- /dev/null +++ b/helpmehelpapplication/.gitignore @@ -0,0 +1,2 @@ +.idea/ +target/ \ No newline at end of file diff --git a/helpmehelpapplication/src/main/java/ntnu/systemutvikling/team6/Main.java b/helpmehelpapplication/src/main/java/ntnu/systemutvikling/team6/Main.java new file mode 100644 index 0000000..b30c2e3 --- /dev/null +++ b/helpmehelpapplication/src/main/java/ntnu/systemutvikling/team6/Main.java @@ -0,0 +1,7 @@ +package ntnu.sytemutvikling.team6; + +public class Main { + public static void main(String[] args) { + System.out.println("Hello world!"); + } +} diff --git a/helpmehelpapplication/src/main/java/ntnu/systemutvikling/team6/models/Charity.java b/helpmehelpapplication/src/main/java/ntnu/systemutvikling/team6/models/Charity.java new file mode 100644 index 0000000..2c2cb3f --- /dev/null +++ b/helpmehelpapplication/src/main/java/ntnu/systemutvikling/team6/models/Charity.java @@ -0,0 +1,95 @@ +/** + * This class represents a charity organization. It contains information about the charity such as + * its name, description, total donations, verification status, and category. + * + * @author Adrian Balunan + */ +package ntnu.sytemutvikling.team6.models; + +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; + +public class Charity { + /* UUID for uniquely identifying each charity */ + private UUID id; + + /* Name of the charity */ + private String name; + + /* Description of the charity's mission and activities */ + private String description; + + /* Total Donations received */ + private int totalDonations; + + /* Is the charity verified? */ + private boolean isVerified; + + /* Category for the charity */ + private String category; + + /* List that contains the charity's Feedbacks */ + private List feedbacks; + + /** + * Konstructor for creating a new charity. The ID is generated automatically using UUID. Total + * donations are initialized to 0. The charity is unverified by default. + * + * @param name + * @param description + * @param category + */ + public Charity(String name, String description, String category) { + this.id = UUID.randomUUID(); + this.name = name; + this.description = description; + this.totalDonations = 0; + this.isVerified = false; + this.feedbacks = new ArrayList<>(); + this.category = category; + } + + /** Getters for the charity's attributes. */ + public UUID getId() { + return id; + } + + public String getCategory() { + return category; + } + + public String getName() { + return name; + } + + public String getDescription() { + return description; + } + + public int getTotalDonations() { + return totalDonations; + } + + public boolean isVerified() { + return isVerified; + } + + /** Setter for verification status. This one sets the charity as verified. */ + public void setVerified() { + this.isVerified = true; + } + + /** Setter for verification status. This one sets the charity as unverified. */ + public void setUnverified() { + this.isVerified = false; + } + + /** + * Setter for total donations. This method is used to update the total donations when a new + * donation is made. + */ + public void setTotalDonations(int amount) { + this.totalDonations += amount; + } +} diff --git a/helpmehelpapplication/src/main/java/ntnu/systemutvikling/team6/models/CharityRegistry.java b/helpmehelpapplication/src/main/java/ntnu/systemutvikling/team6/models/CharityRegistry.java new file mode 100644 index 0000000..2935c74 --- /dev/null +++ b/helpmehelpapplication/src/main/java/ntnu/systemutvikling/team6/models/CharityRegistry.java @@ -0,0 +1,36 @@ +package ntnu.sytemutvikling.team6.models; + +import java.util.*; + +public class CharityRegistry { + private final List charities; + + public CharityRegistry() { + this.charities = new ArrayList<>(); + } + + public List getAllCharities() { + return Collections.unmodifiableList(charities); + } + + public Optional findCharityById(UUID charityId) { + if (charityId == null) { + throw new IllegalArgumentException("CharityId can not be null."); + } + return charities.stream().filter(charity -> charityId.equals(charity.getId())).findFirst(); + } + + public void addCharity(Charity charity) { + if (charity == null) { + throw new IllegalArgumentException("Charity can not be null."); + } + charities.add(charity); + } + + public boolean removeCharity(UUID charityId) { + if (charityId == null) { + throw new IllegalArgumentException("CharityId can not be null."); + } + return charities.removeIf(charity -> charityId.equals(charity.getId())); + } +} diff --git a/helpmehelpapplication/src/main/java/ntnu/systemutvikling/team6/models/Donation.java b/helpmehelpapplication/src/main/java/ntnu/systemutvikling/team6/models/Donation.java new file mode 100644 index 0000000..70f6268 --- /dev/null +++ b/helpmehelpapplication/src/main/java/ntnu/systemutvikling/team6/models/Donation.java @@ -0,0 +1,68 @@ +package ntnu.sytemutvikling.team6.models; + +import java.time.LocalDateTime; +import java.util.UUID; +import ntnu.sytemutvikling.team6.models.user.User; + +public class Donation { + /* UUID for uniquely identifying each donation */ + private UUID charityId; + + /* Ammount of money donated */ + private double amount; + + /* Date and time of the donation */ + private LocalDateTime date; + + /* The charity that received the donation */ + private Charity charity; + + /* The user/donor that made the donation */ + private User donor; + + /** Is the donation made anonymously? This can be null if the donation was made anonymously. */ + private boolean isAnonymous; + + /** + * Constructor for creating a new donation. The charityId is generated automatically using UUID. + * If the donation is made anonymously, the isAnonymous parameter is set to true. + * + * @param amount + * @param date + * @param charity + * @param donor + */ + public Donation(double amount, LocalDateTime date, Charity charity, User donor) { + this.charityId = UUID.randomUUID(); + this.amount = amount; + this.date = date; + this.charity = charity; + this.donor = donor; + this.isAnonymous = donor.getSettings().isAnonymous(); + } + + /* Getters for the donation's attributes */ + public boolean isAnonymous() { + return isAnonymous; + } + + public UUID getCharityId() { + return charityId; + } + + public double getAmount() { + return amount; + } + + public LocalDateTime getDate() { + return date; + } + + public Charity getCharity() { + return charity; + } + + public User getDonor() { + return donor; + } +} diff --git a/helpmehelpapplication/src/main/java/ntnu/systemutvikling/team6/models/DonationRegistry.java b/helpmehelpapplication/src/main/java/ntnu/systemutvikling/team6/models/DonationRegistry.java new file mode 100644 index 0000000..ff6d4e2 --- /dev/null +++ b/helpmehelpapplication/src/main/java/ntnu/systemutvikling/team6/models/DonationRegistry.java @@ -0,0 +1,38 @@ +package ntnu.sytemutvikling.team6.models; + +import java.util.*; + +public class DonationRegistry { + private final List donations; + + public DonationRegistry() { + this.donations = new ArrayList<>(); + } + + public List getAllDonations() { + return Collections.unmodifiableList(donations); + } + + public Optional findDonationById(UUID donationId) { + if (donationId == null) { + throw new IllegalArgumentException("DonationId can not be null."); + } + return donations.stream() + .filter(donations -> donationId.equals(donations.getCharityId())) + .findFirst(); + } + + public void addDonation(Donation donation) { + if (donation == null) { + throw new IllegalArgumentException("Donation can not be null."); + } + donations.add(donation); + } + + public boolean removeDonation(UUID donationId) { + if (donationId == null) { + throw new IllegalArgumentException("DonationId can not be null."); + } + return donations.removeIf(donation -> donationId.equals(donation.getCharityId())); + } +} diff --git a/helpmehelpapplication/src/main/java/ntnu/systemutvikling/team6/models/Feedback.java b/helpmehelpapplication/src/main/java/ntnu/systemutvikling/team6/models/Feedback.java new file mode 100644 index 0000000..f753e8a --- /dev/null +++ b/helpmehelpapplication/src/main/java/ntnu/systemutvikling/team6/models/Feedback.java @@ -0,0 +1,62 @@ +package ntnu.sytemutvikling.team6.models; + +import java.time.LocalDateTime; +import java.util.UUID; +import ntnu.sytemutvikling.team6.models.user.User; + +public class Feedback { + /* Feedback id */ + private UUID feedbackId; + + /** The author of the feedback If annonymous the presentation of the user will be "Anonymous". */ + private User user; + + /* The details of the feedback*/ + private String comment; + + /* The date and time when the feedback was given */ + private LocalDateTime date; + + /* Is the feedback given anonymously? */ + private boolean isAnonymous; + + /** + * Constructor for creating a new feedback. + * + * @param user The user who gives the feedback. + * @param comment The content of the feedback. + */ + public Feedback(User user, String comment) { + this.feedbackId = UUID.randomUUID(); + this.user = user; + this.comment = comment; + this.date = LocalDateTime.now(); + + this.isAnonymous = user.getSettings().isAnonymous(); + } + + /** + * Getters for the feedback's attributes. + * + * @return The feedback's attributes. + */ + public UUID getFeedbackId() { + return feedbackId; + } + + public String getComment() { + return comment; + } + + public LocalDateTime getDate() { + return date; + } + + public User getUser() { + return user; + } + + public boolean isAnonymous() { + return isAnonymous; + } +} diff --git a/helpmehelpapplication/src/main/java/ntnu/sytemutvikling/team6/models/UserRegistry.java b/helpmehelpapplication/src/main/java/ntnu/systemutvikling/team6/models/UserRegistry.java similarity index 57% rename from helpmehelpapplication/src/main/java/ntnu/sytemutvikling/team6/models/UserRegistry.java rename to helpmehelpapplication/src/main/java/ntnu/systemutvikling/team6/models/UserRegistry.java index 7b97e02..c858e31 100644 --- a/helpmehelpapplication/src/main/java/ntnu/sytemutvikling/team6/models/UserRegistry.java +++ b/helpmehelpapplication/src/main/java/ntnu/systemutvikling/team6/models/UserRegistry.java @@ -1,6 +1,3 @@ package ntnu.sytemutvikling.team6.models; -public class UserRegistry { - - -} +public class UserRegistry {} diff --git a/helpmehelpapplication/src/main/java/ntnu/sytemutvikling/team6/models/user/Inbox.java b/helpmehelpapplication/src/main/java/ntnu/systemutvikling/team6/models/user/Inbox.java similarity index 89% rename from helpmehelpapplication/src/main/java/ntnu/sytemutvikling/team6/models/user/Inbox.java rename to helpmehelpapplication/src/main/java/ntnu/systemutvikling/team6/models/user/Inbox.java index 2aa0605..b560092 100644 --- a/helpmehelpapplication/src/main/java/ntnu/sytemutvikling/team6/models/user/Inbox.java +++ b/helpmehelpapplication/src/main/java/ntnu/systemutvikling/team6/models/user/Inbox.java @@ -5,17 +5,15 @@ // Enhetstester mangler /** - * Represents a user's inbox that contains messages. - * Provides methods to add, remove and get messages. + * Represents a user's inbox that contains messages. Provides methods to add, remove and get + * messages. * - * @author Robin Strand Prestmo + * @author Robin Strand Prestmo */ public class Inbox { private final List messages; - /** - * Creates an empty inbox with no messages. - */ + /** Creates an empty inbox with no messages. */ public Inbox() { this.messages = new ArrayList<>(); } diff --git a/helpmehelpapplication/src/main/java/ntnu/sytemutvikling/team6/models/user/Language.java b/helpmehelpapplication/src/main/java/ntnu/systemutvikling/team6/models/user/Language.java similarity index 98% rename from helpmehelpapplication/src/main/java/ntnu/sytemutvikling/team6/models/user/Language.java rename to helpmehelpapplication/src/main/java/ntnu/systemutvikling/team6/models/user/Language.java index 0afb14c..ddc5d82 100644 --- a/helpmehelpapplication/src/main/java/ntnu/sytemutvikling/team6/models/user/Language.java +++ b/helpmehelpapplication/src/main/java/ntnu/systemutvikling/team6/models/user/Language.java @@ -7,4 +7,4 @@ */ public enum Language { ENGLISH -} \ No newline at end of file +} diff --git a/helpmehelpapplication/src/main/java/ntnu/sytemutvikling/team6/models/user/Message.java b/helpmehelpapplication/src/main/java/ntnu/systemutvikling/team6/models/user/Message.java similarity index 83% rename from helpmehelpapplication/src/main/java/ntnu/sytemutvikling/team6/models/user/Message.java rename to helpmehelpapplication/src/main/java/ntnu/systemutvikling/team6/models/user/Message.java index eba920f..ef9707b 100644 --- a/helpmehelpapplication/src/main/java/ntnu/sytemutvikling/team6/models/user/Message.java +++ b/helpmehelpapplication/src/main/java/ntnu/systemutvikling/team6/models/user/Message.java @@ -8,7 +8,7 @@ /** * Represents a message. * - * @author Robin Strand Prestmo + * @author Robin Strand Prestmo */ public class Message { private final UUID id; @@ -18,18 +18,15 @@ public class Message { private final LocalDateTime timeAndDate; /** - * Creates a message with a unique identifier. - * The message includes a title, a string who it's from, - * content and the time and date. + * Creates a message with a unique identifier. The message includes a title, a string who it's + * from, content and the time and date. * * @param title the title of the message * @param from who the message is from * @param content the content of the message * @throws IllegalArgumentException if title, from or content is null or blank. */ - public Message(String title, - String from, - String content) { + public Message(String title, String from, String content) { if (title == null || title.isBlank()) { throw new IllegalArgumentException("Title cannot be null or blank."); @@ -69,4 +66,4 @@ public String getContent() { public LocalDateTime getTimeAndDate() { return timeAndDate; } -} \ No newline at end of file +} diff --git a/helpmehelpapplication/src/main/java/ntnu/sytemutvikling/team6/models/user/Role.java b/helpmehelpapplication/src/main/java/ntnu/systemutvikling/team6/models/user/Role.java similarity index 100% rename from helpmehelpapplication/src/main/java/ntnu/sytemutvikling/team6/models/user/Role.java rename to helpmehelpapplication/src/main/java/ntnu/systemutvikling/team6/models/user/Role.java diff --git a/helpmehelpapplication/src/main/java/ntnu/sytemutvikling/team6/models/user/Settings.java b/helpmehelpapplication/src/main/java/ntnu/systemutvikling/team6/models/user/Settings.java similarity index 76% rename from helpmehelpapplication/src/main/java/ntnu/sytemutvikling/team6/models/user/Settings.java rename to helpmehelpapplication/src/main/java/ntnu/systemutvikling/team6/models/user/Settings.java index 6bbc685..dd76557 100644 --- a/helpmehelpapplication/src/main/java/ntnu/sytemutvikling/team6/models/user/Settings.java +++ b/helpmehelpapplication/src/main/java/ntnu/systemutvikling/team6/models/user/Settings.java @@ -12,21 +12,17 @@ public class Settings { private Language language; private boolean anonymous; - /** - * Sets standard settings. - * LightMode enabled, language set to English, - * Anonymous disabled - */ + /** Sets standard settings. LightMode enabled, language set to English, Anonymous disabled */ public Settings() { this(true, Language.ENGLISH, false); } + /** * Creates settings for a user. * * @param lightMode choose between light or dark mode * @param language choose language * @param anonymous choose if user is anonymous - * */ public Settings(boolean lightMode, Language language, boolean anonymous) { if (language == null) { @@ -37,16 +33,12 @@ public Settings(boolean lightMode, Language language, boolean anonymous) { this.anonymous = anonymous; } - /** - * Toggles between light and dark mode - */ + /** Toggles between light and dark mode */ public void toggleLightMode() { lightMode = !lightMode; } - /** - * Toggles anonymous mode on and off - */ + /** Toggles anonymous mode on and off */ public void toggleAnonymousMode() { anonymous = !anonymous; } @@ -56,12 +48,12 @@ public void toggleAnonymousMode() { * * @param newLanguage the language to change to. */ - public void changeLanguage(Language newLanguage) { - if (newLanguage == null) { - throw new IllegalArgumentException("Language cannot be null"); - } + public void changeLanguage(Language newLanguage) { + if (newLanguage == null) { + throw new IllegalArgumentException("Language cannot be null"); + } language = newLanguage; - } + } public boolean isLightMode() { return lightMode; diff --git a/helpmehelpapplication/src/main/java/ntnu/sytemutvikling/team6/models/user/User.java b/helpmehelpapplication/src/main/java/ntnu/systemutvikling/team6/models/user/User.java similarity index 85% rename from helpmehelpapplication/src/main/java/ntnu/sytemutvikling/team6/models/user/User.java rename to helpmehelpapplication/src/main/java/ntnu/systemutvikling/team6/models/user/User.java index ba4a298..64594a0 100644 --- a/helpmehelpapplication/src/main/java/ntnu/sytemutvikling/team6/models/user/User.java +++ b/helpmehelpapplication/src/main/java/ntnu/systemutvikling/team6/models/user/User.java @@ -6,8 +6,8 @@ /** * Represents a user in the system. * - *

A user has a unique identifier, personal information, a hashed password, a role, - * settings and an inbox. + *

A user has a unique identifier, personal information, a hashed password, a role, settings and + * an inbox. * *

The password is never stored ad plain text. It is hashed using {@link PasswordHasher} * @@ -36,24 +36,16 @@ public class User { * @param inbox the user´s inbox * @throws IllegalArgumentException if any required argument is invalid. */ - public User(UUID id, - String name, - String email, - String password, - Role role, - Settings settings, - Inbox inbox) { - if (id == null) { - throw new IllegalArgumentException("ID cannot be null."); - } + public User( + String name, String email, String password, Role role, Settings settings, Inbox inbox) { if (name == null || name.isBlank()) { throw new IllegalArgumentException("Name cannot be null or blank."); } if (email == null || email.isBlank() || !email.contains("@") || !email.contains(".")) { - throw new IllegalArgumentException("Email cannot be null or blank," - + " and must contain '@' and '.'"); + throw new IllegalArgumentException( + "Email cannot be null or blank," + " and must contain '@' and '.'"); } if (role == null) { @@ -68,7 +60,7 @@ public User(UUID id, throw new IllegalArgumentException("Inbox cannot be null"); } - this.id = id; + this.id = UUID.randomUUID(); this.name = name; this.email = email; this.passwordHash = passwordHasher.getHashPassword(password); @@ -137,8 +129,8 @@ public void setPassword(String password) { */ public void setEmail(String email) { if (email == null || email.isBlank() || !email.contains("@") || !email.contains(".")) { - throw new IllegalArgumentException("Email cannot be null or blank," - + " and must contains '@' and '.'"); + throw new IllegalArgumentException( + "Email cannot be null or blank," + " and must contains '@' and '.'"); } this.email = email; } @@ -154,4 +146,4 @@ public void setEmail(String email) { public boolean checkPassword(String password) { return passwordHasher.isValidPassword(password, passwordHash); } -} \ No newline at end of file +} diff --git a/helpmehelpapplication/src/main/java/ntnu/sytemutvikling/team6/security/PasswordHasher.java b/helpmehelpapplication/src/main/java/ntnu/systemutvikling/team6/security/PasswordHasher.java similarity index 98% rename from helpmehelpapplication/src/main/java/ntnu/sytemutvikling/team6/security/PasswordHasher.java rename to helpmehelpapplication/src/main/java/ntnu/systemutvikling/team6/security/PasswordHasher.java index 60b2876..8c2f7d9 100644 --- a/helpmehelpapplication/src/main/java/ntnu/sytemutvikling/team6/security/PasswordHasher.java +++ b/helpmehelpapplication/src/main/java/ntnu/systemutvikling/team6/security/PasswordHasher.java @@ -9,9 +9,8 @@ /** * A utility for hashing and verifying passwords using PBKDF2. * - *

The generated hash contains both a random salt and the hashed password, - * encoded as Base64 string. - *

+ *

The generated hash contains both a random salt and the hashed password, encoded as Base64 + * string. * * @author Robin Strand Prestmo */ diff --git a/helpmehelpapplication/src/main/java/ntnu/systemutvikling/team6/service/AuthenticationService.java b/helpmehelpapplication/src/main/java/ntnu/systemutvikling/team6/service/AuthenticationService.java new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/helpmehelpapplication/src/main/java/ntnu/systemutvikling/team6/service/AuthenticationService.java @@ -0,0 +1 @@ + diff --git a/helpmehelpapplication/src/main/java/ntnu/sytemutvikling/team6/service/CharityService.java b/helpmehelpapplication/src/main/java/ntnu/systemutvikling/team6/service/CharityService.java similarity index 54% rename from helpmehelpapplication/src/main/java/ntnu/sytemutvikling/team6/service/CharityService.java rename to helpmehelpapplication/src/main/java/ntnu/systemutvikling/team6/service/CharityService.java index 62fe87c..3b66851 100644 --- a/helpmehelpapplication/src/main/java/ntnu/sytemutvikling/team6/service/CharityService.java +++ b/helpmehelpapplication/src/main/java/ntnu/systemutvikling/team6/service/CharityService.java @@ -1,5 +1,3 @@ package ntnu.sytemutvikling.team6.service; -public class CharityService { - -} +public class CharityService {} diff --git a/helpmehelpapplication/src/main/java/ntnu/sytemutvikling/team6/service/DonationService.java b/helpmehelpapplication/src/main/java/ntnu/systemutvikling/team6/service/DonationService.java similarity index 53% rename from helpmehelpapplication/src/main/java/ntnu/sytemutvikling/team6/service/DonationService.java rename to helpmehelpapplication/src/main/java/ntnu/systemutvikling/team6/service/DonationService.java index ea3b1d7..17692d5 100644 --- a/helpmehelpapplication/src/main/java/ntnu/sytemutvikling/team6/service/DonationService.java +++ b/helpmehelpapplication/src/main/java/ntnu/systemutvikling/team6/service/DonationService.java @@ -1,5 +1,3 @@ package ntnu.sytemutvikling.team6.service; -public class DonationService { - -} +public class DonationService {} diff --git a/helpmehelpapplication/src/main/java/ntnu/sytemutvikling/team6/service/FeedbackService.java b/helpmehelpapplication/src/main/java/ntnu/systemutvikling/team6/service/FeedbackService.java similarity index 53% rename from helpmehelpapplication/src/main/java/ntnu/sytemutvikling/team6/service/FeedbackService.java rename to helpmehelpapplication/src/main/java/ntnu/systemutvikling/team6/service/FeedbackService.java index 8aedf7f..27eee23 100644 --- a/helpmehelpapplication/src/main/java/ntnu/sytemutvikling/team6/service/FeedbackService.java +++ b/helpmehelpapplication/src/main/java/ntnu/systemutvikling/team6/service/FeedbackService.java @@ -1,5 +1,3 @@ package ntnu.sytemutvikling.team6.service; -public class FeedbackService { - -} +public class FeedbackService {} diff --git a/helpmehelpapplication/src/main/java/ntnu/sytemutvikling/team6/Main.java b/helpmehelpapplication/src/main/java/ntnu/sytemutvikling/team6/Main.java deleted file mode 100644 index d265ebe..0000000 --- a/helpmehelpapplication/src/main/java/ntnu/sytemutvikling/team6/Main.java +++ /dev/null @@ -1,7 +0,0 @@ -package ntnu.sytemutvikling.team6; - -public class Main { - public static void main(String[] args) { - System.out.println("Hello world!"); - } -} \ No newline at end of file diff --git a/helpmehelpapplication/src/main/java/ntnu/sytemutvikling/team6/models/Charity.java b/helpmehelpapplication/src/main/java/ntnu/sytemutvikling/team6/models/Charity.java deleted file mode 100644 index 4a389f4..0000000 --- a/helpmehelpapplication/src/main/java/ntnu/sytemutvikling/team6/models/Charity.java +++ /dev/null @@ -1,98 +0,0 @@ -/** - * This class represents a charity organization. It contains information about the charity such as its name, description, total donations, verification status, and category. - * - * @author Adrian Balunan - */ -package ntnu.sytemutvikling.team6.models; - -import java.util.List; -import java.util.UUID; -import java.util.ArrayList; - -abstract class Charity { - /* UUID for uniquely identifying each charity */ - private UUID id; - - /* Name of the charity */ - private String name; - - /* Description of the charity's mission and activities */ - private String description; - - /* Total Donations received */ - private int totalDonations; - - /* Is the charity verified? */ - private boolean isVerified; - - /* Category for the charity */ - private String category; - - /* List that contains the charity's Feedbacks */ - private List feedbacks; - - /** - * Konstructor for creating a new charity. - * The ID is generated automatically using UUID. - * Total donations are initialized to 0. - * The charity is unverified by default. - * - * @param name - * @param description - * @param category - */ - public Charity(String name, String description, String category) { - this.id = UUID.randomUUID(); - this.name = name; - this.description = description; - this.totalDonations = 0; - this.isVerified = false; - this.feedbacks = new ArrayList<>(); - this.category = category; - } - - /** - * Getters for the charity's attributes. - */ - public UUID getId() { - return id; - } - public String getCategory() { - return category; - } - public String getName() { - return name; - } - public String getDescription() { - return description; - } - public int getTotalDonations() { - return totalDonations; - } - public boolean isVerified() { - return isVerified; - } - - /** - * Setter for verification status. - * This one sets the charity as verified. - */ - public void setVerified() { - this.isVerified = true; - } - - /** - * Setter for verification status. - * This one sets the charity as unverified. - */ - public void setUnverified() { - this.isVerified = false; - } - - /** - * Setter for total donations. This method is used to update the total donations when a new donation is made. - */ - public void setTotalDonations(int amount) { - this.totalDonations += amount; - } -} diff --git a/helpmehelpapplication/src/main/java/ntnu/sytemutvikling/team6/models/CharityRegistry.java b/helpmehelpapplication/src/main/java/ntnu/sytemutvikling/team6/models/CharityRegistry.java deleted file mode 100644 index a8d698e..0000000 --- a/helpmehelpapplication/src/main/java/ntnu/sytemutvikling/team6/models/CharityRegistry.java +++ /dev/null @@ -1,38 +0,0 @@ -package ntnu.sytemutvikling.team6.models; - -import java.util.*; - -public class CharityRegistry{ - private final List charities; - - public CharityRegistry(){ - this.charities = new ArrayList<>(); - } - - public List getAllCharities(){ - return Collections.unmodifiableList(charities); - } - - public Optional findCharityById(UUID charityId){ - if(charityId == null){ - throw new IllegalArgumentException("CharityId can not be null."); - } - return charities.stream() - .filter(charity -> charityId.equals(charity.getId())) - .findFirst(); - } - - public void addCharity(Charity charity){ - if(charity == null){ - throw new IllegalArgumentException("Charity can not be null."); - } - charities.add(charity); - } - - public boolean removeCharity(UUID charityId){ - if(charityId == null){ - throw new IllegalArgumentException("CharityId can not be null."); - } - return charities.removeIf(charity -> charityId.equals(charity.getId())); - } -} \ No newline at end of file diff --git a/helpmehelpapplication/src/main/java/ntnu/sytemutvikling/team6/models/Donation.java b/helpmehelpapplication/src/main/java/ntnu/sytemutvikling/team6/models/Donation.java deleted file mode 100644 index c72fbee..0000000 --- a/helpmehelpapplication/src/main/java/ntnu/sytemutvikling/team6/models/Donation.java +++ /dev/null @@ -1,81 +0,0 @@ -package ntnu.sytemutvikling.team6.models; - -import ntnu.sytemutvikling.team6.models.user.User; - -import java.time.LocalDateTime; -import java.util.UUID; - -public class Donation { - /* UUID for uniquely identifying each donation */ - private UUID charityId; - - /* Ammount of money donated */ - private double amount; - - /* Date and time of the donation */ - private LocalDateTime date; - - /* The charity that received the donation */ - private Charity charity; - - /* The user/donor that made the donation */ - private User donor; - - /** - * Is the donation made anonymously? - * This can be null if the donation was made anonymously. - * - */ - private boolean isAnonymous; - - /** - * Constructor for creating a new donation. - * The charityId is generated automatically using UUID. - * If the donation is made anonymously, the isAnonymous parameter is set to true. - * @param amount - * @param date - * @param charity - * @param donor - */ - public Donation(double amount, LocalDateTime date, Charity charity, User donor) { - this.charityId = UUID.randomUUID(); - this.amount = amount; - this.date = date; - this.charity = charity; - this.donor = donor; - - - // ASSUMES that this is the way to get the anonymous setting from the user's settings. - if (donor.getSettings().isAnonymous() == false) { - this.isAnonymous = true; - } else { - this.isAnonymous = false; - - } - } - - /* Getters for the donation's attributes */ - public boolean isAnonymous() { - return isAnonymous; - } - - public UUID getCharityId() { - return charityId; - } - - public double getAmount() { - return amount; - } - - public LocalDateTime getDate() { - return date; - } - - public Charity getCharity() { - return charity; - } - - public User getDonor() { - return donor; - } -} diff --git a/helpmehelpapplication/src/main/java/ntnu/sytemutvikling/team6/models/DonationRegistry.java b/helpmehelpapplication/src/main/java/ntnu/sytemutvikling/team6/models/DonationRegistry.java deleted file mode 100644 index a84ec79..0000000 --- a/helpmehelpapplication/src/main/java/ntnu/sytemutvikling/team6/models/DonationRegistry.java +++ /dev/null @@ -1,39 +0,0 @@ -package ntnu.sytemutvikling.team6.models; - -import java.util.*; - -public class DonationRegistry { - private final List donations; - - public DonationRegistry(){ - this.donations = new ArrayList<>(); - } - - public List getAllDonations(){ - return Collections.unmodifiableList(donations); - } - - public Optional findDonationById(UUID donationId){ - if(donationId == null){ - throw new IllegalArgumentException("DonationId can not be null."); - } - return donations.stream() - .filter(donations -> donationId.equals(donations.getCharityId())) - .findFirst(); - } - - public void addDonation(Donation donation){ - if(donation == null){ - throw new IllegalArgumentException("Donation can not be null."); - } - donations.add(donation); - } - - public boolean removeDonation(UUID donationId){ - if(donationId == null){ - throw new IllegalArgumentException("DonationId can not be null."); - } - return donations.removeIf(donation -> donationId.equals(donation.getCharityId())); - } - -} diff --git a/helpmehelpapplication/src/main/java/ntnu/sytemutvikling/team6/models/Feedback.java b/helpmehelpapplication/src/main/java/ntnu/sytemutvikling/team6/models/Feedback.java deleted file mode 100644 index 4825c95..0000000 --- a/helpmehelpapplication/src/main/java/ntnu/sytemutvikling/team6/models/Feedback.java +++ /dev/null @@ -1,67 +0,0 @@ -package ntnu.sytemutvikling.team6.models; - -import ntnu.sytemutvikling.team6.models.user.User; - -import java.time.LocalDateTime; -import java.util.UUID; - -public class Feedback { - /* Feedback id */ - private UUID feedbackId; - - /** - * The author of the feedback - * If annonymous the presentation of the user will be "Anonymous". - */ - private User user; - - /* The details of the feedback*/ - private String comment; - - /* The date and time when the feedback was given */ - private LocalDateTime date; - - /* Is the feedback given anonymously? */ - private boolean isAnonymous; - - /** - * Constructor for creating a new feedback. - * - * @param user The user who gives the feedback. - * @param comment The content of the feedback. - */ - public Feedback(User user, String comment) { - this.feedbackId = UUID.randomUUID(); - this.user = user; - this.comment = comment; - this.date = LocalDateTime.now(); - - // ASSUMES that this is the way to get the anonymous setting from the user's settings. - if (user.getSettings().isAnonymous() == false) { - this.isAnonymous = true; - } else { - this.isAnonymous = false; - } - } - - /** - * Getters for the feedback's attributes. - * - * @return The feedback's attributes. - */ - public UUID getFeedbackId() { - return feedbackId; - } - public String getComment() { - return comment; - } - public LocalDateTime getDate() { - return date; - } - public User getUser() { - return user; - } - public boolean isAnonymous() { - return isAnonymous; - } -} diff --git a/helpmehelpapplication/src/main/java/ntnu/sytemutvikling/team6/service/AuthenticationService.java b/helpmehelpapplication/src/main/java/ntnu/sytemutvikling/team6/service/AuthenticationService.java deleted file mode 100644 index e69de29..0000000 diff --git a/helpmehelpapplication/src/main/resources/fxml/donationPage.fxml b/helpmehelpapplication/src/main/resources/fxml/donationPage.fxml new file mode 100644 index 0000000..d5f8881 --- /dev/null +++ b/helpmehelpapplication/src/main/resources/fxml/donationPage.fxml @@ -0,0 +1,247 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/helpmehelpapplication/src/main/resources/fxml/frontPage.fxml b/helpmehelpapplication/src/main/resources/fxml/frontPage.fxml new file mode 100644 index 0000000..079993c --- /dev/null +++ b/helpmehelpapplication/src/main/resources/fxml/frontPage.fxml @@ -0,0 +1,383 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/helpmehelpapplication/src/main/resources/images/Logo.png b/helpmehelpapplication/src/main/resources/images/Logo.png new file mode 100644 index 0000000..ccddd51 Binary files /dev/null and b/helpmehelpapplication/src/main/resources/images/Logo.png differ diff --git a/helpmehelpapplication/src/main/resources/images/img.png b/helpmehelpapplication/src/main/resources/images/img.png new file mode 100644 index 0000000..586512b Binary files /dev/null and b/helpmehelpapplication/src/main/resources/images/img.png differ diff --git a/helpmehelpapplication/src/test/java/ntnu/systemutvikling/team6/models/CharityRegistryTest.java b/helpmehelpapplication/src/test/java/ntnu/systemutvikling/team6/models/CharityRegistryTest.java new file mode 100644 index 0000000..232431f --- /dev/null +++ b/helpmehelpapplication/src/test/java/ntnu/systemutvikling/team6/models/CharityRegistryTest.java @@ -0,0 +1,91 @@ +package ntnu.systemutvikling.team6.models; + +import static org.junit.jupiter.api.Assertions.*; + +import java.util.List; +import java.util.Optional; +import java.util.UUID; +import ntnu.sytemutvikling.team6.models.Charity; +import ntnu.sytemutvikling.team6.models.CharityRegistry; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +/** + * UnitTest for CharityRegistry class + * + * @author Adrian Balunan + */ +public class CharityRegistryTest { + private CharityRegistry registry; + private Charity charity; + + /* Setting up variables */ + @BeforeEach + public void setup() { + registry = new CharityRegistry(); + charity = new Charity("Charity1", "Something Somewhere Somehow", "Cancer"); + } + + @Test + void testAddCharitySuccessfully() { + registry.addCharity(charity); + + assertEquals(1, registry.getAllCharities().size()); + assertTrue(registry.getAllCharities().contains(charity)); + } + + @Test + void testAddCharityNullThrowsException() { + assertThrows(IllegalArgumentException.class, () -> registry.addCharity(null)); + } + + @Test + void testGetAllCharitiesReturnsUnmodifiableList() { + registry.addCharity(charity); + + List charities = registry.getAllCharities(); + assertThrows(UnsupportedOperationException.class, () -> charities.add(charity)); + } + + @Test + void testFindCharityByIdFound() { + registry.addCharity(charity); + + Optional result = registry.findCharityById(charity.getId()); + + assertTrue(result.isPresent()); + assertEquals(charity, result.get()); + } + + @Test + void testFindCharityByIdNotFound() { + Optional result = registry.findCharityById(UUID.randomUUID()); + assertTrue(result.isEmpty()); + } + + @Test + void testFindCharityByIdNullThrowsException() { + assertThrows(IllegalArgumentException.class, () -> registry.findCharityById(null)); + } + + @Test + void testRemoveCharitySuccessfully() { + registry.addCharity(charity); + + boolean removed = registry.removeCharity(charity.getId()); + + assertTrue(removed); + assertTrue(registry.getAllCharities().isEmpty()); + } + + @Test + void testRemoveCharityNotFound() { + boolean removed = registry.removeCharity(UUID.randomUUID()); + assertFalse(removed); + } + + @Test + void testRemoveCharityNullThrowsException() { + assertThrows(IllegalArgumentException.class, () -> registry.removeCharity(null)); + } +} diff --git a/helpmehelpapplication/src/test/java/ntnu/systemutvikling/team6/models/CharityTest.java b/helpmehelpapplication/src/test/java/ntnu/systemutvikling/team6/models/CharityTest.java new file mode 100644 index 0000000..5c2f9c2 --- /dev/null +++ b/helpmehelpapplication/src/test/java/ntnu/systemutvikling/team6/models/CharityTest.java @@ -0,0 +1,62 @@ +package ntnu.systemutvikling.team6.models; + +import static org.junit.jupiter.api.Assertions.*; + +import java.util.UUID; +import ntnu.sytemutvikling.team6.models.Charity; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +/** + * UnitTesting for Charity. + * + * @author Adrian Balunan + */ +public class CharityTest { + private Charity charity; + + @BeforeEach + public void setup() { + charity = new Charity("Charity1", "Something Somewhere Somehow", "Cancer"); + } + + /** Getters should work: */ + @Test + public void testGettingIdShouldWork() { + assertInstanceOf(UUID.class, charity.getId()); + } + + @Test + public void testGettingCategoryShouldWork() { + assertEquals("Cancer", charity.getCategory()); + } + + @Test + public void testGettingNameShouldWork() { + assertEquals("Charity1", charity.getName()); + } + + @Test + public void testGettingDescriptionShouldWork() { + assertEquals("Something Somewhere Somehow", charity.getDescription()); + } + + /** Getter and setter for IsVerified should be able to switch between true and false */ + @Test + public void testIsVerifiedReturnsCorrectly() { + assertFalse(charity.isVerified()); + charity.setVerified(); + assertTrue(charity.isVerified()); + charity.setUnverified(); + assertFalse(charity.isVerified()); + } + + /** totalDonations should display accuratly and adding works */ + @Test + public void testTotalDonationsReturnsCorrectlyAfterChanges() { + assertEquals(0, charity.getTotalDonations()); + charity.setTotalDonations(10); + charity.setTotalDonations(5); + assertEquals(15, charity.getTotalDonations()); + } +} diff --git a/helpmehelpapplication/src/test/java/ntnu/systemutvikling/team6/models/DonationTest.java b/helpmehelpapplication/src/test/java/ntnu/systemutvikling/team6/models/DonationTest.java new file mode 100644 index 0000000..17bfaef --- /dev/null +++ b/helpmehelpapplication/src/test/java/ntnu/systemutvikling/team6/models/DonationTest.java @@ -0,0 +1,93 @@ +package ntnu.systemutvikling.team6.models; + +import static org.junit.jupiter.api.Assertions.*; + +import java.time.LocalDateTime; +import ntnu.sytemutvikling.team6.models.Charity; +import ntnu.sytemutvikling.team6.models.Donation; +import ntnu.sytemutvikling.team6.models.user.Inbox; +import ntnu.sytemutvikling.team6.models.user.Role; +import ntnu.sytemutvikling.team6.models.user.Settings; +import ntnu.sytemutvikling.team6.models.user.User; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +class DonationTest { + private Settings settings; + private User user; + private Charity charity; + + // -- Setup -- + @BeforeEach + public void setup() { + charity = new Charity("name", "something somewhere somehow", "Meow"); + user = + new User("Name", "Valid@gmail.com", "123", Role.NORMAL_USER, new Settings(), new Inbox()); + } + + // --- Tests --- + @Test + void testDonationInitialization() { + LocalDateTime now = LocalDateTime.now(); + + Donation donation = new Donation(500.0, now, charity, user); + + assertNotNull(donation.getCharityId()); + assertEquals(500.0, donation.getAmount()); + assertEquals(now, donation.getDate()); + assertEquals(charity, donation.getCharity()); + assertEquals(user, donation.getDonor()); + } + + @Test + void testAnonymousFlagWhenUserIsAnonymous() { + Donation donation = new Donation(100, LocalDateTime.now(), charity, user); + + assertFalse(donation.isAnonymous()); + } + + @Test + void testAnonymousFlagWhenUserIsNotAnonymous() { + Donation donation = new Donation(100, LocalDateTime.now(), charity, user); + + assertFalse(donation.isAnonymous()); + } + + @Test + void testCharityIdIsUnique() { + Donation d1 = new Donation(50, LocalDateTime.now(), charity, user); + Donation d2 = new Donation(75, LocalDateTime.now(), charity, user); + + assertNotEquals(d1.getCharityId(), d2.getCharityId()); + } + + @Test + void testAmountStoredCorrectly() { + Donation donation = new Donation(123.45, LocalDateTime.now(), charity, user); + + assertEquals(123.45, donation.getAmount()); + } + + @Test + void testDateStoredCorrectly() { + LocalDateTime date = LocalDateTime.of(2024, 5, 10, 12, 30); + + Donation donation = new Donation(200, date, charity, user); + + assertEquals(date, donation.getDate()); + } + + @Test + void testCharityStoredCorrectly() { + Donation donation = new Donation(200, LocalDateTime.now(), charity, user); + + assertEquals(charity, donation.getCharity()); + } + + @Test + void testDonorStoredCorrectly() { + Donation donation = new Donation(200, LocalDateTime.now(), charity, user); + + assertEquals(user, donation.getDonor()); + } +} diff --git a/helpmehelpapplication/src/test/java/ntnu/systemutvikling/team6/models/FeedbackTest.java b/helpmehelpapplication/src/test/java/ntnu/systemutvikling/team6/models/FeedbackTest.java new file mode 100644 index 0000000..a9fc57d --- /dev/null +++ b/helpmehelpapplication/src/test/java/ntnu/systemutvikling/team6/models/FeedbackTest.java @@ -0,0 +1,87 @@ +package ntnu.systemutvikling.team6.models; + +import static org.junit.jupiter.api.Assertions.*; + +import java.time.LocalDateTime; +import ntnu.sytemutvikling.team6.models.Feedback; +import ntnu.sytemutvikling.team6.models.user.Inbox; +import ntnu.sytemutvikling.team6.models.user.Role; +import ntnu.sytemutvikling.team6.models.user.Settings; +import ntnu.sytemutvikling.team6.models.user.User; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +class FeedbackTest { + + private User user; + private Settings settings; + + // -- Setup -- + @BeforeEach + public void setup() { + settings = new Settings(); // default anonymous = true + user = + new User("Name", "Valid@gmail.com", "123", Role.NORMAL_USER, new Settings(), new Inbox()); + } + + // --- Tests --- + + @Test + void testFeedbackInitialization() { + LocalDateTime before = LocalDateTime.now(); + Feedback feedback = new Feedback(user, "Nice work!"); + LocalDateTime after = LocalDateTime.now(); + + assertNotNull(feedback.getFeedbackId()); + assertEquals("Nice work!", feedback.getComment()); + assertEquals(user, feedback.getUser()); + + // Date should be between before and after + assertTrue(!feedback.getDate().isBefore(before) && !feedback.getDate().isAfter(after)); + } + + @Test + void testAnonymousFlagWhenUserIsAnonymous() { + // user.settings.isAnonymous() == true → feedback.isAnonymous = false + Feedback feedback = new Feedback(user, "Anonymous feedback"); + + assertFalse(feedback.isAnonymous()); + } + + @Test + void testAnonymousFlagWhenUserIsNotAnonymous() { + user.getSettings().toggleAnonymousMode(); + Feedback feedback = new Feedback(user, "Not anonymous"); + + assertTrue(feedback.isAnonymous()); + } + + @Test + void testFeedbackIdIsUnique() { + Feedback f1 = new Feedback(user, "First"); + Feedback f2 = new Feedback(user, "Second"); + + assertNotEquals(f1.getFeedbackId(), f2.getFeedbackId()); + } + + @Test + void testCommentStoredCorrectly() { + Feedback feedback = new Feedback(user, "This is a test comment"); + + assertEquals("This is a test comment", feedback.getComment()); + } + + @Test + void testUserStoredCorrectly() { + Feedback feedback = new Feedback(user, "Hello"); + + assertEquals(user, feedback.getUser()); + } + + @Test + void testDateIsSet() { + Feedback feedback = new Feedback(user, "Testing date"); + + assertNotNull(feedback.getDate()); + } +} diff --git a/helpmehelpapplication/src/test/java/ntnu/systemutvikling/team6/models/user/SettingsTest.java b/helpmehelpapplication/src/test/java/ntnu/systemutvikling/team6/models/user/SettingsTest.java new file mode 100644 index 0000000..18b2814 --- /dev/null +++ b/helpmehelpapplication/src/test/java/ntnu/systemutvikling/team6/models/user/SettingsTest.java @@ -0,0 +1,70 @@ +package ntnu.systemutvikling.team6.models.user; + +import static org.junit.jupiter.api.Assertions.*; + +import ntnu.sytemutvikling.team6.models.user.Language; +import ntnu.sytemutvikling.team6.models.user.Settings; +import org.junit.jupiter.api.Test; + +class SettingsTest { + + @Test + void testDefaultConstructorSetsStandardValues() { + Settings settings = new Settings(); + + assertTrue(settings.isLightMode()); + assertEquals(Language.ENGLISH, settings.getLanguage()); + assertFalse(settings.isAnonymous()); + } + + @Test + void testCustomConstructorSetsValuesCorrectly() { + Settings settings = new Settings(false, Language.ENGLISH, true); + + assertFalse(settings.isLightMode()); + assertEquals(Language.ENGLISH, settings.getLanguage()); + assertTrue(settings.isAnonymous()); + } + + @Test + void testConstructorThrowsExceptionWhenLanguageIsNull() { + assertThrows(IllegalArgumentException.class, () -> new Settings(true, null, false)); + } + + @Test + void testToggleLightMode() { + Settings settings = new Settings(true, Language.ENGLISH, false); + + settings.toggleLightMode(); + assertFalse(settings.isLightMode()); + + settings.toggleLightMode(); + assertTrue(settings.isLightMode()); + } + + @Test + void testToggleAnonymousMode() { + Settings settings = new Settings(true, Language.ENGLISH, false); + + settings.toggleAnonymousMode(); + assertTrue(settings.isAnonymous()); + + settings.toggleAnonymousMode(); + assertFalse(settings.isAnonymous()); + } + + @Test + void testChangeLanguageSuccessfully() { + Settings settings = new Settings(); + + settings.changeLanguage(Language.ENGLISH); + assertEquals(Language.ENGLISH, settings.getLanguage()); + } + + @Test + void testChangeLanguageThrowsExceptionWhenNull() { + Settings settings = new Settings(); + + assertThrows(IllegalArgumentException.class, () -> settings.changeLanguage(null)); + } +} diff --git a/helpmehelpapplication/src/test/java/ntnu/systemutvikling/team6/models/user/UserTest.java b/helpmehelpapplication/src/test/java/ntnu/systemutvikling/team6/models/user/UserTest.java new file mode 100644 index 0000000..fd20091 --- /dev/null +++ b/helpmehelpapplication/src/test/java/ntnu/systemutvikling/team6/models/user/UserTest.java @@ -0,0 +1,153 @@ +package ntnu.systemutvikling.team6.models.user; + +import static org.junit.jupiter.api.Assertions.*; +import static org.junit.jupiter.api.Assertions.assertEquals; + +import java.util.UUID; + +import ntnu.sytemutvikling.team6.models.user.Inbox; +import ntnu.sytemutvikling.team6.models.user.Role; +import ntnu.sytemutvikling.team6.models.user.Settings; +import ntnu.sytemutvikling.team6.models.user.User; +import org.junit.jupiter.api.Nested; +import org.junit.jupiter.api.Test; + +class UserTest { + + @Nested + class constructorTests { + private final UUID validID = UUID.randomUUID(); + private final String validName = "Name"; + private final String validEmail = "Email@gmail.com"; + private final String validPassword = "Password"; + private final Role validRole = Role.NORMAL_USER; + private final Settings validSettings = new Settings(); + private final Inbox validInbox = new Inbox(); + + @Test + void shouldThrowIfNameIsNull() { + assertThrows( + IllegalArgumentException.class, + () -> + new User( + null, validEmail, validPassword, validRole, validSettings, validInbox)); + } + + @Test + void shouldThrowIfNameIsBlank() { + assertThrows( + IllegalArgumentException.class, + () -> + new User( + " ", validEmail, validPassword, validRole, validSettings, validInbox)); + } + + @Nested + class emailTests { + + @Test + void shouldThrowIfEmailIsNull() { + assertThrows( + IllegalArgumentException.class, + () -> + new User( + validName, null, validPassword, validRole, validSettings, validInbox)); + } + + @Test + void shouldThrowIfEmailIsBlank() { + assertThrows( + IllegalArgumentException.class, + () -> + new User( + validName, " ", validPassword, validRole, validSettings, validInbox)); + } + + @Test + void shouldThrowIfEmailDoesNotContainAt() { + assertThrows( + IllegalArgumentException.class, + () -> + new User( + + validName, + "test.gmail.com", + validPassword, + validRole, + validSettings, + validInbox)); + } + + @Test + void shouldThrowIfEmailDoesNotContainPeriod() { + assertThrows( + IllegalArgumentException.class, + () -> + new User( + + validName, + "test@gmailcom", + validPassword, + validRole, + validSettings, + validInbox)); + } + } + + @Test + void shouldThrowIfPasswordIsNull() { + assertThrows( + IllegalArgumentException.class, + () -> + new User( validName, validEmail, null, validRole, validSettings, validInbox)); + } + + @Test + void shouldThrowIfRoleIsNull() { + assertThrows( + IllegalArgumentException.class, + () -> + new User( + validName, validEmail, validPassword, null, validSettings, validInbox)); + } + + @Test + void shouldThrowIfPasswordIsBlank() { + assertThrows( + IllegalArgumentException.class, + () -> + new User( validName, validEmail, " ", validRole, validSettings, validInbox)); + } + + @Test + void shouldThrowIfSettingsIsNull() { + assertThrows( + IllegalArgumentException.class, + () -> + new User( validName, validEmail, validPassword, validRole, null, validInbox)); + } + + @Test + void shouldThrowIfInboxIsNull() { + assertThrows( + IllegalArgumentException.class, + () -> + new User( + validName, validEmail, validPassword, validRole, validSettings, null)); + } + + @Test + void shouldCreateUser() { + User user = + new User( + validName, validEmail, validPassword, validRole, validSettings, validInbox); + + assertAll( + () -> assertEquals(validName, user.getName()), + () -> assertEquals(validEmail, user.getEmail()), + () -> assertEquals(validRole, user.getRole()), + () -> assertEquals(validSettings, user.getSettings()), + () -> assertEquals(validInbox, user.getInbox())); + } + } +} diff --git a/helpmehelpapplication/src/test/java/ntnu/sytemutvikling/team6/security/PasswordHasherTest.java b/helpmehelpapplication/src/test/java/ntnu/systemutvikling/team6/security/PasswordHasherTest.java similarity index 94% rename from helpmehelpapplication/src/test/java/ntnu/sytemutvikling/team6/security/PasswordHasherTest.java rename to helpmehelpapplication/src/test/java/ntnu/systemutvikling/team6/security/PasswordHasherTest.java index 68a9409..d195989 100644 --- a/helpmehelpapplication/src/test/java/ntnu/sytemutvikling/team6/security/PasswordHasherTest.java +++ b/helpmehelpapplication/src/test/java/ntnu/systemutvikling/team6/security/PasswordHasherTest.java @@ -1,10 +1,11 @@ -package ntnu.sytemutvikling.team6.security; +package ntnu.systemutvikling.team6.security; +import static org.junit.jupiter.api.Assertions.*; + +import ntnu.sytemutvikling.team6.security.PasswordHasher; import org.junit.jupiter.api.Nested; import org.junit.jupiter.api.Test; -import static org.junit.jupiter.api.Assertions.*; - class PasswordHasherTest { private final PasswordHasher hasher = new PasswordHasher(); @@ -67,4 +68,4 @@ void shouldThrowIfStoredHashIsBlank() { assertThrows(RuntimeException.class, () -> hasher.isValidPassword("Password", " ")); } } -} \ No newline at end of file +} diff --git a/helpmehelpapplication/src/test/java/ntnu/sytemutvikling/team6/models/user/UserTest.java b/helpmehelpapplication/src/test/java/ntnu/sytemutvikling/team6/models/user/UserTest.java deleted file mode 100644 index 5fa92c8..0000000 --- a/helpmehelpapplication/src/test/java/ntnu/sytemutvikling/team6/models/user/UserTest.java +++ /dev/null @@ -1,218 +0,0 @@ -package ntnu.sytemutvikling.team6.models.user; - -import org.junit.jupiter.api.Nested; -import org.junit.jupiter.api.Test; - -import java.util.UUID; - -import static org.junit.jupiter.api.Assertions.*; -import static org.junit.jupiter.api.Assertions.assertEquals; - -class UserTest { - - @Nested - class constructorTests { - private final UUID validID = UUID.randomUUID(); - private final String validName = "Name"; - private final String validEmail = "Email@gmail.com"; - private final String validPassword = "Password"; - private final Role validRole = Role.NORMAL_USER; - private final Settings validSettings = new Settings(); - private final Inbox validInbox = new Inbox(); - - @Test - void shouldThrowIfIdIsNull() { - assertThrows(IllegalArgumentException.class, () -> - new User( - null, - validName, - validEmail, - validPassword, - validRole, - validSettings, - validInbox - )); - } - - @Test - void shouldThrowIfNameIsNull() { - assertThrows(IllegalArgumentException.class, () -> - new User( - validID, - null, - validEmail, - validPassword, - validRole, - validSettings, - validInbox - )); - } - - @Test - void shouldThrowIfNameIsBlank() { - assertThrows(IllegalArgumentException.class, () -> - new User( - validID, - " ", - validEmail, - validPassword, - validRole, - validSettings, - validInbox - )); - } - - @Nested - class emailTests { - - @Test - void shouldThrowIfEmailIsNull() { - assertThrows(IllegalArgumentException.class, () -> - new User( - validID, - validName, - null, - validPassword, - validRole, - validSettings, - validInbox - )); - } - - @Test - void shouldThrowIfEmailIsBlank() { - assertThrows(IllegalArgumentException.class, () -> - new User( - validID, - validName, - " ", - validPassword, - validRole, - validSettings, - validInbox - )); - } - - @Test - void shouldThrowIfEmailDoesNotContainAt() { - assertThrows(IllegalArgumentException.class, () -> - new User( - validID, - validName, - "test.gmail.com", - validPassword, - validRole, - validSettings, - validInbox - )); - } - - @Test - void shouldThrowIfEmailDoesNotContainPeriod() { - assertThrows(IllegalArgumentException.class, () -> - new User( - validID, - validName, - "test@gmailcom", - validPassword, - validRole, - validSettings, - validInbox - )); - } - } - - @Test - void shouldThrowIfPasswordIsNull() { - assertThrows(IllegalArgumentException.class, () -> - new User( - validID, - validName, - validEmail, - null, - validRole, - validSettings, - validInbox - )); - } - - @Test - void shouldThrowIfRoleIsNull() { - assertThrows(IllegalArgumentException.class, () -> - new User( - validID, - validName, - validEmail, - validPassword, - null, - validSettings, - validInbox - )); - } - - @Test - void shouldThrowIfPasswordIsBlank() { - assertThrows(IllegalArgumentException.class, () -> - new User( - validID, - validName, - validEmail, - " ", - validRole, - validSettings, - validInbox - )); - } - - @Test - void shouldThrowIfSettingsIsNull() { - assertThrows(IllegalArgumentException.class, () -> - new User( - validID, - validName, - validEmail, - validPassword, - validRole, - null, - validInbox - )); - } - - @Test - void shouldThrowIfInboxIsNull() { - assertThrows(IllegalArgumentException.class, () -> - new User( - validID, - validName, - validEmail, - validPassword, - validRole, - validSettings, - null - )); - } - - @Test - void shouldCreateUser() { - User user = new User( - validID, - validName, - validEmail, - validPassword, - validRole, - validSettings, - validInbox - ); - - assertAll( - () -> assertEquals(validID, user.getId()), - () -> assertEquals(validName, user.getName()), - () -> assertEquals(validEmail, user.getEmail()), - () -> assertEquals(validRole, user.getRole()), - () -> assertEquals(validSettings, user.getSettings()), - () -> assertEquals(validInbox, user.getInbox()) - ); - } - - } -} \ No newline at end of file diff --git a/helpmehelpapplication/target/classes/ntnu/sytemutvikling/team6/Main.class b/helpmehelpapplication/target/classes/ntnu/sytemutvikling/team6/Main.class deleted file mode 100644 index 110f8b9..0000000 Binary files a/helpmehelpapplication/target/classes/ntnu/sytemutvikling/team6/Main.class and /dev/null differ diff --git a/helpmehelpapplication/target/classes/ntnu/sytemutvikling/team6/models/Charity.class b/helpmehelpapplication/target/classes/ntnu/sytemutvikling/team6/models/Charity.class deleted file mode 100644 index ef0710b..0000000 Binary files a/helpmehelpapplication/target/classes/ntnu/sytemutvikling/team6/models/Charity.class and /dev/null differ diff --git a/helpmehelpapplication/target/classes/ntnu/sytemutvikling/team6/models/CharityRegistry.class b/helpmehelpapplication/target/classes/ntnu/sytemutvikling/team6/models/CharityRegistry.class deleted file mode 100644 index c923756..0000000 Binary files a/helpmehelpapplication/target/classes/ntnu/sytemutvikling/team6/models/CharityRegistry.class and /dev/null differ diff --git a/helpmehelpapplication/target/classes/ntnu/sytemutvikling/team6/models/Donation.class b/helpmehelpapplication/target/classes/ntnu/sytemutvikling/team6/models/Donation.class deleted file mode 100644 index eeddec5..0000000 Binary files a/helpmehelpapplication/target/classes/ntnu/sytemutvikling/team6/models/Donation.class and /dev/null differ diff --git a/helpmehelpapplication/target/classes/ntnu/sytemutvikling/team6/models/DonationRegistry.class b/helpmehelpapplication/target/classes/ntnu/sytemutvikling/team6/models/DonationRegistry.class deleted file mode 100644 index 4f9d393..0000000 Binary files a/helpmehelpapplication/target/classes/ntnu/sytemutvikling/team6/models/DonationRegistry.class and /dev/null differ diff --git a/helpmehelpapplication/target/classes/ntnu/sytemutvikling/team6/models/Feedback.class b/helpmehelpapplication/target/classes/ntnu/sytemutvikling/team6/models/Feedback.class deleted file mode 100644 index e4b6592..0000000 Binary files a/helpmehelpapplication/target/classes/ntnu/sytemutvikling/team6/models/Feedback.class and /dev/null differ diff --git a/helpmehelpapplication/target/classes/ntnu/sytemutvikling/team6/models/UserRegistry.class b/helpmehelpapplication/target/classes/ntnu/sytemutvikling/team6/models/UserRegistry.class deleted file mode 100644 index ce901b4..0000000 Binary files a/helpmehelpapplication/target/classes/ntnu/sytemutvikling/team6/models/UserRegistry.class and /dev/null differ diff --git a/helpmehelpapplication/target/classes/ntnu/sytemutvikling/team6/models/user/Inbox.class b/helpmehelpapplication/target/classes/ntnu/sytemutvikling/team6/models/user/Inbox.class deleted file mode 100644 index 4e08a72..0000000 Binary files a/helpmehelpapplication/target/classes/ntnu/sytemutvikling/team6/models/user/Inbox.class and /dev/null differ diff --git a/helpmehelpapplication/target/classes/ntnu/sytemutvikling/team6/models/user/Language.class b/helpmehelpapplication/target/classes/ntnu/sytemutvikling/team6/models/user/Language.class deleted file mode 100644 index 5520821..0000000 Binary files a/helpmehelpapplication/target/classes/ntnu/sytemutvikling/team6/models/user/Language.class and /dev/null differ diff --git a/helpmehelpapplication/target/classes/ntnu/sytemutvikling/team6/models/user/Message.class b/helpmehelpapplication/target/classes/ntnu/sytemutvikling/team6/models/user/Message.class deleted file mode 100644 index e556e51..0000000 Binary files a/helpmehelpapplication/target/classes/ntnu/sytemutvikling/team6/models/user/Message.class and /dev/null differ diff --git a/helpmehelpapplication/target/classes/ntnu/sytemutvikling/team6/models/user/Role.class b/helpmehelpapplication/target/classes/ntnu/sytemutvikling/team6/models/user/Role.class deleted file mode 100644 index 8d6c32e..0000000 Binary files a/helpmehelpapplication/target/classes/ntnu/sytemutvikling/team6/models/user/Role.class and /dev/null differ diff --git a/helpmehelpapplication/target/classes/ntnu/sytemutvikling/team6/models/user/Settings.class b/helpmehelpapplication/target/classes/ntnu/sytemutvikling/team6/models/user/Settings.class deleted file mode 100644 index 26851ad..0000000 Binary files a/helpmehelpapplication/target/classes/ntnu/sytemutvikling/team6/models/user/Settings.class and /dev/null differ diff --git a/helpmehelpapplication/target/classes/ntnu/sytemutvikling/team6/models/user/User.class b/helpmehelpapplication/target/classes/ntnu/sytemutvikling/team6/models/user/User.class deleted file mode 100644 index e981ecb..0000000 Binary files a/helpmehelpapplication/target/classes/ntnu/sytemutvikling/team6/models/user/User.class and /dev/null differ diff --git a/helpmehelpapplication/target/classes/ntnu/sytemutvikling/team6/security/PasswordHasher.class b/helpmehelpapplication/target/classes/ntnu/sytemutvikling/team6/security/PasswordHasher.class deleted file mode 100644 index e454773..0000000 Binary files a/helpmehelpapplication/target/classes/ntnu/sytemutvikling/team6/security/PasswordHasher.class and /dev/null differ diff --git a/helpmehelpapplication/target/classes/ntnu/sytemutvikling/team6/service/CharityService.class b/helpmehelpapplication/target/classes/ntnu/sytemutvikling/team6/service/CharityService.class deleted file mode 100644 index c52d762..0000000 Binary files a/helpmehelpapplication/target/classes/ntnu/sytemutvikling/team6/service/CharityService.class and /dev/null differ diff --git a/helpmehelpapplication/target/classes/ntnu/sytemutvikling/team6/service/DonationService.class b/helpmehelpapplication/target/classes/ntnu/sytemutvikling/team6/service/DonationService.class deleted file mode 100644 index 86d2996..0000000 Binary files a/helpmehelpapplication/target/classes/ntnu/sytemutvikling/team6/service/DonationService.class and /dev/null differ diff --git a/helpmehelpapplication/target/classes/ntnu/sytemutvikling/team6/service/FeedbackService.class b/helpmehelpapplication/target/classes/ntnu/sytemutvikling/team6/service/FeedbackService.class deleted file mode 100644 index 4b0e587..0000000 Binary files a/helpmehelpapplication/target/classes/ntnu/sytemutvikling/team6/service/FeedbackService.class and /dev/null differ diff --git a/helpmehelpapplication/target/classes/tempClassDiagram.puml b/helpmehelpapplication/target/classes/tempClassDiagram.puml deleted file mode 100644 index c32ad2a..0000000 --- a/helpmehelpapplication/target/classes/tempClassDiagram.puml +++ /dev/null @@ -1,307 +0,0 @@ -@startuml - - - -' ========================= - -' DOMAIN LAYER - -' ========================= - - - -package "Domain Layer" { - - - -class User { - - - idNext : static int - - - id : int - - - name : String - - - email : String - - - passwordHash : String - - - role : String - - - settings : Settings - - - inbox : Inbox - - - - + getUserId() : int - - + setUserId(id : int) - - + getUserName() : String - - + setUserName(name : String) - - + getUserEmail() : String - - + setUserEmail(email : String) - - + getUserPasswordHash() : String - - + setUserPasswordHash(passwordHash : String) - - + getUserRole() : String - - + setUserRole(role : String) - -} - - - -class Settings { - - - lightmode : boolean - - - language : String - - - anonymous : boolean - - - - + getSettings() : String - -} - - - -class Inbox { - - - messages : ArrayList - - - - + getMessages() : ArrayList - - + addMessage(message : Message) - - + removeMessage(message : Message) - -} - - - -class Message { - - - title : String - - - from : Charity - - - date : LocalDateTime - - - - + getTitle() : String - - + getFrom() : Charity - - + getDate() : LocalDateTime - -} - - - -class Charity { - - - idNext : static int - - - id : int - - - name : String - - - description : String - - - totalDonations : double - - - verified : boolean - - - category : String - - - - + getCharityId() : int - - + setCharityId(id : int) - - + getCharityName() : String - - + setCharityName(name : String) - - + getCharityDescription() : String - - + setCharityDescription(description : String) - - + getCharityTotalDonations() : double - - + setCharityTotalDonations(totalDonations : double) - -} - - - -abstract class Donation { - - - idNext : static int - - - id : int - - - amount : double - - - date : LocalDateTime - - - charity : Charity - - - user : User - - - - + getDonationId() : int - - + setDonationId(id : int) - - + getDonationAmount() : double - - + setDonationAmount(amount : double) - - + getDonationDate() : LocalDateTime - - + setDonationDate(date : LocalDateTime) - - + getDonorInfo() : String - -} - - - -class AnonymousDonation { - - - comment : String - -} - - - -class PublicDonation { - - - comment : String - -} - - - -class Feedback { - - - id : int - - - message : String - - - date : LocalDateTime - - - charityId : int - - - - + getId() : int - - + setId(id : int) - - + getMessage() : String - - + setMessage(message : String) - - + getDate() : LocalDateTime - - + setDate(date : LocalDateTime) - -} - - - -class UserRegistry { - - - users : List - - + addUser(user : User) - - + removeUser(user : User) - - + getUserById(id : int) : User - - + getAllUsers() : List - -} - - - -class CharityRegistry { - - - charities : List - - + addCharity(charity : Charity) - - + removeCharity(charity : Charity) - - + getCharityById(id : int) : Charity - - + getAllCharities() : List - -} - - - -class DonationRegistry { - - - donations : List - - + addDonation(donation : Donation) - - + removeDonation(donation : Donation) - - + getDonationById(id : int) : Donation - - + getAllDonations() : List - -} - - - -' Associations - -User "1" -- "0..*" Donation - -Charity "1" -- "0..*" Donation - - - -User "1" -- "0..*" Feedback - -Charity "1" -- "0..*" Feedback - - - -Donation <|-- AnonymousDonation - -Donation <|-- PublicDonation - - - -User "1" *-- "1" Settings - -User "1" *-- "1" Inbox - -Inbox "1" -- "0..*" Message - -Message "1" --> "1" Charity - - - -} \ No newline at end of file diff --git a/helpmehelpapplication/target/test-classes/ntnu/sytemutvikling/team6/models/user/UserTest$constructorTests$emailTests.class b/helpmehelpapplication/target/test-classes/ntnu/sytemutvikling/team6/models/user/UserTest$constructorTests$emailTests.class deleted file mode 100644 index 51a8c3c..0000000 Binary files a/helpmehelpapplication/target/test-classes/ntnu/sytemutvikling/team6/models/user/UserTest$constructorTests$emailTests.class and /dev/null differ diff --git a/helpmehelpapplication/target/test-classes/ntnu/sytemutvikling/team6/models/user/UserTest$constructorTests.class b/helpmehelpapplication/target/test-classes/ntnu/sytemutvikling/team6/models/user/UserTest$constructorTests.class deleted file mode 100644 index e7def3c..0000000 Binary files a/helpmehelpapplication/target/test-classes/ntnu/sytemutvikling/team6/models/user/UserTest$constructorTests.class and /dev/null differ diff --git a/helpmehelpapplication/target/test-classes/ntnu/sytemutvikling/team6/models/user/UserTest.class b/helpmehelpapplication/target/test-classes/ntnu/sytemutvikling/team6/models/user/UserTest.class deleted file mode 100644 index 810d4b9..0000000 Binary files a/helpmehelpapplication/target/test-classes/ntnu/sytemutvikling/team6/models/user/UserTest.class and /dev/null differ diff --git a/helpmehelpapplication/target/test-classes/ntnu/sytemutvikling/team6/security/PasswordHasherTest$getHashPasswordTest.class b/helpmehelpapplication/target/test-classes/ntnu/sytemutvikling/team6/security/PasswordHasherTest$getHashPasswordTest.class deleted file mode 100644 index 4047693..0000000 Binary files a/helpmehelpapplication/target/test-classes/ntnu/sytemutvikling/team6/security/PasswordHasherTest$getHashPasswordTest.class and /dev/null differ diff --git a/helpmehelpapplication/target/test-classes/ntnu/sytemutvikling/team6/security/PasswordHasherTest$isValidPasswordTest.class b/helpmehelpapplication/target/test-classes/ntnu/sytemutvikling/team6/security/PasswordHasherTest$isValidPasswordTest.class deleted file mode 100644 index 7d04343..0000000 Binary files a/helpmehelpapplication/target/test-classes/ntnu/sytemutvikling/team6/security/PasswordHasherTest$isValidPasswordTest.class and /dev/null differ diff --git a/helpmehelpapplication/target/test-classes/ntnu/sytemutvikling/team6/security/PasswordHasherTest.class b/helpmehelpapplication/target/test-classes/ntnu/sytemutvikling/team6/security/PasswordHasherTest.class deleted file mode 100644 index 93e185d..0000000 Binary files a/helpmehelpapplication/target/test-classes/ntnu/sytemutvikling/team6/security/PasswordHasherTest.class and /dev/null differ