Skip to content

Commit 11b3049

Browse files
authored
Merge pull request #1687 from AzureAD/rapong/updateWPJAPItests
Update Broker flight API automation test
2 parents f8ad2cf + baca624 commit 11b3049

File tree

2 files changed

+24
-4
lines changed
  • msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/brokerapi

2 files changed

+24
-4
lines changed

common

Submodule common updated 31 files

msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/brokerapi/TestCase1561087.java

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,32 @@ public class TestCase1561087 extends AbstractMsalBrokerTest {
4141
public void test_1561087() {
4242
// Set flights and get to check if the flight information is returned
4343
final String flightsJson = "{\"SetFlightsTest\":\"true\"}";
44-
mBroker.setFlights(flightsJson);
44+
mBroker.overwriteFlights(flightsJson);
4545
Assert.assertEquals(flightsJson, mBroker.getFlights());
4646

47+
// Add flights and get to check if the flight information is returned
48+
final String anotherFlightJson = "{\"AnotherFlight\":\"hello\"}";
49+
mBroker.setFlights(anotherFlightJson);
50+
Assert.assertEquals( "{\"AnotherFlight\":\"hello\",\"SetFlightsTest\":\"true\"}", mBroker.getFlights());
51+
52+
// Override flights and get to check if the flight information is returned
53+
final String flightToOverwrite = "{\"SetFlightsTest\":\"false\"}";
54+
mBroker.setFlights(flightToOverwrite);
55+
Assert.assertEquals("{\"AnotherFlight\":\"hello\",\"SetFlightsTest\":\"false\"}", mBroker.getFlights());
56+
57+
// Add flight with null value. SetFlightsTest should be removed.
58+
final String flightMapWithNullValue = "{\"SetFlightsTest\": null}";
59+
mBroker.setFlights(flightMapWithNullValue);
60+
Assert.assertEquals("{\"AnotherFlight\":\"hello\"}", mBroker.getFlights());
61+
62+
// Add an empty flight map. the flight map should not change.
63+
final String emptyFlightMap = "{}";
64+
mBroker.setFlights(emptyFlightMap);
65+
Assert.assertEquals("{\"AnotherFlight\":\"hello\"}", mBroker.getFlights());
66+
4767
// clear flights and get to check if the flights are cleared
48-
final String clearFlightsJson = "{}";
49-
mBroker.setFlights(clearFlightsJson);
68+
final String clearFlightsJson = "{}";
69+
mBroker.overwriteFlights(clearFlightsJson);
5070
Assert.assertEquals(clearFlightsJson, mBroker.getFlights());
5171
}
5272

0 commit comments

Comments
 (0)