Skip to content

Commit

Permalink
Fix failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
onobc committed Aug 2, 2023
1 parent 9f839ba commit a7e87d3
Showing 1 changed file with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1052,7 +1052,7 @@ public void testDuplicateDeployWhenStreamIsBeingDeployed() throws Exception {

@Test
public void testUndeployNonDeployedStream() throws Exception {
when(skipperClient.search(eq("myStream"), eq(false))).thenReturn(Arrays.asList(new PackageMetadata()));
when(skipperClient.search(eq("myStream"), eq(false))).thenReturn(Arrays.asList(newPackageMetadata("myStream")));

repository.save(new StreamDefinition("myStream", "time | log"));
mockMvc.perform(delete("/streams/deployments/myStream")
Expand All @@ -1071,8 +1071,8 @@ public void testUndeployNonDeployedStream() throws Exception {

@Test
public void testUndeployAllNonDeployedStream() throws Exception {
when(skipperClient.search(eq("myStream1"), eq(false))).thenReturn(Arrays.asList(new PackageMetadata()));
when(skipperClient.search(eq("myStream2"), eq(false))).thenReturn(Arrays.asList(new PackageMetadata()));
when(skipperClient.search(eq("myStream1"), eq(false))).thenReturn(Arrays.asList(newPackageMetadata("myStream1")));
when(skipperClient.search(eq("myStream2"), eq(false))).thenReturn(Arrays.asList(newPackageMetadata("myStream2")));

repository.save(new StreamDefinition("myStream1", "time | log"));
repository.save(new StreamDefinition("myStream2", "time | log"));
Expand All @@ -1092,6 +1092,13 @@ public void testUndeployAllNonDeployedStream() throws Exception {
assertThat(auditRecords.get(5).getAuditAction()).isEqualTo(AuditActionType.UNDEPLOY);
}

private PackageMetadata newPackageMetadata(String streamName) {
PackageMetadata packageMetadata = new PackageMetadata();
packageMetadata.setName(streamName);
return packageMetadata;
}


@Test
public void testDeployWithProperties() throws Exception {
repository.save(new StreamDefinition("myStream", "time | log"));
Expand Down

0 comments on commit a7e87d3

Please sign in to comment.