    @Test
    public void test_blueprintDetailsForTypeName() throws Exception {
        URL url = new URL(baseUrl + "/blueprintDetailsForTypeName/Anshar+Blueprint");
        HttpURLConnection connection = (HttpURLConnection) url.openConnection();
        connection.setRequestMethod("GET");
        connection.setRequestProperty("Accept", "application/json");
        assertThat(connection.getResponseCode(), equalTo(200));
        assertThat(getResponse(connection), equalTo("{\"invBlueprintTypeDto\":{\"blueprintTypeID\":28849,\"blueprintTypeName\":\"Anshar Blueprint\",\"productTypeID\":28848,\"productTypeName\":\"Anshar\",\"productCategoryID\":6,\"parentBlueprintTypeID\":20188,\"parentBlueprintTypeName\":\"Obelisk Blueprint\",\"parentProductTypeID\":20187,\"parentProductTypeName\":\"Obelisk\",\"techLevel\":2,\"productionTime\":1920000,\"researchProductivityTime\":11520000,\"researchMaterialTime\":7680000,\"researchCopyTime\":2560000,\"researchTechTime\":3840000,\"productivityModifier\":384000,\"wasteFactor\":10,\"maxProductionLimit\":10,\"productVolume\":\"17550000\",\"productPortionSize\":1,\"dumpVersion\":\"cru16\"},\"materialDtos\":[{\"materialTypeID\":3828,\"materialTypeName\":\"Construction Blocks\",\"materialTypeCategoryID\":43,\"materialTypeIcon\":\"06_05\",\"materialVolume\":\"1.5\",\"quantity\":1500},{\"materialTypeID\":11399,\"materialTypeName\":\"Morphite\",\"materialTypeCategoryID\":4,\"materialTypeIcon\":\"35_02\",\"materialVolume\":\"0.01\",\"quantity\":2500},{\"materialTypeID\":21025,\"materialTypeName\":\"Capital Jump Drive\",\"materialTypeCategoryID\":17,\"materialTypeIcon\":\"54_08\",\"materialVolume\":\"10000.0\",\"quantity\":20},{\"materialTypeID\":29041,\"materialTypeName\":\"Capital Crystalline Carbonide Armor Plate\",\"materialTypeCategoryID\":17,\"materialTypeIcon\":\"37_14\",\"materialVolume\":\"10.0\",\"quantity\":1013},{\"materialTypeID\":29051,\"materialTypeName\":\"Capital Fusion Reactor Unit\",\"materialTypeCategoryID\":17,\"materialTypeIcon\":\"39_02\",\"materialVolume\":\"10.0\",\"quantity\":518},{\"materialTypeID\":29061,\"materialTypeName\":\"Capital Ion Thruster\",\"materialTypeCategoryID\":17,\"materialTypeIcon\":\"37_02\",\"materialVolume\":\"10.0\",\"quantity\":422},{\"materialTypeID\":29069,\"materialTypeName\":\"Capital Magnetometric Sensor Cluster\",\"materialTypeCategoryID\":17,\"materialTypeIcon\":\"37_06\",\"materialVolume\":\"10.0\",\"quantity\":443},{\"materialTypeID\":29081,\"materialTypeName\":\"Capital Oscillator Capacitor Unit\",\"materialTypeCategoryID\":17,\"materialTypeIcon\":\"39_06\",\"materialVolume\":\"10.0\",\"quantity\":704},{\"materialTypeID\":29085,\"materialTypeName\":\"Capital Photon Microprocessor\",\"materialTypeCategoryID\":17,\"materialTypeIcon\":\"37_10\",\"materialVolume\":\"10.0\",\"quantity\":704},{\"materialTypeID\":29091,\"materialTypeName\":\"Capital Pulse Shield Emitter\",\"materialTypeCategoryID\":17,\"materialTypeIcon\":\"39_10\",\"materialVolume\":\"10.0\",\"quantity\":449}],\"manufacturingRequirementDtos\":[{\"activityID\":1,\"activityName\":\"Manufacturing\",\"requiredTypeID\":3380,\"requiredTypeName\":\"Industry\",\"requiredTypeCategoryID\":16,\"requiredTypeGroupID\":268,\"requiredTypeGroupName\":\"Industry\",\"requiredTypeIcon\":\"50_11\",\"damagePerJob\":\"0.0\",\"quantity\":5,\"requiredTypeVolume\":\"0.01\"},{\"activityID\":1,\"activityName\":\"Manufacturing\",\"requiredTypeID\":11450,\"requiredTypeName\":\"Gallentean Starship Engineering\",\"requiredTypeCategoryID\":16,\"requiredTypeGroupID\":270,\"requiredTypeGroupName\":\"Science\",\"requiredTypeIcon\":\"50_11\",\"damagePerJob\":\"0.0\",\"quantity\":4,\"requiredTypeVolume\":\"0.01\"},{\"activityID\":1,\"activityName\":\"Manufacturing\",\"requiredTypeID\":11452,\"requiredTypeName\":\"Mechanical Engineering\",\"requiredTypeCategoryID\":16,\"requiredTypeGroupID\":270,\"requiredTypeGroupName\":\"Science\",\"requiredTypeIcon\":\"50_11\",\"damagePerJob\":\"0.0\",\"quantity\":4,\"requiredTypeVolume\":\"0.01\"},{\"activityID\":1,\"activityName\":\"Manufacturing\",\"requiredTypeID\":11478,\"requiredTypeName\":\"R.A.M.- Starship Tech\",\"requiredTypeCategoryID\":17,\"requiredTypeGroupID\":332,\"requiredTypeGroupName\":\"Tool\",\"requiredTypeIcon\":\"41_02\",\"damagePerJob\":\"0.95\",\"quantity\":40,\"requiredTypeVolume\":\"4.0\"},{\"activityID\":1,\"activityName\":\"Manufacturing\",\"requiredTypeID\":20187,\"requiredTypeName\":\"Obelisk\",\"requiredTypeCategoryID\":6,\"requiredTypeGroupID\":513,\"requiredTypeGroupName\":\"Freighter\",\"damagePerJob\":\"1.0\",\"quantity\":1,\"requiredTypeVolume\":\"17550000\"},{\"activityID\":1,\"activityName\":\"Manufacturing\",\"requiredTypeID\":22242,\"requiredTypeName\":\"Capital Ship Construction\",\"requiredTypeCategoryID\":16,\"requiredTypeGroupID\":269,\"requiredTypeGroupName\":\"Mechanic\",\"requiredTypeIcon\":\"50_11\",\"damagePerJob\":\"0.0\",\"quantity\":4,\"requiredTypeVolume\":\"0.01\"}],\"timeProductivityRequirementDtos\":[{\"activityID\":3,\"activityName\":\"Researching Time Productivity\",\"requiredTypeID\":3403,\"requiredTypeName\":\"Research\",\"requiredTypeCategoryID\":16,\"requiredTypeGroupID\":270,\"requiredTypeGroupName\":\"Science\",\"requiredTypeIcon\":\"50_11\",\"damagePerJob\":\"0.0\",\"quantity\":5,\"requiredTypeVolume\":\"0.01\"},{\"activityID\":3,\"activityName\":\"Researching Time Productivity\",\"requiredTypeID\":3814,\"requiredTypeName\":\"Reports\",\"requiredTypeCategoryID\":17,\"requiredTypeGroupID\":280,\"requiredTypeGroupName\":\"General\",\"requiredTypeIcon\":\"10_16\",\"damagePerJob\":\"1.0\",\"quantity\":120,\"requiredTypeVolume\":\"0.1\"},{\"activityID\":3,\"activityName\":\"Researching Time Productivity\",\"requiredTypeID\":9836,\"requiredTypeName\":\"Consumer Electronics\",\"requiredTypeCategoryID\":43,\"requiredTypeGroupID\":1034,\"requiredTypeGroupName\":\"Refined Commodities\",\"requiredTypeIcon\":\"24_08\",\"damagePerJob\":\"1.0\",\"quantity\":100,\"requiredTypeVolume\":\"1.5\"},{\"activityID\":3,\"activityName\":\"Researching Time Productivity\",\"requiredTypeID\":11450,\"requiredTypeName\":\"Gallentean Starship Engineering\",\"requiredTypeCategoryID\":16,\"requiredTypeGroupID\":270,\"requiredTypeGroupName\":\"Science\",\"requiredTypeIcon\":\"50_11\",\"damagePerJob\":\"0.0\",\"quantity\":5,\"requiredTypeVolume\":\"0.01\"},{\"activityID\":3,\"activityName\":\"Researching Time Productivity\",\"requiredTypeID\":11452,\"requiredTypeName\":\"Mechanical Engineering\",\"requiredTypeCategoryID\":16,\"requiredTypeGroupID\":270,\"requiredTypeGroupName\":\"Science\",\"requiredTypeIcon\":\"50_11\",\"damagePerJob\":\"0.0\",\"quantity\":5,\"requiredTypeVolume\":\"0.01\"},{\"activityID\":3,\"activityName\":\"Researching Time Productivity\",\"requiredTypeID\":11466,\"requiredTypeName\":\"R.Db - CreoDron\",\"requiredTypeCategoryID\":17,\"requiredTypeGroupID\":332,\"requiredTypeGroupName\":\"Tool\",\"requiredTypeIcon\":\"41_01\",\"damagePerJob\":\"0.8\",\"quantity\":30,\"requiredTypeVolume\":\"4.0\"}],\"materialProductivityRequirementDtos\":[{\"activityID\":4,\"activityName\":\"Researching Material Productivity\",\"requiredTypeID\":3409,\"requiredTypeName\":\"Metallurgy\",\"requiredTypeCategoryID\":16,\"requiredTypeGroupID\":270,\"requiredTypeGroupName\":\"Science\",\"requiredTypeIcon\":\"50_11\",\"damagePerJob\":\"0.0\",\"quantity\":5,\"requiredTypeVolume\":\"0.01\"},{\"activityID\":4,\"activityName\":\"Researching Material Productivity\",\"requiredTypeID\":3814,\"requiredTypeName\":\"Reports\",\"requiredTypeCategoryID\":17,\"requiredTypeGroupID\":280,\"requiredTypeGroupName\":\"General\",\"requiredTypeIcon\":\"10_16\",\"damagePerJob\":\"1.0\",\"quantity\":140,\"requiredTypeVolume\":\"0.1\"},{\"activityID\":4,\"activityName\":\"Researching Material Productivity\",\"requiredTypeID\":9836,\"requiredTypeName\":\"Consumer Electronics\",\"requiredTypeCategoryID\":43,\"requiredTypeGroupID\":1034,\"requiredTypeGroupName\":\"Refined Commodities\",\"requiredTypeIcon\":\"24_08\",\"damagePerJob\":\"1.0\",\"quantity\":100,\"requiredTypeVolume\":\"1.5\"},{\"activityID\":4,\"activityName\":\"Researching Material Productivity\",\"requiredTypeID\":11450,\"requiredTypeName\":\"Gallentean Starship Engineering\",\"requiredTypeCategoryID\":16,\"requiredTypeGroupID\":270,\"requiredTypeGroupName\":\"Science\",\"requiredTypeIcon\":\"50_11\",\"damagePerJob\":\"0.0\",\"quantity\":5,\"requiredTypeVolume\":\"0.01\"},{\"activityID\":4,\"activityName\":\"Researching Material Productivity\",\"requiredTypeID\":11452,\"requiredTypeName\":\"Mechanical Engineering\",\"requiredTypeCategoryID\":16,\"requiredTypeGroupID\":270,\"requiredTypeGroupName\":\"Science\",\"requiredTypeIcon\":\"50_11\",\"damagePerJob\":\"0.0\",\"quantity\":5,\"requiredTypeVolume\":\"0.01\"},{\"activityID\":4,\"activityName\":\"Researching Material Productivity\",\"requiredTypeID\":11466,\"requiredTypeName\":\"R.Db - CreoDron\",\"requiredTypeCategoryID\":17,\"requiredTypeGroupID\":332,\"requiredTypeGroupName\":\"Tool\",\"requiredTypeIcon\":\"41_01\",\"damagePerJob\":\"0.6\",\"quantity\":30,\"requiredTypeVolume\":\"4.0\"}],\"copyingRequirementDtos\":[{\"activityID\":5,\"activityName\":\"Copying\",\"requiredTypeID\":3812,\"requiredTypeName\":\"Data Sheets\",\"requiredTypeCategoryID\":17,\"requiredTypeGroupID\":280,\"requiredTypeGroupName\":\"General\",\"requiredTypeIcon\":\"10_16\",\"damagePerJob\":\"1.0\",\"quantity\":600,\"requiredTypeVolume\":\"1.0\"},{\"activityID\":5,\"activityName\":\"Copying\",\"requiredTypeID\":11450,\"requiredTypeName\":\"Gallentean Starship Engineering\",\"requiredTypeCategoryID\":16,\"requiredTypeGroupID\":270,\"requiredTypeGroupName\":\"Science\",\"requiredTypeIcon\":\"50_11\",\"damagePerJob\":\"0.0\",\"quantity\":5,\"requiredTypeVolume\":\"0.01\"},{\"activityID\":5,\"activityName\":\"Copying\",\"requiredTypeID\":11452,\"requiredTypeName\":\"Mechanical Engineering\",\"requiredTypeCategoryID\":16,\"requiredTypeGroupID\":270,\"requiredTypeGroupName\":\"Science\",\"requiredTypeIcon\":\"50_11\",\"damagePerJob\":\"0.0\",\"quantity\":5,\"requiredTypeVolume\":\"0.01\"},{\"activityID\":5,\"activityName\":\"Copying\",\"requiredTypeID\":11466,\"requiredTypeName\":\"R.Db - CreoDron\",\"requiredTypeCategoryID\":17,\"requiredTypeGroupID\":332,\"requiredTypeGroupName\":\"Tool\",\"requiredTypeIcon\":\"41_01\",\"damagePerJob\":\"0.95\",\"quantity\":40,\"requiredTypeVolume\":\"4.0\"}],\"reverseEngineeringRequirementDtos\":[],\"inventionRequirementDtos\":[]}"));
        assertThat(connection.getHeaderField("Content-Type"), equalTo("application/json; charset=utf-8"));
        connection = (HttpURLConnection) url.openConnection();
        connection.setRequestMethod("GET");
        connection.setRequestProperty("Accept", "application/xml");
        assertThat(connection.getResponseCode(), equalTo(200));
        assertThat(getResponse(connection), equalTo("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><blueprintDetailsDto><copyingRequirementDtos><activityID>5</activityID><activityName>Copying</activityName><damagePerJob>1.0</damagePerJob><quantity>600</quantity><requiredTypeCategoryID>17</requiredTypeCategoryID><requiredTypeGroupID>280</requiredTypeGroupID><requiredTypeGroupName>General</requiredTypeGroupName><requiredTypeID>3812</requiredTypeID><requiredTypeIcon>10_16</requiredTypeIcon><requiredTypeName>Data Sheets</requiredTypeName><requiredTypeVolume>1.0</requiredTypeVolume></copyingRequirementDtos><copyingRequirementDtos><activityID>5</activityID><activityName>Copying</activityName><damagePerJob>0.0</damagePerJob><quantity>5</quantity><requiredTypeCategoryID>16</requiredTypeCategoryID><requiredTypeGroupID>270</requiredTypeGroupID><requiredTypeGroupName>Science</requiredTypeGroupName><requiredTypeID>11450</requiredTypeID><requiredTypeIcon>50_11</requiredTypeIcon><requiredTypeName>Gallentean Starship Engineering</requiredTypeName><requiredTypeVolume>0.01</requiredTypeVolume></copyingRequirementDtos><copyingRequirementDtos><activityID>5</activityID><activityName>Copying</activityName><damagePerJob>0.0</damagePerJob><quantity>5</quantity><requiredTypeCategoryID>16</requiredTypeCategoryID><requiredTypeGroupID>270</requiredTypeGroupID><requiredTypeGroupName>Science</requiredTypeGroupName><requiredTypeID>11452</requiredTypeID><requiredTypeIcon>50_11</requiredTypeIcon><requiredTypeName>Mechanical Engineering</requiredTypeName><requiredTypeVolume>0.01</requiredTypeVolume></copyingRequirementDtos><copyingRequirementDtos><activityID>5</activityID><activityName>Copying</activityName><damagePerJob>0.95</damagePerJob><quantity>40</quantity><requiredTypeCategoryID>17</requiredTypeCategoryID><requiredTypeGroupID>332</requiredTypeGroupID><requiredTypeGroupName>Tool</requiredTypeGroupName><requiredTypeID>11466</requiredTypeID><requiredTypeIcon>41_01</requiredTypeIcon><requiredTypeName>R.Db - CreoDron</requiredTypeName><requiredTypeVolume>4.0</requiredTypeVolume></copyingRequirementDtos><invBlueprintTypeDto><blueprintTypeID>28849</blueprintTypeID><blueprintTypeName>Anshar Blueprint</blueprintTypeName><dumpVersion>cru16</dumpVersion><maxProductionLimit>10</maxProductionLimit><parentBlueprintTypeID>20188</parentBlueprintTypeID><parentBlueprintTypeName>Obelisk Blueprint</parentBlueprintTypeName><parentProductTypeID>20187</parentProductTypeID><parentProductTypeName>Obelisk</parentProductTypeName><productCategoryID>6</productCategoryID><productPortionSize>1</productPortionSize><productTypeID>28848</productTypeID><productTypeName>Anshar</productTypeName><productVolume>17550000</productVolume><productionTime>1920000</productionTime><productivityModifier>384000</productivityModifier><researchCopyTime>2560000</researchCopyTime><researchMaterialTime>7680000</researchMaterialTime><researchProductivityTime>11520000</researchProductivityTime><researchTechTime>3840000</researchTechTime><techLevel>2</techLevel><wasteFactor>10</wasteFactor></invBlueprintTypeDto><manufacturingRequirementDtos><activityID>1</activityID><activityName>Manufacturing</activityName><damagePerJob>0.0</damagePerJob><quantity>5</quantity><requiredTypeCategoryID>16</requiredTypeCategoryID><requiredTypeGroupID>268</requiredTypeGroupID><requiredTypeGroupName>Industry</requiredTypeGroupName><requiredTypeID>3380</requiredTypeID><requiredTypeIcon>50_11</requiredTypeIcon><requiredTypeName>Industry</requiredTypeName><requiredTypeVolume>0.01</requiredTypeVolume></manufacturingRequirementDtos><manufacturingRequirementDtos><activityID>1</activityID><activityName>Manufacturing</activityName><damagePerJob>0.0</damagePerJob><quantity>4</quantity><requiredTypeCategoryID>16</requiredTypeCategoryID><requiredTypeGroupID>270</requiredTypeGroupID><requiredTypeGroupName>Science</requiredTypeGroupName><requiredTypeID>11450</requiredTypeID><requiredTypeIcon>50_11</requiredTypeIcon><requiredTypeName>Gallentean Starship Engineering</requiredTypeName><requiredTypeVolume>0.01</requiredTypeVolume></manufacturingRequirementDtos><manufacturingRequirementDtos><activityID>1</activityID><activityName>Manufacturing</activityName><damagePerJob>0.0</damagePerJob><quantity>4</quantity><requiredTypeCategoryID>16</requiredTypeCategoryID><requiredTypeGroupID>270</requiredTypeGroupID><requiredTypeGroupName>Science</requiredTypeGroupName><requiredTypeID>11452</requiredTypeID><requiredTypeIcon>50_11</requiredTypeIcon><requiredTypeName>Mechanical Engineering</requiredTypeName><requiredTypeVolume>0.01</requiredTypeVolume></manufacturingRequirementDtos><manufacturingRequirementDtos><activityID>1</activityID><activityName>Manufacturing</activityName><damagePerJob>0.95</damagePerJob><quantity>40</quantity><requiredTypeCategoryID>17</requiredTypeCategoryID><requiredTypeGroupID>332</requiredTypeGroupID><requiredTypeGroupName>Tool</requiredTypeGroupName><requiredTypeID>11478</requiredTypeID><requiredTypeIcon>41_02</requiredTypeIcon><requiredTypeName>R.A.M.- Starship Tech</requiredTypeName><requiredTypeVolume>4.0</requiredTypeVolume></manufacturingRequirementDtos><manufacturingRequirementDtos><activityID>1</activityID><activityName>Manufacturing</activityName><damagePerJob>1.0</damagePerJob><quantity>1</quantity><requiredTypeCategoryID>6</requiredTypeCategoryID><requiredTypeGroupID>513</requiredTypeGroupID><requiredTypeGroupName>Freighter</requiredTypeGroupName><requiredTypeID>20187</requiredTypeID><requiredTypeName>Obelisk</requiredTypeName><requiredTypeVolume>17550000</requiredTypeVolume></manufacturingRequirementDtos><manufacturingRequirementDtos><activityID>1</activityID><activityName>Manufacturing</activityName><damagePerJob>0.0</damagePerJob><quantity>4</quantity><requiredTypeCategoryID>16</requiredTypeCategoryID><requiredTypeGroupID>269</requiredTypeGroupID><requiredTypeGroupName>Mechanic</requiredTypeGroupName><requiredTypeID>22242</requiredTypeID><requiredTypeIcon>50_11</requiredTypeIcon><requiredTypeName>Capital Ship Construction</requiredTypeName><requiredTypeVolume>0.01</requiredTypeVolume></manufacturingRequirementDtos><materialDtos><materialTypeCategoryID>43</materialTypeCategoryID><materialTypeID>3828</materialTypeID><materialTypeIcon>06_05</materialTypeIcon><materialTypeName>Construction Blocks</materialTypeName><materialVolume>1.5</materialVolume><quantity>1500</quantity></materialDtos><materialDtos><materialTypeCategoryID>4</materialTypeCategoryID><materialTypeID>11399</materialTypeID><materialTypeIcon>35_02</materialTypeIcon><materialTypeName>Morphite</materialTypeName><materialVolume>0.01</materialVolume><quantity>2500</quantity></materialDtos><materialDtos><materialTypeCategoryID>17</materialTypeCategoryID><materialTypeID>21025</materialTypeID><materialTypeIcon>54_08</materialTypeIcon><materialTypeName>Capital Jump Drive</materialTypeName><materialVolume>10000.0</materialVolume><quantity>20</quantity></materialDtos><materialDtos><materialTypeCategoryID>17</materialTypeCategoryID><materialTypeID>29041</materialTypeID><materialTypeIcon>37_14</materialTypeIcon><materialTypeName>Capital Crystalline Carbonide Armor Plate</materialTypeName><materialVolume>10.0</materialVolume><quantity>1013</quantity></materialDtos><materialDtos><materialTypeCategoryID>17</materialTypeCategoryID><materialTypeID>29051</materialTypeID><materialTypeIcon>39_02</materialTypeIcon><materialTypeName>Capital Fusion Reactor Unit</materialTypeName><materialVolume>10.0</materialVolume><quantity>518</quantity></materialDtos><materialDtos><materialTypeCategoryID>17</materialTypeCategoryID><materialTypeID>29061</materialTypeID><materialTypeIcon>37_02</materialTypeIcon><materialTypeName>Capital Ion Thruster</materialTypeName><materialVolume>10.0</materialVolume><quantity>422</quantity></materialDtos><materialDtos><materialTypeCategoryID>17</materialTypeCategoryID><materialTypeID>29069</materialTypeID><materialTypeIcon>37_06</materialTypeIcon><materialTypeName>Capital Magnetometric Sensor Cluster</materialTypeName><materialVolume>10.0</materialVolume><quantity>443</quantity></materialDtos><materialDtos><materialTypeCategoryID>17</materialTypeCategoryID><materialTypeID>29081</materialTypeID><materialTypeIcon>39_06</materialTypeIcon><materialTypeName>Capital Oscillator Capacitor Unit</materialTypeName><materialVolume>10.0</materialVolume><quantity>704</quantity></materialDtos><materialDtos><materialTypeCategoryID>17</materialTypeCategoryID><materialTypeID>29085</materialTypeID><materialTypeIcon>37_10</materialTypeIcon><materialTypeName>Capital Photon Microprocessor</materialTypeName><materialVolume>10.0</materialVolume><quantity>704</quantity></materialDtos><materialDtos><materialTypeCategoryID>17</materialTypeCategoryID><materialTypeID>29091</materialTypeID><materialTypeIcon>39_10</materialTypeIcon><materialTypeName>Capital Pulse Shield Emitter</materialTypeName><materialVolume>10.0</materialVolume><quantity>449</quantity></materialDtos><materialProductivityRequirementDtos><activityID>4</activityID><activityName>Researching Material Productivity</activityName><damagePerJob>0.0</damagePerJob><quantity>5</quantity><requiredTypeCategoryID>16</requiredTypeCategoryID><requiredTypeGroupID>270</requiredTypeGroupID><requiredTypeGroupName>Science</requiredTypeGroupName><requiredTypeID>3409</requiredTypeID><requiredTypeIcon>50_11</requiredTypeIcon><requiredTypeName>Metallurgy</requiredTypeName><requiredTypeVolume>0.01</requiredTypeVolume></materialProductivityRequirementDtos><materialProductivityRequirementDtos><activityID>4</activityID><activityName>Researching Material Productivity</activityName><damagePerJob>1.0</damagePerJob><quantity>140</quantity><requiredTypeCategoryID>17</requiredTypeCategoryID><requiredTypeGroupID>280</requiredTypeGroupID><requiredTypeGroupName>General</requiredTypeGroupName><requiredTypeID>3814</requiredTypeID><requiredTypeIcon>10_16</requiredTypeIcon><requiredTypeName>Reports</requiredTypeName><requiredTypeVolume>0.1</requiredTypeVolume></materialProductivityRequirementDtos><materialProductivityRequirementDtos><activityID>4</activityID><activityName>Researching Material Productivity</activityName><damagePerJob>1.0</damagePerJob><quantity>100</quantity><requiredTypeCategoryID>43</requiredTypeCategoryID><requiredTypeGroupID>1034</requiredTypeGroupID><requiredTypeGroupName>Refined Commodities</requiredTypeGroupName><requiredTypeID>9836</requiredTypeID><requiredTypeIcon>24_08</requiredTypeIcon><requiredTypeName>Consumer Electronics</requiredTypeName><requiredTypeVolume>1.5</requiredTypeVolume></materialProductivityRequirementDtos><materialProductivityRequirementDtos><activityID>4</activityID><activityName>Researching Material Productivity</activityName><damagePerJob>0.0</damagePerJob><quantity>5</quantity><requiredTypeCategoryID>16</requiredTypeCategoryID><requiredTypeGroupID>270</requiredTypeGroupID><requiredTypeGroupName>Science</requiredTypeGroupName><requiredTypeID>11450</requiredTypeID><requiredTypeIcon>50_11</requiredTypeIcon><requiredTypeName>Gallentean Starship Engineering</requiredTypeName><requiredTypeVolume>0.01</requiredTypeVolume></materialProductivityRequirementDtos><materialProductivityRequirementDtos><activityID>4</activityID><activityName>Researching Material Productivity</activityName><damagePerJob>0.0</damagePerJob><quantity>5</quantity><requiredTypeCategoryID>16</requiredTypeCategoryID><requiredTypeGroupID>270</requiredTypeGroupID><requiredTypeGroupName>Science</requiredTypeGroupName><requiredTypeID>11452</requiredTypeID><requiredTypeIcon>50_11</requiredTypeIcon><requiredTypeName>Mechanical Engineering</requiredTypeName><requiredTypeVolume>0.01</requiredTypeVolume></materialProductivityRequirementDtos><materialProductivityRequirementDtos><activityID>4</activityID><activityName>Researching Material Productivity</activityName><damagePerJob>0.6</damagePerJob><quantity>30</quantity><requiredTypeCategoryID>17</requiredTypeCategoryID><requiredTypeGroupID>332</requiredTypeGroupID><requiredTypeGroupName>Tool</requiredTypeGroupName><requiredTypeID>11466</requiredTypeID><requiredTypeIcon>41_01</requiredTypeIcon><requiredTypeName>R.Db - CreoDron</requiredTypeName><requiredTypeVolume>4.0</requiredTypeVolume></materialProductivityRequirementDtos><timeProductivityRequirementDtos><activityID>3</activityID><activityName>Researching Time Productivity</activityName><damagePerJob>0.0</damagePerJob><quantity>5</quantity><requiredTypeCategoryID>16</requiredTypeCategoryID><requiredTypeGroupID>270</requiredTypeGroupID><requiredTypeGroupName>Science</requiredTypeGroupName><requiredTypeID>3403</requiredTypeID><requiredTypeIcon>50_11</requiredTypeIcon><requiredTypeName>Research</requiredTypeName><requiredTypeVolume>0.01</requiredTypeVolume></timeProductivityRequirementDtos><timeProductivityRequirementDtos><activityID>3</activityID><activityName>Researching Time Productivity</activityName><damagePerJob>1.0</damagePerJob><quantity>120</quantity><requiredTypeCategoryID>17</requiredTypeCategoryID><requiredTypeGroupID>280</requiredTypeGroupID><requiredTypeGroupName>General</requiredTypeGroupName><requiredTypeID>3814</requiredTypeID><requiredTypeIcon>10_16</requiredTypeIcon><requiredTypeName>Reports</requiredTypeName><requiredTypeVolume>0.1</requiredTypeVolume></timeProductivityRequirementDtos><timeProductivityRequirementDtos><activityID>3</activityID><activityName>Researching Time Productivity</activityName><damagePerJob>1.0</damagePerJob><quantity>100</quantity><requiredTypeCategoryID>43</requiredTypeCategoryID><requiredTypeGroupID>1034</requiredTypeGroupID><requiredTypeGroupName>Refined Commodities</requiredTypeGroupName><requiredTypeID>9836</requiredTypeID><requiredTypeIcon>24_08</requiredTypeIcon><requiredTypeName>Consumer Electronics</requiredTypeName><requiredTypeVolume>1.5</requiredTypeVolume></timeProductivityRequirementDtos><timeProductivityRequirementDtos><activityID>3</activityID><activityName>Researching Time Productivity</activityName><damagePerJob>0.0</damagePerJob><quantity>5</quantity><requiredTypeCategoryID>16</requiredTypeCategoryID><requiredTypeGroupID>270</requiredTypeGroupID><requiredTypeGroupName>Science</requiredTypeGroupName><requiredTypeID>11450</requiredTypeID><requiredTypeIcon>50_11</requiredTypeIcon><requiredTypeName>Gallentean Starship Engineering</requiredTypeName><requiredTypeVolume>0.01</requiredTypeVolume></timeProductivityRequirementDtos><timeProductivityRequirementDtos><activityID>3</activityID><activityName>Researching Time Productivity</activityName><damagePerJob>0.0</damagePerJob><quantity>5</quantity><requiredTypeCategoryID>16</requiredTypeCategoryID><requiredTypeGroupID>270</requiredTypeGroupID><requiredTypeGroupName>Science</requiredTypeGroupName><requiredTypeID>11452</requiredTypeID><requiredTypeIcon>50_11</requiredTypeIcon><requiredTypeName>Mechanical Engineering</requiredTypeName><requiredTypeVolume>0.01</requiredTypeVolume></timeProductivityRequirementDtos><timeProductivityRequirementDtos><activityID>3</activityID><activityName>Researching Time Productivity</activityName><damagePerJob>0.8</damagePerJob><quantity>30</quantity><requiredTypeCategoryID>17</requiredTypeCategoryID><requiredTypeGroupID>332</requiredTypeGroupID><requiredTypeGroupName>Tool</requiredTypeGroupName><requiredTypeID>11466</requiredTypeID><requiredTypeIcon>41_01</requiredTypeIcon><requiredTypeName>R.Db - CreoDron</requiredTypeName><requiredTypeVolume>4.0</requiredTypeVolume></timeProductivityRequirementDtos></blueprintDetailsDto>"));
        assertThat(connection.getHeaderField("Content-Type"), equalTo("application/xml; charset=utf-8"));
        url = new URL(baseUrl + "/blueprintDetailsForTypeName/Anshar%20Blueprint");
        connection = (HttpURLConnection) url.openConnection();
        connection.setRequestMethod("GET");
        connection.setRequestProperty("Accept", "application/json");
        assertThat(connection.getResponseCode(), equalTo(200));
        assertThat(getResponse(connection), equalTo("{\"invBlueprintTypeDto\":{\"blueprintTypeID\":28849,\"blueprintTypeName\":\"Anshar Blueprint\",\"productTypeID\":28848,\"productTypeName\":\"Anshar\",\"productCategoryID\":6,\"parentBlueprintTypeID\":20188,\"parentBlueprintTypeName\":\"Obelisk Blueprint\",\"parentProductTypeID\":20187,\"parentProductTypeName\":\"Obelisk\",\"techLevel\":2,\"productionTime\":1920000,\"researchProductivityTime\":11520000,\"researchMaterialTime\":7680000,\"researchCopyTime\":2560000,\"researchTechTime\":3840000,\"productivityModifier\":384000,\"wasteFactor\":10,\"maxProductionLimit\":10,\"productVolume\":\"17550000\",\"productPortionSize\":1,\"dumpVersion\":\"cru16\"},\"materialDtos\":[{\"materialTypeID\":3828,\"materialTypeName\":\"Construction Blocks\",\"materialTypeCategoryID\":43,\"materialTypeIcon\":\"06_05\",\"materialVolume\":\"1.5\",\"quantity\":1500},{\"materialTypeID\":11399,\"materialTypeName\":\"Morphite\",\"materialTypeCategoryID\":4,\"materialTypeIcon\":\"35_02\",\"materialVolume\":\"0.01\",\"quantity\":2500},{\"materialTypeID\":21025,\"materialTypeName\":\"Capital Jump Drive\",\"materialTypeCategoryID\":17,\"materialTypeIcon\":\"54_08\",\"materialVolume\":\"10000.0\",\"quantity\":20},{\"materialTypeID\":29041,\"materialTypeName\":\"Capital Crystalline Carbonide Armor Plate\",\"materialTypeCategoryID\":17,\"materialTypeIcon\":\"37_14\",\"materialVolume\":\"10.0\",\"quantity\":1013},{\"materialTypeID\":29051,\"materialTypeName\":\"Capital Fusion Reactor Unit\",\"materialTypeCategoryID\":17,\"materialTypeIcon\":\"39_02\",\"materialVolume\":\"10.0\",\"quantity\":518},{\"materialTypeID\":29061,\"materialTypeName\":\"Capital Ion Thruster\",\"materialTypeCategoryID\":17,\"materialTypeIcon\":\"37_02\",\"materialVolume\":\"10.0\",\"quantity\":422},{\"materialTypeID\":29069,\"materialTypeName\":\"Capital Magnetometric Sensor Cluster\",\"materialTypeCategoryID\":17,\"materialTypeIcon\":\"37_06\",\"materialVolume\":\"10.0\",\"quantity\":443},{\"materialTypeID\":29081,\"materialTypeName\":\"Capital Oscillator Capacitor Unit\",\"materialTypeCategoryID\":17,\"materialTypeIcon\":\"39_06\",\"materialVolume\":\"10.0\",\"quantity\":704},{\"materialTypeID\":29085,\"materialTypeName\":\"Capital Photon Microprocessor\",\"materialTypeCategoryID\":17,\"materialTypeIcon\":\"37_10\",\"materialVolume\":\"10.0\",\"quantity\":704},{\"materialTypeID\":29091,\"materialTypeName\":\"Capital Pulse Shield Emitter\",\"materialTypeCategoryID\":17,\"materialTypeIcon\":\"39_10\",\"materialVolume\":\"10.0\",\"quantity\":449}],\"manufacturingRequirementDtos\":[{\"activityID\":1,\"activityName\":\"Manufacturing\",\"requiredTypeID\":3380,\"requiredTypeName\":\"Industry\",\"requiredTypeCategoryID\":16,\"requiredTypeGroupID\":268,\"requiredTypeGroupName\":\"Industry\",\"requiredTypeIcon\":\"50_11\",\"damagePerJob\":\"0.0\",\"quantity\":5,\"requiredTypeVolume\":\"0.01\"},{\"activityID\":1,\"activityName\":\"Manufacturing\",\"requiredTypeID\":11450,\"requiredTypeName\":\"Gallentean Starship Engineering\",\"requiredTypeCategoryID\":16,\"requiredTypeGroupID\":270,\"requiredTypeGroupName\":\"Science\",\"requiredTypeIcon\":\"50_11\",\"damagePerJob\":\"0.0\",\"quantity\":4,\"requiredTypeVolume\":\"0.01\"},{\"activityID\":1,\"activityName\":\"Manufacturing\",\"requiredTypeID\":11452,\"requiredTypeName\":\"Mechanical Engineering\",\"requiredTypeCategoryID\":16,\"requiredTypeGroupID\":270,\"requiredTypeGroupName\":\"Science\",\"requiredTypeIcon\":\"50_11\",\"damagePerJob\":\"0.0\",\"quantity\":4,\"requiredTypeVolume\":\"0.01\"},{\"activityID\":1,\"activityName\":\"Manufacturing\",\"requiredTypeID\":11478,\"requiredTypeName\":\"R.A.M.- Starship Tech\",\"requiredTypeCategoryID\":17,\"requiredTypeGroupID\":332,\"requiredTypeGroupName\":\"Tool\",\"requiredTypeIcon\":\"41_02\",\"damagePerJob\":\"0.95\",\"quantity\":40,\"requiredTypeVolume\":\"4.0\"},{\"activityID\":1,\"activityName\":\"Manufacturing\",\"requiredTypeID\":20187,\"requiredTypeName\":\"Obelisk\",\"requiredTypeCategoryID\":6,\"requiredTypeGroupID\":513,\"requiredTypeGroupName\":\"Freighter\",\"damagePerJob\":\"1.0\",\"quantity\":1,\"requiredTypeVolume\":\"17550000\"},{\"activityID\":1,\"activityName\":\"Manufacturing\",\"requiredTypeID\":22242,\"requiredTypeName\":\"Capital Ship Construction\",\"requiredTypeCategoryID\":16,\"requiredTypeGroupID\":269,\"requiredTypeGroupName\":\"Mechanic\",\"requiredTypeIcon\":\"50_11\",\"damagePerJob\":\"0.0\",\"quantity\":4,\"requiredTypeVolume\":\"0.01\"}],\"timeProductivityRequirementDtos\":[{\"activityID\":3,\"activityName\":\"Researching Time Productivity\",\"requiredTypeID\":3403,\"requiredTypeName\":\"Research\",\"requiredTypeCategoryID\":16,\"requiredTypeGroupID\":270,\"requiredTypeGroupName\":\"Science\",\"requiredTypeIcon\":\"50_11\",\"damagePerJob\":\"0.0\",\"quantity\":5,\"requiredTypeVolume\":\"0.01\"},{\"activityID\":3,\"activityName\":\"Researching Time Productivity\",\"requiredTypeID\":3814,\"requiredTypeName\":\"Reports\",\"requiredTypeCategoryID\":17,\"requiredTypeGroupID\":280,\"requiredTypeGroupName\":\"General\",\"requiredTypeIcon\":\"10_16\",\"damagePerJob\":\"1.0\",\"quantity\":120,\"requiredTypeVolume\":\"0.1\"},{\"activityID\":3,\"activityName\":\"Researching Time Productivity\",\"requiredTypeID\":9836,\"requiredTypeName\":\"Consumer Electronics\",\"requiredTypeCategoryID\":43,\"requiredTypeGroupID\":1034,\"requiredTypeGroupName\":\"Refined Commodities\",\"requiredTypeIcon\":\"24_08\",\"damagePerJob\":\"1.0\",\"quantity\":100,\"requiredTypeVolume\":\"1.5\"},{\"activityID\":3,\"activityName\":\"Researching Time Productivity\",\"requiredTypeID\":11450,\"requiredTypeName\":\"Gallentean Starship Engineering\",\"requiredTypeCategoryID\":16,\"requiredTypeGroupID\":270,\"requiredTypeGroupName\":\"Science\",\"requiredTypeIcon\":\"50_11\",\"damagePerJob\":\"0.0\",\"quantity\":5,\"requiredTypeVolume\":\"0.01\"},{\"activityID\":3,\"activityName\":\"Researching Time Productivity\",\"requiredTypeID\":11452,\"requiredTypeName\":\"Mechanical Engineering\",\"requiredTypeCategoryID\":16,\"requiredTypeGroupID\":270,\"requiredTypeGroupName\":\"Science\",\"requiredTypeIcon\":\"50_11\",\"damagePerJob\":\"0.0\",\"quantity\":5,\"requiredTypeVolume\":\"0.01\"},{\"activityID\":3,\"activityName\":\"Researching Time Productivity\",\"requiredTypeID\":11466,\"requiredTypeName\":\"R.Db - CreoDron\",\"requiredTypeCategoryID\":17,\"requiredTypeGroupID\":332,\"requiredTypeGroupName\":\"Tool\",\"requiredTypeIcon\":\"41_01\",\"damagePerJob\":\"0.8\",\"quantity\":30,\"requiredTypeVolume\":\"4.0\"}],\"materialProductivityRequirementDtos\":[{\"activityID\":4,\"activityName\":\"Researching Material Productivity\",\"requiredTypeID\":3409,\"requiredTypeName\":\"Metallurgy\",\"requiredTypeCategoryID\":16,\"requiredTypeGroupID\":270,\"requiredTypeGroupName\":\"Science\",\"requiredTypeIcon\":\"50_11\",\"damagePerJob\":\"0.0\",\"quantity\":5,\"requiredTypeVolume\":\"0.01\"},{\"activityID\":4,\"activityName\":\"Researching Material Productivity\",\"requiredTypeID\":3814,\"requiredTypeName\":\"Reports\",\"requiredTypeCategoryID\":17,\"requiredTypeGroupID\":280,\"requiredTypeGroupName\":\"General\",\"requiredTypeIcon\":\"10_16\",\"damagePerJob\":\"1.0\",\"quantity\":140,\"requiredTypeVolume\":\"0.1\"},{\"activityID\":4,\"activityName\":\"Researching Material Productivity\",\"requiredTypeID\":9836,\"requiredTypeName\":\"Consumer Electronics\",\"requiredTypeCategoryID\":43,\"requiredTypeGroupID\":1034,\"requiredTypeGroupName\":\"Refined Commodities\",\"requiredTypeIcon\":\"24_08\",\"damagePerJob\":\"1.0\",\"quantity\":100,\"requiredTypeVolume\":\"1.5\"},{\"activityID\":4,\"activityName\":\"Researching Material Productivity\",\"requiredTypeID\":11450,\"requiredTypeName\":\"Gallentean Starship Engineering\",\"requiredTypeCategoryID\":16,\"requiredTypeGroupID\":270,\"requiredTypeGroupName\":\"Science\",\"requiredTypeIcon\":\"50_11\",\"damagePerJob\":\"0.0\",\"quantity\":5,\"requiredTypeVolume\":\"0.01\"},{\"activityID\":4,\"activityName\":\"Researching Material Productivity\",\"requiredTypeID\":11452,\"requiredTypeName\":\"Mechanical Engineering\",\"requiredTypeCategoryID\":16,\"requiredTypeGroupID\":270,\"requiredTypeGroupName\":\"Science\",\"requiredTypeIcon\":\"50_11\",\"damagePerJob\":\"0.0\",\"quantity\":5,\"requiredTypeVolume\":\"0.01\"},{\"activityID\":4,\"activityName\":\"Researching Material Productivity\",\"requiredTypeID\":11466,\"requiredTypeName\":\"R.Db - CreoDron\",\"requiredTypeCategoryID\":17,\"requiredTypeGroupID\":332,\"requiredTypeGroupName\":\"Tool\",\"requiredTypeIcon\":\"41_01\",\"damagePerJob\":\"0.6\",\"quantity\":30,\"requiredTypeVolume\":\"4.0\"}],\"copyingRequirementDtos\":[{\"activityID\":5,\"activityName\":\"Copying\",\"requiredTypeID\":3812,\"requiredTypeName\":\"Data Sheets\",\"requiredTypeCategoryID\":17,\"requiredTypeGroupID\":280,\"requiredTypeGroupName\":\"General\",\"requiredTypeIcon\":\"10_16\",\"damagePerJob\":\"1.0\",\"quantity\":600,\"requiredTypeVolume\":\"1.0\"},{\"activityID\":5,\"activityName\":\"Copying\",\"requiredTypeID\":11450,\"requiredTypeName\":\"Gallentean Starship Engineering\",\"requiredTypeCategoryID\":16,\"requiredTypeGroupID\":270,\"requiredTypeGroupName\":\"Science\",\"requiredTypeIcon\":\"50_11\",\"damagePerJob\":\"0.0\",\"quantity\":5,\"requiredTypeVolume\":\"0.01\"},{\"activityID\":5,\"activityName\":\"Copying\",\"requiredTypeID\":11452,\"requiredTypeName\":\"Mechanical Engineering\",\"requiredTypeCategoryID\":16,\"requiredTypeGroupID\":270,\"requiredTypeGroupName\":\"Science\",\"requiredTypeIcon\":\"50_11\",\"damagePerJob\":\"0.0\",\"quantity\":5,\"requiredTypeVolume\":\"0.01\"},{\"activityID\":5,\"activityName\":\"Copying\",\"requiredTypeID\":11466,\"requiredTypeName\":\"R.Db - CreoDron\",\"requiredTypeCategoryID\":17,\"requiredTypeGroupID\":332,\"requiredTypeGroupName\":\"Tool\",\"requiredTypeIcon\":\"41_01\",\"damagePerJob\":\"0.95\",\"quantity\":40,\"requiredTypeVolume\":\"4.0\"}],\"reverseEngineeringRequirementDtos\":[],\"inventionRequirementDtos\":[]}"));
        assertThat(connection.getHeaderField("Content-Type"), equalTo("application/json; charset=utf-8"));
        connection = (HttpURLConnection) url.openConnection();
        connection.setRequestMethod("GET");
        connection.setRequestProperty("Accept", "application/xml");
        assertThat(connection.getResponseCode(), equalTo(200));
        assertThat(getResponse(connection), equalTo("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><blueprintDetailsDto><copyingRequirementDtos><activityID>5</activityID><activityName>Copying</activityName><damagePerJob>1.0</damagePerJob><quantity>600</quantity><requiredTypeCategoryID>17</requiredTypeCategoryID><requiredTypeGroupID>280</requiredTypeGroupID><requiredTypeGroupName>General</requiredTypeGroupName><requiredTypeID>3812</requiredTypeID><requiredTypeIcon>10_16</requiredTypeIcon><requiredTypeName>Data Sheets</requiredTypeName><requiredTypeVolume>1.0</requiredTypeVolume></copyingRequirementDtos><copyingRequirementDtos><activityID>5</activityID><activityName>Copying</activityName><damagePerJob>0.0</damagePerJob><quantity>5</quantity><requiredTypeCategoryID>16</requiredTypeCategoryID><requiredTypeGroupID>270</requiredTypeGroupID><requiredTypeGroupName>Science</requiredTypeGroupName><requiredTypeID>11450</requiredTypeID><requiredTypeIcon>50_11</requiredTypeIcon><requiredTypeName>Gallentean Starship Engineering</requiredTypeName><requiredTypeVolume>0.01</requiredTypeVolume></copyingRequirementDtos><copyingRequirementDtos><activityID>5</activityID><activityName>Copying</activityName><damagePerJob>0.0</damagePerJob><quantity>5</quantity><requiredTypeCategoryID>16</requiredTypeCategoryID><requiredTypeGroupID>270</requiredTypeGroupID><requiredTypeGroupName>Science</requiredTypeGroupName><requiredTypeID>11452</requiredTypeID><requiredTypeIcon>50_11</requiredTypeIcon><requiredTypeName>Mechanical Engineering</requiredTypeName><requiredTypeVolume>0.01</requiredTypeVolume></copyingRequirementDtos><copyingRequirementDtos><activityID>5</activityID><activityName>Copying</activityName><damagePerJob>0.95</damagePerJob><quantity>40</quantity><requiredTypeCategoryID>17</requiredTypeCategoryID><requiredTypeGroupID>332</requiredTypeGroupID><requiredTypeGroupName>Tool</requiredTypeGroupName><requiredTypeID>11466</requiredTypeID><requiredTypeIcon>41_01</requiredTypeIcon><requiredTypeName>R.Db - CreoDron</requiredTypeName><requiredTypeVolume>4.0</requiredTypeVolume></copyingRequirementDtos><invBlueprintTypeDto><blueprintTypeID>28849</blueprintTypeID><blueprintTypeName>Anshar Blueprint</blueprintTypeName><dumpVersion>cru16</dumpVersion><maxProductionLimit>10</maxProductionLimit><parentBlueprintTypeID>20188</parentBlueprintTypeID><parentBlueprintTypeName>Obelisk Blueprint</parentBlueprintTypeName><parentProductTypeID>20187</parentProductTypeID><parentProductTypeName>Obelisk</parentProductTypeName><productCategoryID>6</productCategoryID><productPortionSize>1</productPortionSize><productTypeID>28848</productTypeID><productTypeName>Anshar</productTypeName><productVolume>17550000</productVolume><productionTime>1920000</productionTime><productivityModifier>384000</productivityModifier><researchCopyTime>2560000</researchCopyTime><researchMaterialTime>7680000</researchMaterialTime><researchProductivityTime>11520000</researchProductivityTime><researchTechTime>3840000</researchTechTime><techLevel>2</techLevel><wasteFactor>10</wasteFactor></invBlueprintTypeDto><manufacturingRequirementDtos><activityID>1</activityID><activityName>Manufacturing</activityName><damagePerJob>0.0</damagePerJob><quantity>5</quantity><requiredTypeCategoryID>16</requiredTypeCategoryID><requiredTypeGroupID>268</requiredTypeGroupID><requiredTypeGroupName>Industry</requiredTypeGroupName><requiredTypeID>3380</requiredTypeID><requiredTypeIcon>50_11</requiredTypeIcon><requiredTypeName>Industry</requiredTypeName><requiredTypeVolume>0.01</requiredTypeVolume></manufacturingRequirementDtos><manufacturingRequirementDtos><activityID>1</activityID><activityName>Manufacturing</activityName><damagePerJob>0.0</damagePerJob><quantity>4</quantity><requiredTypeCategoryID>16</requiredTypeCategoryID><requiredTypeGroupID>270</requiredTypeGroupID><requiredTypeGroupName>Science</requiredTypeGroupName><requiredTypeID>11450</requiredTypeID><requiredTypeIcon>50_11</requiredTypeIcon><requiredTypeName>Gallentean Starship Engineering</requiredTypeName><requiredTypeVolume>0.01</requiredTypeVolume></manufacturingRequirementDtos><manufacturingRequirementDtos><activityID>1</activityID><activityName>Manufacturing</activityName><damagePerJob>0.0</damagePerJob><quantity>4</quantity><requiredTypeCategoryID>16</requiredTypeCategoryID><requiredTypeGroupID>270</requiredTypeGroupID><requiredTypeGroupName>Science</requiredTypeGroupName><requiredTypeID>11452</requiredTypeID><requiredTypeIcon>50_11</requiredTypeIcon><requiredTypeName>Mechanical Engineering</requiredTypeName><requiredTypeVolume>0.01</requiredTypeVolume></manufacturingRequirementDtos><manufacturingRequirementDtos><activityID>1</activityID><activityName>Manufacturing</activityName><damagePerJob>0.95</damagePerJob><quantity>40</quantity><requiredTypeCategoryID>17</requiredTypeCategoryID><requiredTypeGroupID>332</requiredTypeGroupID><requiredTypeGroupName>Tool</requiredTypeGroupName><requiredTypeID>11478</requiredTypeID><requiredTypeIcon>41_02</requiredTypeIcon><requiredTypeName>R.A.M.- Starship Tech</requiredTypeName><requiredTypeVolume>4.0</requiredTypeVolume></manufacturingRequirementDtos><manufacturingRequirementDtos><activityID>1</activityID><activityName>Manufacturing</activityName><damagePerJob>1.0</damagePerJob><quantity>1</quantity><requiredTypeCategoryID>6</requiredTypeCategoryID><requiredTypeGroupID>513</requiredTypeGroupID><requiredTypeGroupName>Freighter</requiredTypeGroupName><requiredTypeID>20187</requiredTypeID><requiredTypeName>Obelisk</requiredTypeName><requiredTypeVolume>17550000</requiredTypeVolume></manufacturingRequirementDtos><manufacturingRequirementDtos><activityID>1</activityID><activityName>Manufacturing</activityName><damagePerJob>0.0</damagePerJob><quantity>4</quantity><requiredTypeCategoryID>16</requiredTypeCategoryID><requiredTypeGroupID>269</requiredTypeGroupID><requiredTypeGroupName>Mechanic</requiredTypeGroupName><requiredTypeID>22242</requiredTypeID><requiredTypeIcon>50_11</requiredTypeIcon><requiredTypeName>Capital Ship Construction</requiredTypeName><requiredTypeVolume>0.01</requiredTypeVolume></manufacturingRequirementDtos><materialDtos><materialTypeCategoryID>43</materialTypeCategoryID><materialTypeID>3828</materialTypeID><materialTypeIcon>06_05</materialTypeIcon><materialTypeName>Construction Blocks</materialTypeName><materialVolume>1.5</materialVolume><quantity>1500</quantity></materialDtos><materialDtos><materialTypeCategoryID>4</materialTypeCategoryID><materialTypeID>11399</materialTypeID><materialTypeIcon>35_02</materialTypeIcon><materialTypeName>Morphite</materialTypeName><materialVolume>0.01</materialVolume><quantity>2500</quantity></materialDtos><materialDtos><materialTypeCategoryID>17</materialTypeCategoryID><materialTypeID>21025</materialTypeID><materialTypeIcon>54_08</materialTypeIcon><materialTypeName>Capital Jump Drive</materialTypeName><materialVolume>10000.0</materialVolume><quantity>20</quantity></materialDtos><materialDtos><materialTypeCategoryID>17</materialTypeCategoryID><materialTypeID>29041</materialTypeID><materialTypeIcon>37_14</materialTypeIcon><materialTypeName>Capital Crystalline Carbonide Armor Plate</materialTypeName><materialVolume>10.0</materialVolume><quantity>1013</quantity></materialDtos><materialDtos><materialTypeCategoryID>17</materialTypeCategoryID><materialTypeID>29051</materialTypeID><materialTypeIcon>39_02</materialTypeIcon><materialTypeName>Capital Fusion Reactor Unit</materialTypeName><materialVolume>10.0</materialVolume><quantity>518</quantity></materialDtos><materialDtos><materialTypeCategoryID>17</materialTypeCategoryID><materialTypeID>29061</materialTypeID><materialTypeIcon>37_02</materialTypeIcon><materialTypeName>Capital Ion Thruster</materialTypeName><materialVolume>10.0</materialVolume><quantity>422</quantity></materialDtos><materialDtos><materialTypeCategoryID>17</materialTypeCategoryID><materialTypeID>29069</materialTypeID><materialTypeIcon>37_06</materialTypeIcon><materialTypeName>Capital Magnetometric Sensor Cluster</materialTypeName><materialVolume>10.0</materialVolume><quantity>443</quantity></materialDtos><materialDtos><materialTypeCategoryID>17</materialTypeCategoryID><materialTypeID>29081</materialTypeID><materialTypeIcon>39_06</materialTypeIcon><materialTypeName>Capital Oscillator Capacitor Unit</materialTypeName><materialVolume>10.0</materialVolume><quantity>704</quantity></materialDtos><materialDtos><materialTypeCategoryID>17</materialTypeCategoryID><materialTypeID>29085</materialTypeID><materialTypeIcon>37_10</materialTypeIcon><materialTypeName>Capital Photon Microprocessor</materialTypeName><materialVolume>10.0</materialVolume><quantity>704</quantity></materialDtos><materialDtos><materialTypeCategoryID>17</materialTypeCategoryID><materialTypeID>29091</materialTypeID><materialTypeIcon>39_10</materialTypeIcon><materialTypeName>Capital Pulse Shield Emitter</materialTypeName><materialVolume>10.0</materialVolume><quantity>449</quantity></materialDtos><materialProductivityRequirementDtos><activityID>4</activityID><activityName>Researching Material Productivity</activityName><damagePerJob>0.0</damagePerJob><quantity>5</quantity><requiredTypeCategoryID>16</requiredTypeCategoryID><requiredTypeGroupID>270</requiredTypeGroupID><requiredTypeGroupName>Science</requiredTypeGroupName><requiredTypeID>3409</requiredTypeID><requiredTypeIcon>50_11</requiredTypeIcon><requiredTypeName>Metallurgy</requiredTypeName><requiredTypeVolume>0.01</requiredTypeVolume></materialProductivityRequirementDtos><materialProductivityRequirementDtos><activityID>4</activityID><activityName>Researching Material Productivity</activityName><damagePerJob>1.0</damagePerJob><quantity>140</quantity><requiredTypeCategoryID>17</requiredTypeCategoryID><requiredTypeGroupID>280</requiredTypeGroupID><requiredTypeGroupName>General</requiredTypeGroupName><requiredTypeID>3814</requiredTypeID><requiredTypeIcon>10_16</requiredTypeIcon><requiredTypeName>Reports</requiredTypeName><requiredTypeVolume>0.1</requiredTypeVolume></materialProductivityRequirementDtos><materialProductivityRequirementDtos><activityID>4</activityID><activityName>Researching Material Productivity</activityName><damagePerJob>1.0</damagePerJob><quantity>100</quantity><requiredTypeCategoryID>43</requiredTypeCategoryID><requiredTypeGroupID>1034</requiredTypeGroupID><requiredTypeGroupName>Refined Commodities</requiredTypeGroupName><requiredTypeID>9836</requiredTypeID><requiredTypeIcon>24_08</requiredTypeIcon><requiredTypeName>Consumer Electronics</requiredTypeName><requiredTypeVolume>1.5</requiredTypeVolume></materialProductivityRequirementDtos><materialProductivityRequirementDtos><activityID>4</activityID><activityName>Researching Material Productivity</activityName><damagePerJob>0.0</damagePerJob><quantity>5</quantity><requiredTypeCategoryID>16</requiredTypeCategoryID><requiredTypeGroupID>270</requiredTypeGroupID><requiredTypeGroupName>Science</requiredTypeGroupName><requiredTypeID>11450</requiredTypeID><requiredTypeIcon>50_11</requiredTypeIcon><requiredTypeName>Gallentean Starship Engineering</requiredTypeName><requiredTypeVolume>0.01</requiredTypeVolume></materialProductivityRequirementDtos><materialProductivityRequirementDtos><activityID>4</activityID><activityName>Researching Material Productivity</activityName><damagePerJob>0.0</damagePerJob><quantity>5</quantity><requiredTypeCategoryID>16</requiredTypeCategoryID><requiredTypeGroupID>270</requiredTypeGroupID><requiredTypeGroupName>Science</requiredTypeGroupName><requiredTypeID>11452</requiredTypeID><requiredTypeIcon>50_11</requiredTypeIcon><requiredTypeName>Mechanical Engineering</requiredTypeName><requiredTypeVolume>0.01</requiredTypeVolume></materialProductivityRequirementDtos><materialProductivityRequirementDtos><activityID>4</activityID><activityName>Researching Material Productivity</activityName><damagePerJob>0.6</damagePerJob><quantity>30</quantity><requiredTypeCategoryID>17</requiredTypeCategoryID><requiredTypeGroupID>332</requiredTypeGroupID><requiredTypeGroupName>Tool</requiredTypeGroupName><requiredTypeID>11466</requiredTypeID><requiredTypeIcon>41_01</requiredTypeIcon><requiredTypeName>R.Db - CreoDron</requiredTypeName><requiredTypeVolume>4.0</requiredTypeVolume></materialProductivityRequirementDtos><timeProductivityRequirementDtos><activityID>3</activityID><activityName>Researching Time Productivity</activityName><damagePerJob>0.0</damagePerJob><quantity>5</quantity><requiredTypeCategoryID>16</requiredTypeCategoryID><requiredTypeGroupID>270</requiredTypeGroupID><requiredTypeGroupName>Science</requiredTypeGroupName><requiredTypeID>3403</requiredTypeID><requiredTypeIcon>50_11</requiredTypeIcon><requiredTypeName>Research</requiredTypeName><requiredTypeVolume>0.01</requiredTypeVolume></timeProductivityRequirementDtos><timeProductivityRequirementDtos><activityID>3</activityID><activityName>Researching Time Productivity</activityName><damagePerJob>1.0</damagePerJob><quantity>120</quantity><requiredTypeCategoryID>17</requiredTypeCategoryID><requiredTypeGroupID>280</requiredTypeGroupID><requiredTypeGroupName>General</requiredTypeGroupName><requiredTypeID>3814</requiredTypeID><requiredTypeIcon>10_16</requiredTypeIcon><requiredTypeName>Reports</requiredTypeName><requiredTypeVolume>0.1</requiredTypeVolume></timeProductivityRequirementDtos><timeProductivityRequirementDtos><activityID>3</activityID><activityName>Researching Time Productivity</activityName><damagePerJob>1.0</damagePerJob><quantity>100</quantity><requiredTypeCategoryID>43</requiredTypeCategoryID><requiredTypeGroupID>1034</requiredTypeGroupID><requiredTypeGroupName>Refined Commodities</requiredTypeGroupName><requiredTypeID>9836</requiredTypeID><requiredTypeIcon>24_08</requiredTypeIcon><requiredTypeName>Consumer Electronics</requiredTypeName><requiredTypeVolume>1.5</requiredTypeVolume></timeProductivityRequirementDtos><timeProductivityRequirementDtos><activityID>3</activityID><activityName>Researching Time Productivity</activityName><damagePerJob>0.0</damagePerJob><quantity>5</quantity><requiredTypeCategoryID>16</requiredTypeCategoryID><requiredTypeGroupID>270</requiredTypeGroupID><requiredTypeGroupName>Science</requiredTypeGroupName><requiredTypeID>11450</requiredTypeID><requiredTypeIcon>50_11</requiredTypeIcon><requiredTypeName>Gallentean Starship Engineering</requiredTypeName><requiredTypeVolume>0.01</requiredTypeVolume></timeProductivityRequirementDtos><timeProductivityRequirementDtos><activityID>3</activityID><activityName>Researching Time Productivity</activityName><damagePerJob>0.0</damagePerJob><quantity>5</quantity><requiredTypeCategoryID>16</requiredTypeCategoryID><requiredTypeGroupID>270</requiredTypeGroupID><requiredTypeGroupName>Science</requiredTypeGroupName><requiredTypeID>11452</requiredTypeID><requiredTypeIcon>50_11</requiredTypeIcon><requiredTypeName>Mechanical Engineering</requiredTypeName><requiredTypeVolume>0.01</requiredTypeVolume></timeProductivityRequirementDtos><timeProductivityRequirementDtos><activityID>3</activityID><activityName>Researching Time Productivity</activityName><damagePerJob>0.8</damagePerJob><quantity>30</quantity><requiredTypeCategoryID>17</requiredTypeCategoryID><requiredTypeGroupID>332</requiredTypeGroupID><requiredTypeGroupName>Tool</requiredTypeGroupName><requiredTypeID>11466</requiredTypeID><requiredTypeIcon>41_01</requiredTypeIcon><requiredTypeName>R.Db - CreoDron</requiredTypeName><requiredTypeVolume>4.0</requiredTypeVolume></timeProductivityRequirementDtos></blueprintDetailsDto>"));
        assertThat(connection.getHeaderField("Content-Type"), equalTo("application/xml; charset=utf-8"));
        url = new URL(baseUrl + "/blueprintDetailsForTypeName/Anshar Blueprint");
        connection = (HttpURLConnection) url.openConnection();
        connection.setRequestMethod("GET");
        connection.setRequestProperty("Accept", "application/json");
        assertThat(connection.getResponseCode(), equalTo(400));
        connection = (HttpURLConnection) url.openConnection();
        connection.setRequestMethod("GET");
        connection.setRequestProperty("Accept", "application/xml");
        assertThat(connection.getResponseCode(), equalTo(400));
    }


    @Test
    public void test_lookupResourceType_FullSearch_MatchingWordInMiddle() throws Exception {
        URL url = new URL(baseUrl + "/lookupResourceType/carbo");
        HttpURLConnection connection = (HttpURLConnection) url.openConnection();
        connection.setRequestMethod("GET");
        connection.setRequestProperty("Accept", "application/json");
        assertThat(connection.getResponseCode(), equalTo(200));
        assertThat(getResponse(connection), equalTo("[{\"itemTypeID\":16659,\"itemCategoryID\":4,\"name\":\"Carbon Polymers\",\"icon\":\"50_04\"},{\"itemTypeID\":30310,\"itemCategoryID\":4,\"name\":\"Carbon-86 Epoxy Resin\",\"icon\":\"83_10\"},{\"itemTypeID\":16670,\"itemCategoryID\":4,\"name\":\"Crystalline Carbonide\",\"icon\":\"49_09\"}]"));
        assertThat(connection.getHeaderField("Content-Type"), equalTo("application/json; charset=utf-8"));
    }


    @Test
    public void test_lookupResourceType_FullSearch_TwoWords() throws Exception {
        URL url = new URL(baseUrl + "/lookupResourceType/alloyed+tritanium");
        HttpURLConnection connection = (HttpURLConnection) url.openConnection();
        connection.setRequestMethod("GET");
        connection.setRequestProperty("Accept", "application/json");
        assertThat(connection.getResponseCode(), equalTo(200));
        assertThat(getResponse(connection), equalTo("[{\"itemTypeID\":25595,\"itemCategoryID\":4,\"name\":\"Alloyed Tritanium Bar\",\"icon\":\"69_11\"}]"));
        assertThat(connection.getHeaderField("Content-Type"), equalTo("application/json; charset=utf-8"));
    }


    @Test
    public void test_lookupResourceType_FullSearch_TwoWordsInMiddle() throws Exception {
        URL url = new URL(baseUrl + "/lookupResourceType/armor+plates");
        HttpURLConnection connection = (HttpURLConnection) url.openConnection();
        connection.setRequestMethod("GET");
        connection.setRequestProperty("Accept", "application/json");
        assertThat(connection.getResponseCode(), equalTo(200));
        assertThat(getResponse(connection), equalTo("[{\"itemTypeID\":25605,\"itemCategoryID\":4,\"name\":\"Armor Plates\",\"icon\":\"69_09\"},{\"itemTypeID\":25624,\"itemCategoryID\":4,\"name\":\"Intact Armor Plates\",\"icon\":\"69_10\"}]"));
        assertThat(connection.getHeaderField("Content-Type"), equalTo("application/json; charset=utf-8"));
    }


    @Test
    public void test_lookupType() throws Exception {
        URL url = new URL(baseUrl + "/lookupType/Tri");
        HttpURLConnection connection = (HttpURLConnection) url.openConnection();
        connection.setRequestMethod("GET");
        connection.setRequestProperty("Accept", "application/json");
        assertThat(connection.getResponseCode(), equalTo(200));
        assertThat(getResponse(connection), equalTo("[{\"itemTypeID\":25595,\"itemCategoryID\":4,\"name\":\"Alloyed Tritanium Bar\",\"icon\":\"69_11\"},{\"itemTypeID\":21729,\"itemCategoryID\":17,\"name\":\"Angel Advanced Trigger Mechanism\",\"icon\":\"55_13\"},{\"itemTypeID\":21731,\"itemCategoryID\":17,\"name\":\"Angel Simple Trigger Mechanism\",\"icon\":\"55_13\"},{\"itemTypeID\":21730,\"itemCategoryID\":17,\"name\":\"Angel Standard Trigger Mechanism\",\"icon\":\"55_13\"},{\"itemTypeID\":28830,\"itemCategoryID\":17,\"name\":\"Brutor Tribe Roster\",\"icon\":\"34_06\"},{\"itemTypeID\":29105,\"itemCategoryID\":17,\"name\":\"Capital Thermonuclear Trigger Unit\",\"icon\":\"41_07\"},{\"itemTypeID\":29106,\"itemCategoryID\":9,\"name\":\"Capital Thermonuclear Trigger Unit Blueprint\",\"icon\":\"03_02\"},{\"itemTypeID\":28390,\"itemCategoryID\":25,\"name\":\"Compressed Triclinic Bistot\",\"icon\":\"71_02\"},{\"itemTypeID\":28451,\"itemCategoryID\":9,\"name\":\"Compressed Triclinic Bistot Blueprint\"},{\"itemTypeID\":2979,\"itemCategoryID\":17,\"name\":\"Crate of Industrial-Grade Tritanium-Alloy Scraps\",\"icon\":\"45_10\"},{\"itemTypeID\":2980,\"itemCategoryID\":17,\"name\":\"Large Crate of Industrial-Grade Tritanium-Alloy Scraps\",\"icon\":\"45_10\"},{\"itemTypeID\":25894,\"itemCategoryID\":7,\"name\":\"Large Trimark Armor Pump I\",\"icon\":\"68_10\",\"metaLevel\":0},{\"itemTypeID\":25895,\"itemCategoryID\":9,\"name\":\"Large Trimark Armor Pump I Blueprint\",\"icon\":\"02_10\"},{\"itemTypeID\":26302,\"itemCategoryID\":7,\"name\":\"Large Trimark Armor Pump II\",\"icon\":\"68_10\",\"metaLevel\":5},{\"itemTypeID\":26303,\"itemCategoryID\":9,\"name\":\"Large Trimark Armor Pump II Blueprint\",\"icon\":\"02_10\"},{\"itemTypeID\":31055,\"itemCategoryID\":7,\"name\":\"Medium Trimark Armor Pump I\",\"icon\":\"68_10\"},{\"itemTypeID\":31056,\"itemCategoryID\":9,\"name\":\"Medium Trimark Armor Pump I Blueprint\",\"icon\":\"02_10\"},{\"itemTypeID\":31059,\"itemCategoryID\":7,\"name\":\"Medium Trimark Armor Pump II\",\"icon\":\"68_10\"},{\"itemTypeID\":31060,\"itemCategoryID\":9,\"name\":\"Medium Trimark Armor Pump II Blueprint\",\"icon\":\"02_10\"},{\"itemTypeID\":30987,\"itemCategoryID\":7,\"name\":\"Small Trimark Armor Pump I\",\"icon\":\"68_10\"},{\"itemTypeID\":30988,\"itemCategoryID\":9,\"name\":\"Small Trimark Armor Pump I Blueprint\",\"icon\":\"02_10\"},{\"itemTypeID\":31057,\"itemCategoryID\":7,\"name\":\"Small Trimark Armor Pump II\",\"icon\":\"68_10\"},{\"itemTypeID\":31058,\"itemCategoryID\":9,\"name\":\"Small Trimark Armor Pump II Blueprint\",\"icon\":\"02_10\"},{\"itemTypeID\":25593,\"itemCategoryID\":4,\"name\":\"Smashed Trigger Unit\",\"icon\":\"69_13\"},{\"itemTypeID\":23147,\"itemCategoryID\":17,\"name\":\"Takmahl Tri-polished Lens\",\"icon\":\"55_16\"},{\"itemTypeID\":26842,\"itemCategoryID\":6,\"name\":\"Tempest Tribal Issue\",\"metaLevel\":6},{\"itemTypeID\":11691,\"itemCategoryID\":17,\"name\":\"Thermonuclear Trigger Unit\",\"icon\":\"41_07\"},{\"itemTypeID\":17322,\"itemCategoryID\":9,\"name\":\"Thermonuclear Trigger Unit Blueprint\",\"icon\":\"03_02\"},{\"itemTypeID\":22140,\"itemCategoryID\":17,\"name\":\"Tri-Vitoc\",\"icon\":\"11_15\"},{\"itemTypeID\":27951,\"itemCategoryID\":7,\"name\":\"Triage Module I\",\"icon\":\"70_10\",\"metaLevel\":0},{\"itemTypeID\":27952,\"itemCategoryID\":9,\"name\":\"Triage Module I Blueprint\",\"icon\":\"06_03\"},{\"itemTypeID\":17428,\"itemCategoryID\":25,\"name\":\"Triclinic Bistot\",\"icon\":\"23_06\"},{\"itemTypeID\":25612,\"itemCategoryID\":4,\"name\":\"Trigger Unit\",\"icon\":\"69_14\"},{\"itemTypeID\":11066,\"itemCategoryID\":17,\"name\":\"Trinary Data\",\"icon\":\"34_05\"},{\"itemTypeID\":16307,\"itemCategoryID\":7,\"name\":\"Triple-sheathed Adaptive Nano Plating I\",\"icon\":\"01_08\",\"metaLevel\":2},{\"itemTypeID\":16315,\"itemCategoryID\":7,\"name\":\"Triple-sheathed Magnetic Plating I\",\"icon\":\"01_08\",\"metaLevel\":2},{\"itemTypeID\":16323,\"itemCategoryID\":7,\"name\":\"Triple-sheathed Reactive Plating I\",\"icon\":\"01_08\",\"metaLevel\":2},{\"itemTypeID\":16331,\"itemCategoryID\":7,\"name\":\"Triple-sheathed Reflective Plating I\",\"icon\":\"01_08\",\"metaLevel\":2},{\"itemTypeID\":16347,\"itemCategoryID\":7,\"name\":\"Triple-sheathed Regenerative Plating I\",\"icon\":\"01_08\",\"metaLevel\":2},{\"itemTypeID\":16339,\"itemCategoryID\":7,\"name\":\"Triple-sheathed Thermic Plating I\",\"icon\":\"01_08\",\"metaLevel\":2},{\"itemTypeID\":25598,\"itemCategoryID\":4,\"name\":\"Tripped Power Circuit\",\"icon\":\"69_15\"},{\"itemTypeID\":593,\"itemCategoryID\":6,\"name\":\"Tristan\",\"metaLevel\":0},{\"itemTypeID\":940,\"itemCategoryID\":9,\"name\":\"Tristan Blueprint\"},{\"itemTypeID\":17916,\"itemCategoryID\":17,\"name\":\"Tritan\\u0027s Forked Key\",\"icon\":\"34_06\"},{\"itemTypeID\":34,\"itemCategoryID\":4,\"name\":\"Tritanium\",\"icon\":\"06_14\"},{\"itemTypeID\":23170,\"itemCategoryID\":17,\"name\":\"Yan Jung Trigonometric Laws\",\"icon\":\"55_12\"}]"));
        assertThat(connection.getHeaderField("Content-Type"), equalTo("application/json; charset=utf-8"));
        connection = (HttpURLConnection) url.openConnection();
        connection.setRequestMethod("GET");
        connection.setRequestProperty("Accept", "application/xml");
        assertThat(connection.getResponseCode(), equalTo(200));
        assertThat(getResponse(connection), equalTo("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><rowset><row xsi:type=\"invTypeBasicInfoDto\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"><icon>69_11</icon><itemCategoryID>4</itemCategoryID><itemTypeID>25595</itemTypeID><name>Alloyed Tritanium Bar</name></row><row xsi:type=\"invTypeBasicInfoDto\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"><icon>55_13</icon><itemCategoryID>17</itemCategoryID><itemTypeID>21729</itemTypeID><name>Angel Advanced Trigger Mechanism</name></row><row xsi:type=\"invTypeBasicInfoDto\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"><icon>55_13</icon><itemCategoryID>17</itemCategoryID><itemTypeID>21731</itemTypeID><name>Angel Simple Trigger Mechanism</name></row><row xsi:type=\"invTypeBasicInfoDto\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"><icon>55_13</icon><itemCategoryID>17</itemCategoryID><itemTypeID>21730</itemTypeID><name>Angel Standard Trigger Mechanism</name></row><row xsi:type=\"invTypeBasicInfoDto\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"><icon>34_06</icon><itemCategoryID>17</itemCategoryID><itemTypeID>28830</itemTypeID><name>Brutor Tribe Roster</name></row><row xsi:type=\"invTypeBasicInfoDto\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"><icon>41_07</icon><itemCategoryID>17</itemCategoryID><itemTypeID>29105</itemTypeID><name>Capital Thermonuclear Trigger Unit</name></row><row xsi:type=\"invTypeBasicInfoDto\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"><icon>03_02</icon><itemCategoryID>9</itemCategoryID><itemTypeID>29106</itemTypeID><name>Capital Thermonuclear Trigger Unit Blueprint</name></row><row xsi:type=\"invTypeBasicInfoDto\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"><icon>71_02</icon><itemCategoryID>25</itemCategoryID><itemTypeID>28390</itemTypeID><name>Compressed Triclinic Bistot</name></row><row xsi:type=\"invTypeBasicInfoDto\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"><itemCategoryID>9</itemCategoryID><itemTypeID>28451</itemTypeID><name>Compressed Triclinic Bistot Blueprint</name></row><row xsi:type=\"invTypeBasicInfoDto\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"><icon>45_10</icon><itemCategoryID>17</itemCategoryID><itemTypeID>2979</itemTypeID><name>Crate of Industrial-Grade Tritanium-Alloy Scraps</name></row><row xsi:type=\"invTypeBasicInfoDto\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"><icon>45_10</icon><itemCategoryID>17</itemCategoryID><itemTypeID>2980</itemTypeID><name>Large Crate of Industrial-Grade Tritanium-Alloy Scraps</name></row><row xsi:type=\"invTypeBasicInfoDto\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"><icon>68_10</icon><itemCategoryID>7</itemCategoryID><itemTypeID>25894</itemTypeID><metaLevel>0</metaLevel><name>Large Trimark Armor Pump I</name></row><row xsi:type=\"invTypeBasicInfoDto\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"><icon>02_10</icon><itemCategoryID>9</itemCategoryID><itemTypeID>25895</itemTypeID><name>Large Trimark Armor Pump I Blueprint</name></row><row xsi:type=\"invTypeBasicInfoDto\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"><icon>68_10</icon><itemCategoryID>7</itemCategoryID><itemTypeID>26302</itemTypeID><metaLevel>5</metaLevel><name>Large Trimark Armor Pump II</name></row><row xsi:type=\"invTypeBasicInfoDto\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"><icon>02_10</icon><itemCategoryID>9</itemCategoryID><itemTypeID>26303</itemTypeID><name>Large Trimark Armor Pump II Blueprint</name></row><row xsi:type=\"invTypeBasicInfoDto\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"><icon>68_10</icon><itemCategoryID>7</itemCategoryID><itemTypeID>31055</itemTypeID><name>Medium Trimark Armor Pump I</name></row><row xsi:type=\"invTypeBasicInfoDto\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"><icon>02_10</icon><itemCategoryID>9</itemCategoryID><itemTypeID>31056</itemTypeID><name>Medium Trimark Armor Pump I Blueprint</name></row><row xsi:type=\"invTypeBasicInfoDto\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"><icon>68_10</icon><itemCategoryID>7</itemCategoryID><itemTypeID>31059</itemTypeID><name>Medium Trimark Armor Pump II</name></row><row xsi:type=\"invTypeBasicInfoDto\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"><icon>02_10</icon><itemCategoryID>9</itemCategoryID><itemTypeID>31060</itemTypeID><name>Medium Trimark Armor Pump II Blueprint</name></row><row xsi:type=\"invTypeBasicInfoDto\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"><icon>68_10</icon><itemCategoryID>7</itemCategoryID><itemTypeID>30987</itemTypeID><name>Small Trimark Armor Pump I</name></row><row xsi:type=\"invTypeBasicInfoDto\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"><icon>02_10</icon><itemCategoryID>9</itemCategoryID><itemTypeID>30988</itemTypeID><name>Small Trimark Armor Pump I Blueprint</name></row><row xsi:type=\"invTypeBasicInfoDto\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"><icon>68_10</icon><itemCategoryID>7</itemCategoryID><itemTypeID>31057</itemTypeID><name>Small Trimark Armor Pump II</name></row><row xsi:type=\"invTypeBasicInfoDto\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"><icon>02_10</icon><itemCategoryID>9</itemCategoryID><itemTypeID>31058</itemTypeID><name>Small Trimark Armor Pump II Blueprint</name></row><row xsi:type=\"invTypeBasicInfoDto\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"><icon>69_13</icon><itemCategoryID>4</itemCategoryID><itemTypeID>25593</itemTypeID><name>Smashed Trigger Unit</name></row><row xsi:type=\"invTypeBasicInfoDto\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"><icon>55_16</icon><itemCategoryID>17</itemCategoryID><itemTypeID>23147</itemTypeID><name>Takmahl Tri-polished Lens</name></row><row xsi:type=\"invTypeBasicInfoDto\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"><itemCategoryID>6</itemCategoryID><itemTypeID>26842</itemTypeID><metaLevel>6</metaLevel><name>Tempest Tribal Issue</name></row><row xsi:type=\"invTypeBasicInfoDto\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"><icon>41_07</icon><itemCategoryID>17</itemCategoryID><itemTypeID>11691</itemTypeID><name>Thermonuclear Trigger Unit</name></row><row xsi:type=\"invTypeBasicInfoDto\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"><icon>03_02</icon><itemCategoryID>9</itemCategoryID><itemTypeID>17322</itemTypeID><name>Thermonuclear Trigger Unit Blueprint</name></row><row xsi:type=\"invTypeBasicInfoDto\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"><icon>11_15</icon><itemCategoryID>17</itemCategoryID><itemTypeID>22140</itemTypeID><name>Tri-Vitoc</name></row><row xsi:type=\"invTypeBasicInfoDto\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"><icon>70_10</icon><itemCategoryID>7</itemCategoryID><itemTypeID>27951</itemTypeID><metaLevel>0</metaLevel><name>Triage Module I</name></row><row xsi:type=\"invTypeBasicInfoDto\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"><icon>06_03</icon><itemCategoryID>9</itemCategoryID><itemTypeID>27952</itemTypeID><name>Triage Module I Blueprint</name></row><row xsi:type=\"invTypeBasicInfoDto\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"><icon>23_06</icon><itemCategoryID>25</itemCategoryID><itemTypeID>17428</itemTypeID><name>Triclinic Bistot</name></row><row xsi:type=\"invTypeBasicInfoDto\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"><icon>69_14</icon><itemCategoryID>4</itemCategoryID><itemTypeID>25612</itemTypeID><name>Trigger Unit</name></row><row xsi:type=\"invTypeBasicInfoDto\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"><icon>34_05</icon><itemCategoryID>17</itemCategoryID><itemTypeID>11066</itemTypeID><name>Trinary Data</name></row><row xsi:type=\"invTypeBasicInfoDto\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"><icon>01_08</icon><itemCategoryID>7</itemCategoryID><itemTypeID>16307</itemTypeID><metaLevel>2</metaLevel><name>Triple-sheathed Adaptive Nano Plating I</name></row><row xsi:type=\"invTypeBasicInfoDto\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"><icon>01_08</icon><itemCategoryID>7</itemCategoryID><itemTypeID>16315</itemTypeID><metaLevel>2</metaLevel><name>Triple-sheathed Magnetic Plating I</name></row><row xsi:type=\"invTypeBasicInfoDto\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"><icon>01_08</icon><itemCategoryID>7</itemCategoryID><itemTypeID>16323</itemTypeID><metaLevel>2</metaLevel><name>Triple-sheathed Reactive Plating I</name></row><row xsi:type=\"invTypeBasicInfoDto\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"><icon>01_08</icon><itemCategoryID>7</itemCategoryID><itemTypeID>16331</itemTypeID><metaLevel>2</metaLevel><name>Triple-sheathed Reflective Plating I</name></row><row xsi:type=\"invTypeBasicInfoDto\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"><icon>01_08</icon><itemCategoryID>7</itemCategoryID><itemTypeID>16347</itemTypeID><metaLevel>2</metaLevel><name>Triple-sheathed Regenerative Plating I</name></row><row xsi:type=\"invTypeBasicInfoDto\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"><icon>01_08</icon><itemCategoryID>7</itemCategoryID><itemTypeID>16339</itemTypeID><metaLevel>2</metaLevel><name>Triple-sheathed Thermic Plating I</name></row><row xsi:type=\"invTypeBasicInfoDto\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"><icon>69_15</icon><itemCategoryID>4</itemCategoryID><itemTypeID>25598</itemTypeID><name>Tripped Power Circuit</name></row><row xsi:type=\"invTypeBasicInfoDto\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"><itemCategoryID>6</itemCategoryID><itemTypeID>593</itemTypeID><metaLevel>0</metaLevel><name>Tristan</name></row><row xsi:type=\"invTypeBasicInfoDto\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"><itemCategoryID>9</itemCategoryID><itemTypeID>940</itemTypeID><name>Tristan Blueprint</name></row><row xsi:type=\"invTypeBasicInfoDto\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"><icon>34_06</icon><itemCategoryID>17</itemCategoryID><itemTypeID>17916</itemTypeID><name>Tritan's Forked Key</name></row><row xsi:type=\"invTypeBasicInfoDto\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"><icon>06_14</icon><itemCategoryID>4</itemCategoryID><itemTypeID>34</itemTypeID><name>Tritanium</name></row><row xsi:type=\"invTypeBasicInfoDto\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"><icon>55_12</icon><itemCategoryID>17</itemCategoryID><itemTypeID>23170</itemTypeID><name>Yan Jung Trigonometric Laws</name></row></rowset>"));
        assertThat(connection.getHeaderField("Content-Type"), equalTo("application/xml; charset=utf-8"));
    }


    @Test
    public void test_lookupType_NonExistingName() throws Exception {
        URL url = new URL(baseUrl + "/lookupType/blah-blah");
        HttpURLConnection connection = (HttpURLConnection) url.openConnection();
        connection.setRequestMethod("GET");
        connection.setRequestProperty("Accept", "application/json");
        assertThat(connection.getResponseCode(), equalTo(200));
        assertThat(getResponse(connection), equalTo("[]"));
        assertThat(connection.getHeaderField("Content-Type"), equalTo("application/json; charset=utf-8"));
        connection = (HttpURLConnection) url.openConnection();
        connection.setRequestMethod("GET");
        connection.setRequestProperty("Accept", "application/xml");
        assertThat(connection.getResponseCode(), equalTo(200));
        assertThat(getResponse(connection), equalTo("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><rowset/>"));
        assertThat(connection.getHeaderField("Content-Type"), equalTo("application/xml; charset=utf-8"));
    }


    @Test
    public void test_lookupType_TooShortName() throws Exception {
        URL url = new URL(baseUrl + "/lookupType/A");
        HttpURLConnection connection = (HttpURLConnection) url.openConnection();
        connection.setRequestMethod("GET");
        connection.setRequestProperty("Accept", "application/json");
        assertThat(connection.getResponseCode(), equalTo(400));
        connection = (HttpURLConnection) url.openConnection();
        connection.setRequestMethod("GET");
        connection.setRequestProperty("Accept", "application/xml");
        assertThat(connection.getResponseCode(), equalTo(400));
    }


    @Test
    public void test_lookupType_FullSearch_CaseSensivity() throws Exception {
        URL url = new URL(baseUrl + "/lookupType/moRO");
        HttpURLConnection connection = (HttpURLConnection) url.openConnection();
        connection.setRequestMethod("GET");
        connection.setRequestProperty("Accept", "application/json");
        assertThat(connection.getResponseCode(), equalTo(200));
        assertThat(getResponse(connection), equalTo("[{\"itemTypeID\":19724,\"itemCategoryID\":6,\"name\":\"Moros\"},{\"itemTypeID\":19725,\"itemCategoryID\":9,\"name\":\"Moros Blueprint\"}]"));
        assertThat(connection.getHeaderField("Content-Type"), equalTo("application/json; charset=utf-8"));
    }


    @Test
    public void test_lookupType_FullSearch_MatchingWordInMiddle() throws Exception {
        URL url = new URL(baseUrl + "/lookupType/cluster");
        HttpURLConnection connection = (HttpURLConnection) url.openConnection();
        connection.setRequestMethod("GET");
        connection.setRequestProperty("Accept", "application/json");
        assertThat(connection.getResponseCode(), equalTo(200));
        assertThat(getResponse(connection), equalTo("[{\"itemTypeID\":29055,\"itemCategoryID\":17,\"name\":\"Capital Gravimetric Sensor Cluster\",\"icon\":\"37_05\"},{\"itemTypeID\":29056,\"itemCategoryID\":9,\"name\":\"Capital Gravimetric Sensor Cluster Blueprint\",\"icon\":\"03_02\"},{\"itemTypeID\":29065,\"itemCategoryID\":17,\"name\":\"Capital Ladar Sensor Cluster\",\"icon\":\"37_07\"},{\"itemTypeID\":29066,\"itemCategoryID\":9,\"name\":\"Capital Ladar Sensor Cluster Blueprint\",\"icon\":\"03_02\"},{\"itemTypeID\":29069,\"itemCategoryID\":17,\"name\":\"Capital Magnetometric Sensor Cluster\",\"icon\":\"37_06\"},{\"itemTypeID\":29070,\"itemCategoryID\":9,\"name\":\"Capital Magnetometric Sensor Cluster Blueprint\",\"icon\":\"03_02\"},{\"itemTypeID\":29095,\"itemCategoryID\":17,\"name\":\"Capital Radar Sensor Cluster\",\"icon\":\"37_08\"},{\"itemTypeID\":29096,\"itemCategoryID\":9,\"name\":\"Capital Radar Sensor Cluster Blueprint\",\"icon\":\"03_02\"},{\"itemTypeID\":21013,\"itemCategoryID\":17,\"name\":\"Capital Sensor Cluster\",\"icon\":\"54_03\"},{\"itemTypeID\":21014,\"itemCategoryID\":9,\"name\":\"Capital Sensor Cluster Blueprint\",\"icon\":\"03_02\"},{\"itemTypeID\":32241,\"itemCategoryID\":17,\"name\":\"Drive Cluster EDF-285\",\"icon\":\"24_11\"},{\"itemTypeID\":5279,\"itemCategoryID\":7,\"name\":\"F-23 Reciprocal Sensor Cluster Link\",\"icon\":\"03_09\",\"metaLevel\":4},{\"itemTypeID\":11534,\"itemCategoryID\":17,\"name\":\"Gravimetric Sensor Cluster\",\"icon\":\"37_05\"},{\"itemTypeID\":17340,\"itemCategoryID\":9,\"name\":\"Gravimetric Sensor Cluster Blueprint\",\"icon\":\"03_02\"},{\"itemTypeID\":11536,\"itemCategoryID\":17,\"name\":\"Ladar Sensor Cluster\",\"icon\":\"37_07\"},{\"itemTypeID\":17333,\"itemCategoryID\":9,\"name\":\"Ladar Sensor Cluster Blueprint\",\"icon\":\"03_02\"},{\"itemTypeID\":11535,\"itemCategoryID\":17,\"name\":\"Magnetometric Sensor Cluster\",\"icon\":\"37_06\"},{\"itemTypeID\":17345,\"itemCategoryID\":9,\"name\":\"Magnetometric Sensor Cluster Blueprint\",\"icon\":\"03_02\"},{\"itemTypeID\":6218,\"itemCategoryID\":7,\"name\":\"Protected Gravimetric Backup Cluster I\",\"icon\":\"04_10\",\"metaLevel\":1},{\"itemTypeID\":6222,\"itemCategoryID\":7,\"name\":\"Protected LADAR Backup Cluster I\",\"icon\":\"04_10\",\"metaLevel\":1},{\"itemTypeID\":6226,\"itemCategoryID\":7,\"name\":\"Protected Magnetometric Backup Cluster I\",\"icon\":\"04_10\",\"metaLevel\":1},{\"itemTypeID\":6230,\"itemCategoryID\":7,\"name\":\"Protected Multi-Frequency Backup Cluster I\",\"icon\":\"04_10\",\"metaLevel\":1},{\"itemTypeID\":6234,\"itemCategoryID\":7,\"name\":\"Protected RADAR Backup Cluster I\",\"icon\":\"04_10\",\"metaLevel\":1},{\"itemTypeID\":7895,\"itemCategoryID\":7,\"name\":\"Prototype ECCM I Gravimetric Sensor Cluster\",\"icon\":\"04_10\",\"metaLevel\":4},{\"itemTypeID\":7893,\"itemCategoryID\":7,\"name\":\"Prototype ECCM I Ladar Sensor Cluster\",\"icon\":\"04_10\",\"metaLevel\":4},{\"itemTypeID\":7914,\"itemCategoryID\":7,\"name\":\"Prototype ECCM I Magnetometric Sensor Cluster\",\"icon\":\"04_10\",\"metaLevel\":4},{\"itemTypeID\":7896,\"itemCategoryID\":7,\"name\":\"Prototype ECCM I Omni Sensor Cluster\",\"icon\":\"04_10\",\"metaLevel\":4},{\"itemTypeID\":7892,\"itemCategoryID\":7,\"name\":\"Prototype ECCM I Radar Sensor Cluster\",\"icon\":\"04_10\",\"metaLevel\":4},{\"itemTypeID\":11537,\"itemCategoryID\":17,\"name\":\"Radar Sensor Cluster\",\"icon\":\"37_08\"},{\"itemTypeID\":17336,\"itemCategoryID\":9,\"name\":\"Radar Sensor Cluster Blueprint\",\"icon\":\"03_02\"},{\"itemTypeID\":6242,\"itemCategoryID\":7,\"name\":\"Sealed Gravimetric Backup Cluster\",\"icon\":\"04_10\",\"metaLevel\":0},{\"itemTypeID\":6241,\"itemCategoryID\":7,\"name\":\"Sealed LADAR Backup Cluster\",\"icon\":\"04_10\",\"metaLevel\":0},{\"itemTypeID\":6238,\"itemCategoryID\":7,\"name\":\"Sealed Magnetometric Backup Cluster\",\"icon\":\"04_10\",\"metaLevel\":0},{\"itemTypeID\":6239,\"itemCategoryID\":7,\"name\":\"Sealed Multi-Frequency Backup Cluster\",\"icon\":\"04_10\",\"metaLevel\":0},{\"itemTypeID\":6225,\"itemCategoryID\":7,\"name\":\"Sealed RADAR Backup Cluster\",\"icon\":\"04_10\",\"metaLevel\":0},{\"itemTypeID\":20238,\"itemCategoryID\":7,\"name\":\"Secure Gravimetric Backup Cluster I\",\"icon\":\"04_10\",\"metaLevel\":2},{\"itemTypeID\":20244,\"itemCategoryID\":7,\"name\":\"Secure Ladar Backup Cluster I\",\"icon\":\"04_10\",\"metaLevel\":2},{\"itemTypeID\":20250,\"itemCategoryID\":7,\"name\":\"Secure Magnetometric Backup Cluster I\",\"icon\":\"04_10\",\"metaLevel\":2},{\"itemTypeID\":20260,\"itemCategoryID\":7,\"name\":\"Secure Radar Backup Cluster I\",\"icon\":\"04_10\",\"metaLevel\":2},{\"itemTypeID\":20240,\"itemCategoryID\":7,\"name\":\"Shielded Gravimetric Backup Cluster I\",\"icon\":\"04_10\",\"metaLevel\":3},{\"itemTypeID\":20246,\"itemCategoryID\":7,\"name\":\"Shielded Ladar Backup Cluster I\",\"icon\":\"04_10\",\"metaLevel\":3},{\"itemTypeID\":20252,\"itemCategoryID\":7,\"name\":\"Shielded Magnetometric Backup Cluster I\",\"icon\":\"04_10\",\"metaLevel\":3},{\"itemTypeID\":20262,\"itemCategoryID\":7,\"name\":\"Shielded Radar Backup Cluster I\",\"icon\":\"04_10\",\"metaLevel\":3},{\"itemTypeID\":21722,\"itemCategoryID\":17,\"name\":\"Sleeper Nanite Cluster\",\"icon\":\"55_15\"},{\"itemTypeID\":20242,\"itemCategoryID\":7,\"name\":\"Warded Gravimetric Backup Cluster I\",\"icon\":\"04_10\",\"metaLevel\":4},{\"itemTypeID\":20248,\"itemCategoryID\":7,\"name\":\"Warded Ladar Backup Cluster I\",\"icon\":\"04_10\",\"metaLevel\":4},{\"itemTypeID\":20254,\"itemCategoryID\":7,\"name\":\"Warded Magnetometric Backup Cluster I\",\"icon\":\"04_10\",\"metaLevel\":4},{\"itemTypeID\":20264,\"itemCategoryID\":7,\"name\":\"Warded Radar Backup Cluster I\",\"icon\":\"04_10\",\"metaLevel\":4}]"));
        assertThat(connection.getHeaderField("Content-Type"), equalTo("application/json; charset=utf-8"));
    }


    @Test
    public void test_lookupType_FullSearch_TwoWords() throws Exception {
        URL url = new URL(baseUrl + "/lookupType/deep+core");
        HttpURLConnection connection = (HttpURLConnection) url.openConnection();
        connection.setRequestMethod("GET");
        connection.setRequestProperty("Accept", "application/json");
        assertThat(connection.getResponseCode(), equalTo(200));
        assertThat(getResponse(connection), equalTo("[{\"itemTypeID\":11395,\"itemCategoryID\":16,\"name\":\"Deep Core Mining\",\"icon\":\"50_11\"},{\"itemTypeID\":12108,\"itemCategoryID\":7,\"name\":\"Deep Core Mining Laser I\",\"icon\":\"35_01\",\"metaLevel\":0},{\"itemTypeID\":12109,\"itemCategoryID\":9,\"name\":\"Deep Core Mining Laser I Blueprint\",\"icon\":\"12_08\"},{\"itemTypeID\":18068,\"itemCategoryID\":7,\"name\":\"Modulated Deep Core Miner II\",\"icon\":\"35_01\",\"metaLevel\":5},{\"itemTypeID\":18069,\"itemCategoryID\":9,\"name\":\"Modulated Deep Core Miner II Blueprint\",\"icon\":\"12_08\"},{\"itemTypeID\":24305,\"itemCategoryID\":7,\"name\":\"Modulated Deep Core Strip Miner II\",\"icon\":\"49_05\",\"metaLevel\":5},{\"itemTypeID\":24306,\"itemCategoryID\":9,\"name\":\"Modulated Deep Core Strip Miner II Blueprint\",\"icon\":\"12_08\"},{\"itemTypeID\":28748,\"itemCategoryID\":7,\"name\":\"ORE Deep Core Mining Laser\",\"icon\":\"35_01\",\"metaLevel\":6}]"));
        assertThat(connection.getHeaderField("Content-Type"), equalTo("application/json; charset=utf-8"));
    }


    public String getResponse(String URLstring) {
        String str = "";
        try {
            URL url = new URL(URLstring);
            BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream()));
            String st = "";
            while ((st = in.readLine()) != null) {
                str += "\n" + st;
            }
            in.close();
        } catch (MalformedURLException e) {
        } catch (IOException e) {
        }
        return str;
    }


    public void access() {
        Authenticator.setDefault(new MyAuthenticator());
        try {
            URL url = new URL("http://localhost/ws/test");
            BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream()));
            String str;
            while ((str = in.readLine()) != null) {
            }
            in.close();
        } catch (MalformedURLException e) {
        } catch (IOException e) {
        }
    }


    public void uncaughtException(final Thread t, final Throwable e) {
        final Display display = Display.getCurrent();
        final Shell shell = new Shell(display);
        final MessageBox message = new MessageBox(shell, SWT.OK | SWT.CANCEL | SWT.ICON_ERROR);
        message.setText("Hawkscope Error");
        message.setMessage(e.getMessage() + "\nSubmit Hawkscope Error Report to Issue Tracker?");
        log.error("Uncaught exception", e);
        if (message.open() == SWT.OK) {
            IOUtils.copyToClipboard(Version.getBugReport(e));
            try {
                Program.launch(Constants.HAWKSCOPE_URL_ROOT + "issues/entry?comment=" + URLEncoder.encode("Please paste the Hawkscope Error " + "Report here. It's currently copied to your " + "clipboard. Thank you for your support!", Constants.ENCODING));
            } catch (final Exception e1) {
                Program.launch(Constants.HAWKSCOPE_URL_ROOT + "issues/entry");
            }
        }
        shell.dispose();
    }


    public static InputStream call(String serviceUrl, Map parameters) throws IOException, RestException {
        StringBuffer urlString = new StringBuffer(serviceUrl);
        String query = RestClient.buildQueryString(parameters);
        HttpURLConnection conn;
        if ((urlString.length() + query.length() + 1) > MAX_URI_LENGTH_FOR_GET) {
            URL url = new URL(urlString.toString());
            conn = (HttpURLConnection) url.openConnection();
            conn.setRequestProperty("User-Agent", USER_AGENT_STRING);
            conn.setRequestMethod("POST");
            conn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
            conn.setDoOutput(true);
            conn.getOutputStream().write(query.getBytes());
        } else {
            if (query.length() > 0) {
                urlString.append("?").append(query);
            }
            URL url = new URL(urlString.toString());
            conn = (HttpURLConnection) url.openConnection();
            conn.setRequestProperty("User-Agent", USER_AGENT_STRING);
            conn.setRequestMethod("GET");
        }
        int responseCode = conn.getResponseCode();
        if (HttpURLConnection.HTTP_OK != responseCode) {
            ByteArrayOutputStream errorBuffer = new ByteArrayOutputStream();
            int read;
            byte[] readBuffer = new byte[ERROR_READ_BUFFER_SIZE];
            InputStream errorStream = conn.getErrorStream();
            while (-1 != (read = errorStream.read(readBuffer))) {
                errorBuffer.write(readBuffer, 0, read);
            }
            throw new RestException("Request failed, HTTP " + responseCode + ": " + conn.getResponseMessage(), errorBuffer.toByteArray());
        }
        return conn.getInputStream();
    }


    public String fetchStockCompanyName(Stock stock) {
        String companyName = "";
        String symbol = StockUtil.getStock(stock);
        if (isStockCached(symbol)) {
            return getStockFromCache(symbol);
        }
        String url = NbBundle.getMessage(MrSwingDataFeed.class, "MrSwingDataFeed.stockInfo.url", new String[] { symbol, register.get("username", ""), register.get("password", "") });
        HttpContext context = new BasicHttpContext();
        HttpGet method = new HttpGet(url);
        try {
            HttpResponse response = ProxyManager.httpClient.execute(method, context);
            HttpEntity entity = response.getEntity();
            if (entity != null) {
                companyName = EntityUtils.toString(entity).split("\n")[1];
                cacheStock(symbol, companyName);
                EntityUtils.consume(entity);
            }
        } catch (Exception ex) {
            companyName = "";
        } finally {
            method.abort();
        }
        return companyName;
    }


    public String[] fetchAutocomplete(String text) {
        String[] result = new String[0];
        String url = NbBundle.getMessage(MrSwingDataFeed.class, "MrSwingDataFeed.autocomplete.url", text);
        HttpContext context = new BasicHttpContext();
        HttpGet method = new HttpGet(url);
        try {
            HttpResponse response = ProxyManager.httpClient.execute(method, context);
            HttpEntity entity = response.getEntity();
            if (entity != null) {
                result = EntityUtils.toString(entity).split("\n");
                EntityUtils.consume(entity);
            }
        } catch (Exception ex) {
            result = new String[0];
        } finally {
            method.abort();
        }
        return result;
    }


    public void setInput(String input, Component caller, FFMpegProgressReceiver recv) throws IOException {
        inputMedium = null;
        if (input.contains("youtube")) {
            URL url = new URL(input);
            InputStreamReader read = new InputStreamReader(url.openStream());
            BufferedReader in = new BufferedReader(read);
            String inputLine;
            String line = null;
            String vid = input.substring(input.indexOf("?v=") + 3);
            if (vid.indexOf("&") != -1) vid = vid.substring(0, vid.indexOf("&"));
            while ((inputLine = in.readLine()) != null) {
                if (inputLine.contains("\"t\": \"")) {
                    line = inputLine.substring(inputLine.indexOf("\"t\": \"") + 6);
                    line = line.substring(0, line.indexOf("\""));
                    break;
                }
            }
            in.close();
            if (line == null) throw new IOException("Could not find flv-Video");
            Downloader dl = new Downloader("http://www.youtube.com/get_video?video_id=" + vid + "&t=" + line, recv, lang);
            dl.start();
            return;
        }
        Runtime rt = Runtime.getRuntime();
        Process p = rt.exec(new String[] { path, "-i", input });
        BufferedReader br = new BufferedReader(new InputStreamReader(p.getErrorStream()));
        String line;
        Codec videoCodec = null;
        Codec audioCodec = null;
        double duration = -1;
        String aspectRatio = null;
        String scala = null;
        String colorSpace = null;
        String rate = null;
        String mrate = null;
        String aRate = null;
        String aFreq = null;
        String aChannel = null;
        try {
            while ((line = br.readLine()) != null) {
                if (Constants.debug) System.out.println(line);
                if (line.contains("Duration:")) {
                    int hours = Integer.parseInt(line.substring(12, 14));
                    int mins = Integer.parseInt(line.substring(15, 17));
                    double secs = Double.parseDouble(line.substring(18, line.indexOf(',')));
                    duration = secs + 60 * mins + hours * 60 * 60;
                    Pattern pat = Pattern.compile("[0-9]+ kb/s");
                    Matcher m = pat.matcher(line);
                    if (m.find()) mrate = line.substring(m.start(), m.end());
                }
                if (line.contains("Video:")) {
                    String info = line.substring(24);
                    String parts[] = info.split(", ");
                    Pattern pat = Pattern.compile("Video: [a-zA-Z0-9]+,");
                    Matcher m = pat.matcher(line);
                    String codec = "";
                    if (m.find()) codec = line.substring(m.start(), m.end());
                    videoCodec = supportedCodecs.getCodecByName(codec.replace("Video: ", "").replace(",", ""));
                    colorSpace = parts[1];
                    pat = Pattern.compile("[0-9]+x[0-9]+");
                    m = pat.matcher(info);
                    if (m.find()) scala = info.substring(m.start(), m.end());
                    pat = Pattern.compile("DAR [0-9]+:[0-9]+");
                    m = pat.matcher(info);
                    if (m.find()) aspectRatio = info.substring(m.start(), m.end()).replace("DAR ", ""); else if (scala != null) aspectRatio = String.valueOf((double) (Math.round(((double) ConvertUtils.getWidthFromScala(scala) / (double) ConvertUtils.getHeightFromScala(scala)) * 100)) / 100);
                    pat = Pattern.compile("[0-9]+ kb/s");
                    m = pat.matcher(info);
                    if (m.find()) rate = info.substring(m.start(), m.end());
                } else if (line.contains("Audio:")) {
                    String info = line.substring(24);
                    Pattern pat = Pattern.compile("Audio: [a-zA-Z0-9]+,");
                    Matcher m = pat.matcher(line);
                    String codec = "";
                    if (m.find()) codec = line.substring(m.start(), m.end()).replace("Audio: ", "").replace(",", "");
                    if (codec.equals("mp3")) codec = "libmp3lame";
                    audioCodec = supportedCodecs.getCodecByName(codec);
                    pat = Pattern.compile("[0-9]+ kb/s");
                    m = pat.matcher(info);
                    if (m.find()) aRate = info.substring(m.start(), m.end());
                    pat = Pattern.compile("[0-9]+ Hz");
                    m = pat.matcher(info);
                    if (m.find()) aFreq = info.substring(m.start(), m.end());
                    if (line.contains("5.1")) aChannel = "5.1"; else if (line.contains("2.1")) aChannel = "2.1"; else if (line.contains("stereo")) aChannel = "Stereo"; else if (line.contains("mono")) aChannel = "Mono";
                }
                if (videoCodec != null && audioCodec != null && duration != -1) {
                    if (rate == null && mrate != null && aRate != null) rate = String.valueOf(ConvertUtils.getRateFromRateString(mrate) - ConvertUtils.getRateFromRateString(aRate)) + " kb/s";
                    inputMedium = new InputMedium(audioCodec, videoCodec, input, duration, colorSpace, aspectRatio, scala, rate, mrate, aRate, aFreq, aChannel);
                    break;
                }
            }
            if ((videoCodec != null || audioCodec != null) && duration != -1) inputMedium = new InputMedium(audioCodec, videoCodec, input, duration, colorSpace, aspectRatio, scala, rate, mrate, aRate, aFreq, aChannel);
        } catch (Exception exc) {
            if (caller != null) JOptionPane.showMessageDialog(caller, lang.inputerror + " Audiocodec? " + (audioCodec != null) + " Videocodec? " + (videoCodec != null), lang.error, JOptionPane.ERROR_MESSAGE);
            if (Constants.debug) System.out.println("Audiocodec: " + audioCodec + "\nVideocodec: " + videoCodec);
            if (Constants.debug) exc.printStackTrace();
            throw new IOException("Input file error");
        }
        if (inputMedium == null) {
            if (caller != null) JOptionPane.showMessageDialog(caller, lang.inputerror + " Audiocodec? " + (audioCodec != null) + " Videocodec? " + (videoCodec != null), lang.error, JOptionPane.ERROR_MESSAGE);
            if (Constants.debug) System.out.println("Audiocodec: " + audioCodec + "\nVideocodec: " + videoCodec);
            throw new IOException("Input file error");
        }
    }


    public static synchronized String encrypt(String plaintext) throws NoSuchAlgorithmException, UnsupportedEncodingException {
        MessageDigest md = null;
        md = MessageDigest.getInstance("SHA");
        md.update(plaintext.getBytes("UTF-8"));
        byte raw[] = md.digest();
        String hash = (new BASE64Encoder()).encode(raw);
        return hash;
    }


    private void zipdir(File base, String zipname) throws IOException {
        FilenameFilter ff = new ExporterFileNameFilter();
        String[] files = base.list(ff);
        File zipfile = new File(base, zipname + ".zip");
        ZipOutputStream zos = new ZipOutputStream(new FileOutputStream(zipfile));
        byte[] buf = new byte[10240];
        for (int i = 0; i < files.length; i++) {
            File f = new File(base, files[i]);
            FileInputStream fis = new FileInputStream(f);
            zos.putNextEntry(new ZipEntry(f.getName()));
            int len;
            while ((len = fis.read(buf)) > 0) zos.write(buf, 0, len);
            zos.closeEntry();
            fis.close();
            f.delete();
        }
        zos.close();
    }


    private static List<String> loadServicesImplementations(final Class ofClass) {
        List<String> result = new ArrayList<String>();
        String override = System.getProperty(ofClass.getName());
        if (override != null) {
            result.add(override);
        }
        ClassLoader loader = ServiceLib.class.getClassLoader();
        URL url = loader.getResource("META-INF/services/" + ofClass.getName());
        if (url == null) {
            return result;
        }
        InputStream inStream = null;
        InputStreamReader reader = null;
        BufferedReader bReader = null;
        try {
            inStream = url.openStream();
            reader = new InputStreamReader(inStream);
            bReader = new BufferedReader(reader);
            String line;
            while ((line = bReader.readLine()) != null) {
                if (!line.matches("\\s*(#.*)?")) {
                    result.add(line.trim());
                }
            }
        } catch (IOException iox) {
            LOG.log(Level.WARNING, "Could not load services descriptor: " + url.toString(), iox);
        } finally {
            finalClose(bReader);
            finalClose(reader);
            finalClose(inStream);
        }
        return result;
    }


    private void btnOkActionPerformed(java.awt.event.ActionEvent evt) {
        try {
            int id = 0;
            String sql = "SELECT MAX(ID) as MAX_ID from CORE_USER_GROUPS";
            PreparedStatement pStmt = Database.getMyConnection().prepareStatement(sql);
            ResultSet rs = pStmt.executeQuery();
            if (rs.next()) {
                id = rs.getInt("MAX_ID") + 1;
            } else {
                id = 1;
            }
            Database.close(pStmt);
            sql = "INSERT INTO CORE_USER_GROUPS" + " (ID, GRP_NAME, GRP_DESC, DATE_INITIAL, DATE_FINAL, IND_STATUS)" + " VALUES (?, ?, ?, ?, ?, ?)";
            pStmt = Database.getMyConnection().prepareStatement(sql);
            pStmt.setInt(1, id);
            pStmt.setString(2, txtGrpName.getText());
            pStmt.setString(3, txtGrpDesc.getText());
            pStmt.setDate(4, Utils.getTodaySql());
            pStmt.setDate(5, Date.valueOf("9999-12-31"));
            pStmt.setString(6, "A");
            pStmt.executeUpdate();
            Database.getMyConnection().commit();
            Database.close(pStmt);
            MessageBox.ok("New group added successfully", this);
            rs = getGroups();
            tblGroups.setModel(new GroupsTableModel(rs));
            Database.close(rs);
        } catch (SQLException e) {
            log.error("Failed with update operation \n" + e.getMessage());
            MessageBox.ok("Failed to create the new group in the database", this);
            try {
                Database.getMyConnection().rollback();
            } catch (Exception inner) {
            }
            ;
        } catch (IllegalArgumentException e) {
            log.error("Illegal argument for the DATE_FINAL \n" + e.getMessage());
            MessageBox.ok("Failed to create the new group in the database", this);
            try {
                Database.getMyConnection().rollback();
            } catch (Exception inner) {
            }
            ;
        } finally {
            txtGrpName.setEnabled(false);
            txtGrpDesc.setEnabled(false);
            btnOk.setEnabled(false);
            btnCancel.requestFocus();
        }
    }


    private void initLogging() {
        File logging = new File(App.getHome(), "logging.properties");
        if (!logging.exists()) {
            InputStream input = getClass().getResourceAsStream("logging.properties-setup");
            OutputStream output = null;
            try {
                output = new FileOutputStream(logging);
                IOUtils.copy(input, output);
            } catch (Exception ex) {
            } finally {
                IOUtils.closeQuietly(input);
                IOUtils.closeQuietly(output);
            }
        }
        FileInputStream input = null;
        try {
            input = new FileInputStream(logging);
            LogManager.getLogManager().readConfiguration(input);
        } catch (Exception ex) {
        } finally {
            IOUtils.closeQuietly(input);
        }
    }