Question: Add JUnit tests for the methods in the Attachment and Ticket classes. Then zip up the whole project and submit it through this assignment drop

Add JUnit tests for the methods in the Attachment and Ticket classes. Then zip up the whole project and submit it through this assignment drop box. Please note this is in the language of Java. The bottom two pieces of code are the attachment and ticket classes.

Here is the AWS XML File:

Compiler XML:

Jar Repositories XML:

misc XML:

customer support ticket file:

POM.XML:

4.0.0

org.example CustomerSupportTicket 1.0-SNAPSHOT org.apache.maven.plugins maven-compiler-plugin 7 7

.gitattributes:

# Auto detect text files and perform LF normalization * text=auto

.gitignore:

# Default ignored files /shelf/ /workspace.xml # Datasource local storage ignored files /../../../../../../../:\Users\jamccune\Documents\INFO 1541 Java III\CustomerSupportTicket\.idea/dataSources/ /dataSources.local.xml # Editor-based HTTP Client requests /httpRequests/

Here is the attachment class:

public class Attachment { private String name;

private byte[] contents;

public String getName() { return name; }

public void setName(String name) { this.name = name; }

public byte[] getContents() { return contents; }

public void setContents(byte[] contents) { this.contents = contents; } }

Here is the Ticket class:

import java.util.Collection; import java.util.LinkedHashMap; import java.util.Map;

public class Ticket { private String customerName;

private String subject;

private String body;

private Map attachments = new LinkedHashMap<>();

public String getCustomerName() { return customerName; }

public void setCustomerName(String customerName) { this.customerName = customerName; }

public String getSubject() { return subject; }

public void setSubject(String subject) { this.subject = subject; }

public String getBody() { return body; }

public void setBody(String body) { this.body = body; }

public Attachment getAttachment(String name) { return this.attachments.get(name); }

public Collection getAttachments() { return this.attachments.values(); }

public void addAttachment(Attachment attachment) { this.attachments.put(attachment.getName(), attachment); }

public int getNumberOfAttachments() { return this.attachments.size(); } }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!