test_class.file: persistence-mongodb/src/test/java/org/devgateway/ocds/persistence/mongo/spring/json2object/ReleasePackageJsonToObjectTest.java
test_class.identifier: ReleasePackageJsonToObjectTest
test_case.body: @Test
      public void toObject() throws Exception {
          final String jsonReleasePackage = "{\n"
                  + "    \"uri\": "
                  + "\"http://standard.open-contracting.org/examples/releases/ocds-213czf-000-00001-01-planning.json\",\n"
                  + "    \"publishedDate\": \"2009-03-15T14:45:00Z\",\n"
                  + "    \"publisher\": {\n"
                  + "        \"scheme\": \"GB-COH\",\n"
                  + "        \"uid\": \"09506232\",\n"
                  + "        \"name\": \"Open Data Services Co-operative Limited\",\n"
                  + "        \"uri\": \"http://standard.open-contracting.org/examples/\"\n"
                  + "    },\n"
                  + "    \"license\": \"http://opendatacommons.org/licenses/pddl/1.0/\",\n"
                  + "    \"publicationPolicy\": \"https://github.com/open-contracting/sample-data/\",\n"
                  + "    \"releases\":[{\n"
                  + "        \"id\": \"123\",\n"
                  + "        \"tag\": [\"tender\"],\n"
                  + "        \"planning\": {\n"
                  + "            \"budget\": {\n"
                  + "                \"description\": \"budget desc...\",\n"
                  + "                \"amount\": {\n"
                  + "                    \"amount\": 10000,\n"
                  + "                    \"currency\": \"USD\"\n"
                  + "                }\n"
                  + "            }\n"
                  + "        }\n"
                  + "    }]\n"
                  + "}";
  
  
          final JsonToObject releasePackageJsonToObject = new ReleasePackageJsonToObject(jsonReleasePackage);
  
          Assert.assertTrue("Object is a ReleasePackage",
                  releasePackageJsonToObject.toObject() instanceof ReleasePackage);
  
          final ReleasePackage releasePackage = (ReleasePackage) releasePackageJsonToObject.toObject();
  
          Assert.assertEquals("Publisher uid are the same", "09506232", releasePackage.getPublisher().getUid());
          Assert.assertEquals("Check published date",
                  new SimpleDateFormat("yyyy-MM-dd'T'hh:mm:sszzzz").parse("2009-03-15T14:45:00-0000"),
                  releasePackage.getPublishedDate());
  
          Assert.assertFalse("Release array is not empty", releasePackage.getReleases().isEmpty());
          final Release release = releasePackage.getReleases().iterator().next();
  
          Assert.assertEquals("Check budget amount", new BigDecimal(10000),
                  release.getPlanning().getBudget().getAmount().getAmount());
          Assert.assertEquals("Check budget currency", Amount.Currency.USD,
                  release.getPlanning().getBudget().getAmount().getCurrency());
      }
test_case.class_method_signature: ReleasePackageJsonToObjectTest.toObject()
test_case.full_signature: @Test public void toObject()
test_case.identifier: toObject
test_case.invocations: assertTrue toObject toObject assertEquals getUid getPublisher assertEquals parse getPublishedDate assertFalse isEmpty getReleases next iterator getReleases assertEquals getAmount getAmount getBudget getPlanning assertEquals getCurrency getAmount getBudget getPlanning
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void toObject()
focal_class.declarator: releasePackage
focal_class.modifier: private
focal_class.original_string: private ReleasePackage releasePackage;
focal_class.type: ReleasePackage
focal_class.var_name: releasePackage
focal_class.file: persistence-mongodb/src/main/java/org/devgateway/ocds/persistence/mongo/spring/json2object/ReleasePackageJsonToObject.java
focal_class.identifier: ReleasePackageJsonToObject
focal_class.class_method_signature: ReleasePackageJsonToObject.ReleasePackageJsonToObject(final String jsonObject)
focal_class.full_signature: public  ReleasePackageJsonToObject(final String jsonObject)
focal_class.identifier: ReleasePackageJsonToObject
focal_class.modifiers: public
focal_class.parameters: (final String jsonObject)
focal_class.signature:  ReleasePackageJsonToObject(final String jsonObject)
focal_class.class_method_signature: ReleasePackageJsonToObject.ReleasePackageJsonToObject(final InputStream inputStream)
focal_class.full_signature: public  ReleasePackageJsonToObject(final InputStream inputStream)
focal_class.identifier: ReleasePackageJsonToObject
focal_class.modifiers: public
focal_class.parameters: (final InputStream inputStream)
focal_class.signature:  ReleasePackageJsonToObject(final InputStream inputStream)
focal_class.class_method_signature: ReleasePackageJsonToObject.ReleasePackageJsonToObject(final File file)
focal_class.full_signature: public  ReleasePackageJsonToObject(final File file)
focal_class.identifier: ReleasePackageJsonToObject
focal_class.modifiers: public
focal_class.parameters: (final File file)
focal_class.signature:  ReleasePackageJsonToObject(final File file)
focal_class.class_method_signature: ReleasePackageJsonToObject.toObject()
focal_class.full_signature: @Override public ReleasePackage toObject()
focal_class.identifier: toObject
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: ReleasePackage
focal_class.signature: ReleasePackage toObject()
focal_class.superclass: extends AbstractJsonToObject<ReleasePackage>
focal_method.body: @Override
      public ReleasePackage toObject() throws IOException {
          if (releasePackage == null) {
              // Transform JSON String to a Release Object
              releasePackage = this.mapper.readValue(this.jsonObject, ReleasePackage.class);
          }
  
          return releasePackage;
      }
focal_method.class_method_signature: ReleasePackageJsonToObject.toObject()
focal_method.full_signature: @Override public ReleasePackage toObject()
focal_method.identifier: toObject
focal_method.invocations: readValue
focal_method.modifiers: @Override public
focal_method.parameters: ()
focal_method.return: ReleasePackage
focal_method.signature: ReleasePackage toObject()