File tree Expand file tree Collapse file tree 3 files changed +7
-9
lines changed
powertools-e2e-tests/src/test/java/software/amazon/lambda/powertools Expand file tree Collapse file tree 3 files changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -85,7 +85,7 @@ void test_tracing() {
8585 // We need to filter segments based on name because they are not returned in-order from the X-Ray API
8686 // The Init segment is created by default for Lambda functions in X-Ray
8787 final SubSegment initSegment = trace .getSubsegments ().stream ()
88- .filter (subSegment -> subSegment .getName (). equals ( "Init" ))
88+ .filter (subSegment -> "Init" . equals ( subSegment .getName ()))
8989 .findFirst ().orElse (null );
9090 assertThat (initSegment .getName ()).isEqualTo ("Init" );
9191 assertThat (initSegment .getAnnotations ()).isNull ();
Original file line number Diff line number Diff line change 9898 * `PutObjectRequest`)
9999 * and the CloudFormation stack is created (with the SDK `createStack`)
100100 */
101- public class Infrastructure {
101+ public final class Infrastructure {
102102 public static final String FUNCTION_NAME_OUTPUT = "functionName" ;
103103 private static final Logger LOG = LoggerFactory .getLogger (Infrastructure .class );
104104
@@ -121,7 +121,6 @@ public class Infrastructure {
121121 private final String kinesisStream ;
122122 private final String largeMessagesBucket ;
123123 private String ddbStreamsTableName ;
124- private String functionName ;
125124 private Object cfnTemplate ;
126125 private String cfnAssetDirectory ;
127126
@@ -224,7 +223,7 @@ private Stack createStackWithLambda() {
224223 ? dockerConfig .createGraalVMBundlingOptions (pathToFunction , runtime )
225224 : dockerConfig .createJVMBundlingOptions (pathToFunction , runtime );
226225
227- functionName = stackName + "-function" ;
226+ String functionName = stackName + "-function" ;
228227 CfnOutput .Builder .create (e2eStack , FUNCTION_NAME_OUTPUT )
229228 .value (functionName )
230229 .build ();
Original file line number Diff line number Diff line change @@ -112,12 +112,11 @@ private Trace getTrace(List<String> traceIds) {
112112 trace .segments ().forEach (segment -> {
113113 try {
114114 SegmentDocument document = MAPPER .readValue (segment .document (), SegmentDocument .class );
115- if (document .getOrigin ().equals ("AWS::Lambda::Function" )) {
116- if (document .hasSubsegments ()) {
117- getNestedSubSegments (document .getSubsegments (), traceRes ,
118- Collections .emptyList ());
119- }
115+ if ("AWS::Lambda::Function" .equals (document .getOrigin ()) && document .hasSubsegments ()) {
116+ getNestedSubSegments (document .getSubsegments (), traceRes ,
117+ Collections .emptyList ());
120118 }
119+
121120 } catch (JsonProcessingException e ) {
122121 LOG .error ("Failed to parse segment document: " + e .getMessage ());
123122 throw new RuntimeException (e );
You can’t perform that action at this time.
0 commit comments