Skip to content

Commit

Permalink
Add ProvenanceAction test failing build with null inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
MrCreosote committed Apr 6, 2022
1 parent c0cd07a commit 84aa624
Showing 1 changed file with 24 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1048,8 +1048,31 @@ public void withCustomFail() throws Exception {

@Test
public void buildFail() throws Exception {
failBuild(ProvenanceAction.getBuilder());
failBuild(ProvenanceAction.getBuilder()
.withCaller(null)
.withCommandLine(null)
.withCustom(null)
.withDescription(null)
.withExternalData(null)
.withIncomingArgs(null)
.withMethod(null)
.withMethodParameters(null)
.withOutgoingArgs(null)
.withResolvedObjects(null)
.withScript(null)
.withScriptVersion(null)
.withServiceName(null)
.withServiceVersion(null)
.withSubActions(null)
.withTime(null)
.withWorkspaceObjects(null)
);
}

public void failBuild(final ProvenanceAction.Builder b) {
try {
ProvenanceAction.getBuilder().build();
b.build();
fail("expected exception");
} catch (Exception got) {
TestCommon.assertExceptionCorrect(got, new IllegalArgumentException(
Expand Down

0 comments on commit 84aa624

Please sign in to comment.