Buggy code:
public class ServiceTest { private static final String HTTP_ADDRESS = "http:////127.0.0.1" ; private static final int HTTP_PORT = WebConnector . DEFAULT_HTTP_PORT ; private static LocalNode node ; private static WebConnector connector ; private static ByteArrayOutputStream logStream ; private static UserAgent testAgent ; private static final String testPass = "adamspass" ; private static final String testServiceClass = QueryVisualizationService . class . getCanonicalName ( ) ; private static final String mainPath = "QVS//" ; static JSONObject testQuery = new JSONObject ( ) ; private static final String queryPath = "query" ; static JSONObject testDB = new JSONObject ( ) ; private static final String testDBName = "newTestDB" ; private static final String dbPath = "database" ; static JSONObject testFilter = new JSONObject ( ) ; private static final String testFilterName = "newTestFilter" ; private static final String filterPath = "filter" ; @ SuppressWarnings ( "unchecked" ) Pair < String > [ ] emptyPairs = ( ( Pair < String > [ ] ) ( new Pair [ 0 ] ) ) ; @ BeforeClass public static void startServer ( ) throws Exception { ServiceTest . node = LocalNode . newNode ( ) ; ServiceTest . node . storeAgent ( MockAgentFactory . getAdam ( ) ) ; ServiceTest . node . launch ( ) ; ServiceAgent testService = ServiceAgent . generateNewAgent ( ServiceTest . testServiceClass , "a<seq2seq4repair_space>pass" ) ; testService . unlockPrivateKey ( "a<seq2seq4repair_space>pass" ) ; ServiceTest . node . registerReceiver ( testService ) ; ServiceTest . logStream = new ByteArrayOutputStream ( ) ; ServiceTest . connector = new WebConnector ( true , ServiceTest . HTTP_PORT , false , 1000 ) ; ServiceTest . connector . setSocketTimeout ( 10000 ) ; ServiceTest . connector . setLogStream ( new PrintStream ( ServiceTest . logStream ) ) ; ServiceTest . connector . start ( ServiceTest . node ) ; Thread . sleep ( 1000 ) ; ServiceTest . testAgent = MockAgentFactory . getAdam ( ) ; ServiceTest . connector . updateServiceList ( ) ; <START_BUG> ServiceTest . testDB . put ( "db_code" , MySQL ) ; <END_BUG> ServiceTest . testDB . put ( "username" , "qv_user" ) ; ServiceTest . testDB . put ( "password" , "qv_password" ) ; ServiceTest . testDB . put ( "database" , "QVS" ) ; ServiceTest . testDB . put ( "dbhost" , "localhost" ) ; ServiceTest . testDB . put ( "port" , "3306" ) ; ServiceTest . testFilter . put ( "query" , "SELECT<seq2seq4repair_space>*<seq2seq4repair_space>FROM<seq2seq4repair_space>USERS" ) ; ServiceTest . testFilter . put ( "dbkey" , ServiceTest . testDBName ) ; ServiceTest . testQuery . put ( "query" , "SELECT<seq2seq4repair_space>*<seq2seq4repair_space>FROM<seq2seq4repair_space>`DATABASE_CONNECTIONS`<seq2seq4repair_space>WHERE<seq2seq4repair_space>`KEY`<seq2seq4repair_space>=<seq2seq4repair_space>?" ) ; ServiceTest . testQuery . put ( "dbkey" , ServiceTest . testDBName ) ; ServiceTest . testQuery . put ( "queryparams" , ServiceTest . testDBName ) ; ServiceTest . testQuery . put ( "cache" , true ) ; ServiceTest . testQuery . put ( "modtypei" , 0 ) ; ServiceTest . testQuery . put ( "title" , "testQuery" ) ; ServiceTest . testQuery . put ( "width" , "100" ) ; ServiceTest . testQuery . put ( "height" , "100" ) ; ServiceTest . testQuery . put ( "save" , true ) ; try { System . out . println ( "waiting.." ) ; Thread . sleep ( 10000 ) ; } catch ( InterruptedException e ) { e . printStackTrace ( ) ; } } @ AfterClass public static void shutDownServer ( ) throws Exception { } private static void cleanUp ( MiniClient c ) { } public void testValidateLogin ( ) { } public void testExampleMethod ( ) { } @ Test public void testGetDatabases ( ) { } @ Test public void testAddDatabase ( ) { } @ Test public void testRemoveDatabase ( ) { } @ Test public void testGetFilters ( ) { } @ Test public void testAddFilter ( ) { } @ Test public void testRemoveFilter ( ) { } @ Test public void testQuery ( ) { } @ Test public void testDebugMapping ( ) { } }

Fix:
ServiceTest . testDB . put ( "db_code" , MySQL . getCode ( ) ) ;