コード例 #1
0
ファイル: PluginTest.java プロジェクト: jbellmann/fullstop
 protected CloudTrailEvent getMockedEvent() {
   CloudTrailEvent event = Mockito.mock(CloudTrailEvent.class);
   CloudTrailEventData eventData = Mockito.mock(CloudTrailEventData.class);
   Mockito.when(event.getEventData()).thenReturn(eventData);
   Mockito.when(eventData.getEventSource()).thenReturn("ec2.amazonaws.com");
   Mockito.when(eventData.getEventName()).thenReturn("RunInstances");
   return event;
 }
コード例 #2
0
ファイル: ExamplePlugin.java プロジェクト: kubusgol/fullstop
  /** We use this as a filter for events. */
  @Override
  public boolean supports(final CloudTrailEvent event) {
    CloudTrailEventData eventData = event.getEventData();

    String eventSource = eventData.getEventSource();
    String eventName = eventData.getEventName();

    return eventSource.equals(EC2_EVENTS) && eventName.startsWith(DELETE);
  }