Skip to content
This repository was archived by the owner on Nov 22, 2020. It is now read-only.

Commit 6e1c9fa

Browse files
committed
Verify mock was call with correct url and payload
Signed-off-by: wslulciuc <[email protected]>
1 parent 8d6a5ed commit 6e1c9fa

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/test/java/marquez/client/MarquezClientTest.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,7 @@ public void testCreateJob() throws Exception {
534534
public void testCreateJobWithRunId() throws Exception {
535535
final URL url = buildUrlFor("/namespaces/%s/jobs/%s", NAMESPACE_NAME, JOB_NAME);
536536

537-
final JobMeta metaWithRunId =
537+
final JobMeta meta =
538538
JobMeta.builder()
539539
.type(JOB_TYPE)
540540
.inputs(INPUTS)
@@ -544,12 +544,14 @@ public void testCreateJobWithRunId() throws Exception {
544544
.context(JOB_CONTEXT)
545545
.runId(newRunId())
546546
.build();
547-
final String metaAsJson = JsonGenerator.newJsonFor(metaWithRunId);
547+
final String metaAsJson = JsonGenerator.newJsonFor(meta);
548548
final String jobAsJson = JsonGenerator.newJsonFor(JOB);
549549
when(http.put(url, metaAsJson)).thenReturn(jobAsJson);
550550

551-
final Job job = client.createJob(NAMESPACE_NAME, JOB_NAME, metaWithRunId);
551+
final Job job = client.createJob(NAMESPACE_NAME, JOB_NAME, meta);
552552
assertThat(job).isEqualTo(JOB);
553+
554+
verify(http, times(1)).put(url, metaAsJson);
553555
}
554556

555557
@Test

0 commit comments

Comments
 (0)