Skip to content

Commit

Permalink
Minor cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
MrCreosote committed Apr 5, 2022
1 parent c17bbe3 commit c0cd07a
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2829,7 +2829,7 @@ private List<ExternalData> toExternalData(final List<Document> extdata) {
.collect(Collectors.toList());
}

public Instant getInstant(Document doc, final String field) {
private Instant getInstant(Document doc, final String field) {
return Optional.ofNullable(doc.getDate(field)).map(d -> d.toInstant()).orElse(null);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@
*/
public class ProvenanceAction {

// TODO NOW JAVADOC

/* TODO PROVENANCE:LATER consider grouping fields together and field requirements. For example:
* service, serviceVersion, method, and methodParameters should all be required to describe
* a service call. (serviceEndpointURL might be a useful addition)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ public void buildMaximal() throws Exception {
.withServiceName("\tLOL Wombat\n")
.withServiceVersion("\n90\n")
.withSubActions(list(SubAction.getBuilder().withName("subby sub sub").build()))
.withTime(Instant.ofEpochMilli(20000))
.withTime(inst(20000))
.build();

new ProvExpected()
Expand All @@ -341,7 +341,7 @@ public void buildMaximal() throws Exception {
.withService(opt("LOL Wombat"))
.withServiceVersion(opt("90"))
.withSubActions(list(SubAction.getBuilder().withName("subby sub sub").build()))
.withTime(opt(Instant.ofEpochMilli(20000)))
.withTime(opt(inst(20000)))
.withWsobjs(list("foo/bar/1; 7/8/9", "8/9"))
.assertCorrect(pa);
}
Expand Down Expand Up @@ -369,7 +369,7 @@ public void buildOverwriteWithNulls() throws Exception {
.withServiceName("\tLOL Wombat\n")
.withServiceVersion("\n90\n")
.withSubActions(list(SubAction.getBuilder().withName("subby sub sub").build()))
.withTime(Instant.ofEpochMilli(20000))
.withTime(inst(20000))
.withCommandLine(null)
.withCustom(null)
.withDescription(null)
Expand Down Expand Up @@ -420,7 +420,7 @@ public void buildOverwriteWithEmpties() throws Exception {
.withServiceName("\tLOL Wombat\n")
.withServiceVersion("\n90\n")
.withSubActions(list(SubAction.getBuilder().withName("subby sub sub").build()))
.withTime(Instant.ofEpochMilli(20000))
.withTime(inst(20000))
.withCommandLine(" \t ")
.withCustom(Collections.emptyMap())
.withDescription(" \t ")
Expand Down
9 changes: 5 additions & 4 deletions src/us/kbase/workspace/test/workspace/WorkspaceTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -7163,15 +7163,16 @@ public void getReferencingObjects() throws Exception {
new WorkspaceSaveObject(new ObjectIDNoWSNoVer("deletedprovrefptr"),
mtdata, SAFE_TYPE1, null,
new Provenance(user1).addAction(ProvenanceAction.getBuilder()
.withWorkspaceObjects(list("refstarget1/deletedprovref")).build()),
.withWorkspaceObjects(list("refstarget1/deletedprovref")).build()),
false)), getIdFactory());
ws.setObjectsDeleted(
user1, list(src1.withName("deletedprovrefptr").build()), true);
ws.saveObjects(user2, wsisrc2noaccess, list(
new WorkspaceSaveObject(new ObjectIDNoWSNoVer("unreadableprovrefptr"),
mtdata, SAFE_TYPE1, null,
new Provenance(user1).addAction(ProvenanceAction.getBuilder()
.withWorkspaceObjects(list("refstarget1/unreadableprovref")).build()),
.withWorkspaceObjects(list("refstarget1/unreadableprovref"))
.build()),
false)), getIdFactory());

List<Set<ObjectInformation>> mtrefs = new ArrayList<Set<ObjectInformation>>();
Expand Down Expand Up @@ -7203,7 +7204,7 @@ user1, list(tar1.withName(name).build())),
new WorkspaceSaveObject(new ObjectIDNoWSNoVer("stdref"), refdata,
reftype, meta1,
new Provenance(user1).addAction(ProvenanceAction.getBuilder()
.withWorkspaceObjects(list("refstarget1/stk/1")).build()), false)),
.withWorkspaceObjects(list("refstarget1/stk/1")).build()), false)),
getIdFactory()).get(0);
refdata.put("refs", list("refstarget1/stk/2"));
ObjectInformation stdref2 = ws.saveObjects(user1, wsisrc1, list(
Expand All @@ -7221,7 +7222,7 @@ reftype, meta1, new Provenance(user1), true)),
new WorkspaceSaveObject(new ObjectIDNoWSNoVer("delref"), refdata,
reftype, meta1,
new Provenance(user1).addAction(ProvenanceAction.getBuilder()
.withWorkspaceObjects(list("refstarget1/stk/2")).build()), true)),
.withWorkspaceObjects(list("refstarget1/stk/2")).build()), true)),
getIdFactory()).get(0);
ws.setObjectsDeleted(user1, list(src1.withName("delref").build()), true);

Expand Down

0 comments on commit c0cd07a

Please sign in to comment.