File tree Expand file tree Collapse file tree
bugsnag/src/test/java/com/bugsnag Expand file tree Collapse file tree Original file line number Diff line number Diff line change 88import org .springframework .context .annotation .Import ;
99import org .springframework .core .SpringVersion ;
1010
11- import javax .annotation .PostConstruct ;
1211import java .util .Map ;
12+ import javax .annotation .PostConstruct ;
1313
1414/**
1515 * Configuration to integrate Bugsnag with Spring.
Original file line number Diff line number Diff line change 1010import org .springframework .context .annotation .Conditional ;
1111import org .springframework .context .annotation .Configuration ;
1212
13- import javax .servlet .ServletRequestListener ;
1413import java .util .Map ;
14+ import javax .servlet .ServletRequestListener ;
1515
1616/**
1717 * If spring-boot is loaded, add configuration specific to Spring Boot
Original file line number Diff line number Diff line change @@ -157,16 +157,18 @@ public void requestMetadataSetCorrectly() {
157157 }
158158
159159 @ Test
160+ @ SuppressWarnings ("unchecked" )
160161 public void springVersionSetCorrectly () {
161162 callRuntimeExceptionEndpoint ();
162163
163164 Report report = verifyAndGetReport (delivery );
164165
165166 // Check that the Spring version is set as expected
166- @ SuppressWarnings (value = "unchecked" ) Map <String , Object > deviceMetadata =
167- (Map <String , Object >) report .getMetaData ().get ("device" );
168- assertEquals (SpringVersion .getVersion (), deviceMetadata .get ("springVersion" ));
169- assertEquals (SpringBootVersion .getVersion (), deviceMetadata .get ("springBootVersion" ));
167+ Map <String , Object > deviceMetadata = report .getDevice ();
168+ Map <String , Object > runtimeVersions =
169+ (Map <String , Object >) deviceMetadata .get ("runtimeVersions" );
170+ assertEquals (SpringVersion .getVersion (), runtimeVersions .get ("springFramework" ));
171+ assertEquals (SpringBootVersion .getVersion (), runtimeVersions .get ("springBoot" ));
170172 }
171173
172174 @ Test
Original file line number Diff line number Diff line change @@ -63,7 +63,7 @@ public void testJsonSerialisation() {
6363
6464 JsonNode device = rootNode .get ("device" );
6565 assertNotNull (device );
66- assertEquals (3 , device .size ());
66+ assertEquals (4 , device .size ());
6767 }
6868
6969}
You can’t perform that action at this time.
0 commit comments