Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding PreUpdateRouting to BaseAspectRoutingResource #413

Merged
merged 13 commits into from
Sep 5, 2024
Prev Previous commit
Updated unit tests
  • Loading branch information
Rakhi Agrawal committed Sep 5, 2024
commit 2e98c3e0334bb25918fa9e2a77881b7034c78327
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,7 @@ public void testPreUpdateRoutingWithRegisteredAspect() {
_resource.setRestliPreUpdateAspectRegistry(new SamplePreUpdateAspectRegistryImpl());
runAndWait(_resource.ingest(snapshot));
verify(_mockAspectFooGmsClient, times(1)).ingest(eq(urn), eq(bar));
verify(_mockLocalDAO, times(0)).add(eq(urn), eq(bar), any(), eq(null), eq(null));
verify(_mockLocalDAO, times(0)).add(any(), any(), any(), any(), any());
verifyNoMoreInteractions(_mockLocalDAO);
}

Expand All @@ -572,7 +572,7 @@ public void testPreUpdateRoutingWithNonRegisteredPreUpdateAspect() {
EntitySnapshot snapshot = ModelUtils.newSnapshot(EntitySnapshot.class, urn, aspects);
_resource.setRestliPreUpdateAspectRegistry(new SamplePreUpdateAspectRegistryImpl());
runAndWait(_resource.ingest(snapshot));
verify(_mockAspectBarGmsClient, times(0)).ingest(eq(urn), eq(bar));
verify(_mockAspectBarGmsClient, times(0)).ingest(any(), any());
verify(_mockLocalDAO, times(1)).add(eq(urn), eq(bar), any(), eq(null), eq(null));
verifyNoMoreInteractions(_mockLocalDAO);
}
Expand All @@ -596,8 +596,8 @@ public void testPreUpdateRoutingWithSkipIngestion() throws NoSuchFieldException,
EntitySnapshot snapshot = ModelUtils.newSnapshot(EntitySnapshot.class, urn, aspects);
_resource.setRestliPreUpdateAspectRegistry(new SamplePreUpdateAspectRegistryImpl());
runAndWait(_resource.ingest(snapshot));
verify(_mockAspectFooGmsClient, times(0)).ingest(eq(urn), eq(foo));
verify(_mockLocalDAO, times(0)).add(eq(urn), eq(foo), any(), eq(null), eq(null));
verify(_mockAspectFooGmsClient, times(0)).ingest(any(), any());
verify(_mockLocalDAO, times(0)).add(any(), any(), any(), any(), any());
}

}
Loading