@Test
  public void testWriteToBundle_requiredNetwork() {
    Map<Integer, Integer> mapping = new HashMap<>();
    mapping.put(Constraint.ON_ANY_NETWORK, GooglePlayJobWriter.LEGACY_NETWORK_CONNECTED);
    mapping.put(Constraint.ON_UNMETERED_NETWORK, GooglePlayJobWriter.LEGACY_NETWORK_UNMETERED);
    mapping.put(0, GooglePlayJobWriter.LEGACY_NETWORK_ANY);

    for (Entry<Integer, Integer> testCase : mapping.entrySet()) {
      @SuppressWarnings("WrongConstant")
      Bundle b =
          writer.writeToBundle(
              initializeDefaultBuilder().setConstraints(testCase.getKey()).build(), new Bundle());

      assertEquals("requiredNetwork", (int) testCase.getValue(), b.getInt("requiredNetwork"));
    }
  }
Tests for the {@link GooglePlayJobWriter} class.
jobdispatcher/src/test/java/com/firebase/jobdispatcher/GooglePlayJobWriterTest.java