File tree Expand file tree Collapse file tree 2 files changed +3
-0
lines changed
main/java/org/opendcs/odcsapi/res
test/java/org/opendcs/odcsapi/res Expand file tree Collapse file tree 2 files changed +3
-0
lines changed Original file line number Diff line number Diff line change @@ -367,6 +367,7 @@ static Platform map(ApiPlatform platform) throws DatabaseException
367367 ret .setPlatformDesignator (platform .getDesignator ());
368368 ret .lastModifyTime = new Date ();
369369 ret .platformSensors = platMap (platform .getPlatformSensors ());
370+ ret .platformSensors .forEach (p -> p .platform = ret );
370371 if (platform .getConfigId () != null )
371372 {
372373 PlatformConfig config = new PlatformConfig ();
Original file line number Diff line number Diff line change 3939import static org .junit .jupiter .api .Assertions .assertFalse ;
4040import static org .junit .jupiter .api .Assertions .assertNotNull ;
4141import static org .junit .jupiter .api .Assertions .assertNull ;
42+ import static org .junit .jupiter .api .Assertions .assertSame ;
4243import static org .mockito .ArgumentMatchers .any ;
4344import static org .mockito .Mockito .doAnswer ;
4445import static org .mockito .Mockito .when ;
@@ -362,6 +363,7 @@ void testApiPlatformMap() throws Exception
362363 assertMatch (plat .getPlatformSensors (), result .getPlatformSensors ());
363364 assertMatchMedium (plat .getTransportMedia (), result .getTransportMedia ());
364365 assertEquals (plat .getProperties (), result .getProperties ());
366+ result .platformSensors .forEach (s -> assertSame (result , s .platform ));
365367 }
366368
367369 private static void assertMatch (List <ApiPlatformSensor > apiPlatformSensors , Iterator <PlatformSensor > platformSensors )
You can’t perform that action at this time.
0 commit comments