Skip to content

Commit

Permalink
Remove redundant explicit occurrence name
Browse files Browse the repository at this point in the history
Signed-off-by: Aditya Saky <[email protected]>
  • Loading branch information
adityasaky committed Apr 16, 2020
1 parent be98d99 commit 001ac3d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,12 @@ public class Grafeas extends Transport {
GrafeasOccurrence occurrence;

public class GrafeasOccurrence {
public String name;
public String noteName;
public Map<String, String> resource = new HashMap<String, String>();
public String kind = "INTOTO";
public Link intoto;

public GrafeasOccurrence(String name, String noteName, String resourceUri) {
this.name = name;
public GrafeasOccurrence(String noteName, String resourceUri) {
this.noteName = noteName;
this.resource.put("uri", resourceUri);
}
Expand All @@ -54,7 +52,6 @@ public Grafeas(URI uri) {
Map<String, String> parameterMap = this.getParameterMap(parameterString);

GrafeasOccurrence occurrence = new GrafeasOccurrence(
parameterMap.get("name"),
parameterMap.get("noteName"),
parameterMap.get("resourceUri")
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public void testTransportFactory() throws Exception {
assertTrue(someTransport instanceof GenericCRUD);

/* test creating Grafeas transports */
testUrl = new URI("grafeas+http://localhost:8080/v1beta1/projects/provider_example/occurrences?name=name&noteName=noteName&resourceUri=resourceUri");
testUrl = new URI("grafeas+http://localhost:8080/v1beta1/projects/provider_example/occurrences?noteName=noteName&resourceUri=resourceUri");
someTransport = Transport.TransportFactory.transportForURI(testUrl);
assertTrue(someTransport instanceof Grafeas);

Expand Down

0 comments on commit 001ac3d

Please sign in to comment.