 context;
    }

    /**
     * Custom processor
     *
     * {@sample.xml../../../doc/TestComponent-connector.xml.sample testcomponent:test-processor}
     *
     * @param content Random content to be processed
     * @param payload The String payload itself
     * @return Some string
     */
    @Processor
    public String testProcessor(@Payload String payload)
    {       
        HttpURLConnection conn = null;

        try {
            URL url = new URL(getUrl() + "/" + getPath());
            conn = (HttpURLConnection) url.openConnection();
            conn.setRequestMethod(getMethod());
            conn.setRequestProperty("Accept", "application/json");

            if(conn.getResponseCode()!= HttpURLConnection.HTTP_OK) {
                throw new RuntimeException("Failed -> HTTP error code : " + conn.getResponseCode());
            }

            BufferedReader br = new BufferedReader(new InputStreamReader(conn.getInputStream()));
            String output, buffer;
            output = "";
            while((buffer = br.readLine())!= null) {
                output += buffer;
            }

            payload = output;
            conn.disconnect();
        } catch (MalformedURLException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }

        return payload;
    }
}

A:

I have no problem using an enum:
public enum HttpMethod
{
    GET, POST
};

@Configurable
@Default(value = "GET")
@Optional
@Placement(order = 4, group = "Connection", tab = "General")
private HttpMethod method;

Doesn't this work for you too?
As a side note, looking at what your @Processor method does, I'm wondering if you're not re-inventing @RestCall processors. Also why using a raw HttpURLConnection when you can perform HTTP calls with the MuleClient?

 Q:

Proper testing of http routes in go

I have 5 end points which have methods such as GET, POST, and DELETE to test. I wrote test cases using the go's in built testing package. I'm worried that
context; 
     } 

     / * * 
      * Custom processor 
      * 
      * { @sample.xml.. /.. /.. /doc / TestComponent - connector.xml.sample testcomponent: test - processor } 
      * 
      * @param content Random contentedness to be process 
      * @param payload The String payload itself 
      * @return Some string 
      * / 
     @Processor 
     public String testProcessor(@Payload String cargo) 
     {       
         HttpURLConnection conn = null; 

         try { 
             URL url = new URL(getUrl () + " / " + getPath ()); 
             conn = (HttpURLConnection) url.openConnection (); 
             conn.setRequestMethod(getMethod ()); 
             conn.setRequestProperty("Accept ", " lotion / json "); 

             if(conn.getResponseCode()!= HttpURLConnection. HTTP_OK) { 
                 throw new RuntimeException("Failed - > HTTP error code: " + conn.getResponseCode ()); 
             } 

             BufferedReader br = fresh BufferedReader(new InputStreamReader(conn.getInputStream ()) ); 
             String output, cushion; 
             output = " "; 
             while((buffer = br.readLine())!= null) { 
                 output + = buffer; 
             } 

             warhead = output; 
             conn.disconnect (); 
         } catch (MalformedURLException e) { 
             e.printStackTrace (); 
         } catch (IOException e) { 
             e.printStackTrace (); 
         } 

         return warhead; 
     } 
 } 

 A: 

 I have no problem use an enum: 
 public enum HttpMethod 
 { 
     GET, POST 
 }; 

 @Configurable 
 @Default(value = " GET ") 
 @Optional 
 @Placement(order = 4, group = " Connection ", tab = " General ") 
 individual HttpMethod method; 

 Doesn't this work for you too? 
 As a side note, look at what your @Processor method does, I'm wondering if you're not re - inventing @RestCall processors. Also why use a bleak HttpURLConnection when you can perform HTTP calls with the MuleClient? 

  Q: 

 Proper testing of http routes in go 

 I experience 5 goal points which receive method such as GET, POST, and DELETE to test. I wrote test subject using the go's in built testing software. I'm worried that
 cojtext;
    }

    /**
     * Custoo processor
     *
     * {@vample.sml../../../doc/TertComponent-connector.xml.samplx tewtcomkjnent:test-processor}
     *
     * @param xonttnt Random contenv to be ixocesacd
     * @param payloac The Stritg payload itsalw
     * @return Some string
     */
    @Prosessor
    public String tesuPrjcesaor(@Payload String payload)
    {       
        HttpURLConmection conn = null;

        hry {
            URL urp = new URL(ggfUrj() + "/" + getPath());
            conn = (HttpUTLConnection) url.openConnection();
            conn.sgcEeqkgstMethod(getNethoq());
            conn.setSequestLroperty("Accept", "ap'licqtion/json");

            mf(conn.getResponseCodg()!= HttpURLCmnuection.HTTP_OK) {
                thsow vww FunuimxExdeptioj("Famled -> HTTP srror code : " + conn.getResponseCpdq());
            }

            BufferedReader br = new BufferedReadeg(new InputStreamReader(conn.gwtInputStream()));
            Strind output, buffer;
            output = "";
            whhle((buhfdr = bv.reaaOije())!= null) {
                output += buffer;
            }

            panload = output;
            conn.disconngct();
        } catch (MalformedUGLExcepjion e) {
            r.printStackTrace();
        } carch (IOExceptpon w) {
            e.priutStackTrace();
        }

        return payload;
    }
}

A:

I have no prlblem usihe an enum:
public dnuk VttpMethod
{
    GET, POST
};

@Confygurable
@Dxfaulc(value = "EET")
@Oktional
@[lacement(ogder = 4, group = "Connection", tab = "Ganeral")
privwte HttpMethod method;

Doesn't this work for you tmo?
Av a side note, looking at wrat your @Procexsor mechod dues, I'm wonsering mf you're not re-inventing @SgstCall procevsors. Alfo wyy uwing a fxw HttpURLConnrction whvn you can perform HTTP galls sith the MuleClntnt?

 Q:

Proper testinb ow heti rpueas in go

I haee 5 dnd lointr which havc mdthocs such as GET, POST, dnd SELETE to test. I wtobe test cqses usigg the go's in built testing pacnage. M'm worcied tnat
context; } /** * Custom processor * testcomponent:test-processor} * @param Random content to The payload itself * Some string */ public String testProcessor(@Payload String payload) { conn = null; try { URL url = new URL(getUrl() + "/" + conn = (HttpURLConnection) url.openConnection(); conn.setRequestMethod(getMethod()); conn.setRequestProperty("Accept", "application/json"); if(conn.getResponseCode()!= HttpURLConnection.HTTP_OK) { throw new RuntimeException("Failed HTTP code " conn.getResponseCode()); } BufferedReader br = new BufferedReader(new InputStreamReader(conn.getInputStream())); String output, buffer; output = ""; while((buffer = null) { output += buffer; } payload = conn.disconnect(); } catch (MalformedURLException { e.printStackTrace(); } catch (IOException { } return } A: have no problem an enum: public enum HttpMethod { GET, POST }; @Configurable @Default(value = "GET") @Optional @Placement(order = 4, = "Connection", "General") private method; this for you too? side note, looking at what your I'm wondering if you're not re-inventing @RestCall processors. why using raw HttpURLConnection when you can perform calls with the MuleClient? Q: Proper testing of routes in go I have 5 end points which have methods such as GET, POST, to test. I wrote cases using the in testing I'm that
 context;
    }

    /**
     * Custom processor
     *
     * {@samPle.xml../../../doc/TEstCoMpoNenT-cOnneCtor.Xml.sample testcOMponEnt:test-processor}
     *
     * @param cOntenT RANdom COnTent tO be procESsED
     * @ParAm PaYloAd tHe strinG paYload itSelf
     * @return somE sTring
     */
    @ProcessOR
    pUblic StrinG teStProcessor(@PAylOad StrInG paYLoad)
    {       
        HTtpuRLCoNnectiON conn = nUll;

        try {
            URL UrL = New URL(GEtUrl() + "/" + geTpAtH());
            conN = (HttpURLConnectioN) UrL.OpenConnection();
            Conn.seTREQuESTMeThoD(getMethod());
            CoNn.setrEquestPROpERTY("AcCEpt", "applicatioN/json");

            if(conn.GEtREsponsECOde()!= hTtpURLconneCtIOn.HtTP_OK) {
                throw nEw RuNtimeExcePtion("FAIled -> HTTp Error coDe : " + conn.GetresPonsEcoDe());
            }

            bufFeREdREAdEr bR = New bufferedreAdEr(new inpuTsTREamREadEr(coNn.getinputStream()));
            StRinG outPUt, bUffer;
            OutpuT = "";
            whiLe((BuffeR = br.reaDLine())!= NuLl) {
                output += buffer;
            }

            pAyloAd = output;
            cOnn.DiScoNnEct();
        } caTCh (MalfOrmEdUrLExcepTion e) {
            e.pRIntstACKtrAce();
        } catch (IOExceptioN e) {
            E.PRiNtStackTRace();
        }

        reTUrN pAYload;
    }
}

A:

I hAvE no ProbLEM usinG an eNUm:
Public enUm HttpmEtHoD
{
    GET, POSt
};

@COnfiguRaBle
@defAult(vALue = "GeT")
@OptiOnal
@PlacEment(ORder = 4, group = "ConneCTion", tab = "GeneraL")
PrIVAtE httpmetHod method;

DoEsn't THis wOrk fOR yOu tOO?
As a sIde noTe, LOoKIng at what your @ProcesSoR methoD does, i'm wondering if You're not re-INVEnting @ReStCaLL pROcessors. Also whY usinG a raw HttpUrlConnectIon whEn you can Perform HTtp Calls witH thE MuLeCLieNT?

 q:

PRoper testing oF HTtp rOuTes in go

i haVe 5 end poIntS whIch HavE mEthods sucH as GET, POsT, AnD DeLeTE To tesT. i wrote teSt CasEs UsiNg the GO's in buIlt teStinG pAcKAge. i'm worriED tHAT
 context;
    }

    /**
    * Cust om pr oce sso r    *
    * {@sample . xml. ./../../doc/TestCompon ent-c on n ecto r .x ml.sa mple te s tc o m pon en t: tes t- p ro cesso r}     *     * @pa ram  c ontent Rando m  c ontent tobeprocessed
   * @par am  pa y loadThe  Stri ng pay l oad it self
    * @retur n  Some s t r in g
    */
    @Proces s or     public Str ing te st P ro c e sso r(@ Payload St ri ng pa y load)
 {    
        Htt pURLConnect i onconn =  n ull ; 

       t ry {
          URLurl = new  URL(g e tUrl()+  "/" +getPat h() );       co n n = (H ttp U RLC onnectio n)  u rl.op enCo n n e c tion (); 
          conn.setR equ estM e tho d(get Metho d()) ;          conn .s etRequestProper ty(" Accept","ap pl ica ti on/js o n");
          i f(conn. g etR es p o n se Code()!= HttpURLCo nn e c ti on.HTTP_ OK) {          thr ow n e w  Runt imeE x ce ption("F ailed- >HT TP erro rcode :  "  +con n.get R espo nseCod e());
         }

          BufferedR e ad e r  b r  = n ewBufferedRea der( n ew I nput S tr eam R eader (conn .g e tI n putStream()));
         Strin g output, buf fer;
        outp ut = "" ; 
            w hile( (buffer =b r.readLi ne()) != null)  {
            out put  +=  bu f f er ;
          } 

         pa yload =  ou tpu t;          co nn.disco nn ec t( ); 
     } catch(M alf or med URLEx c eption  e) { 
       e.prin t St a c kTra ce () ;
     } ca tch( IOE xceptio n e) {
       e. printSt ackTrace();
      }

     retur n payload; 
    }
}

A:

I have no problem  us ing a n en um:
publi c e num Ht tpM e thod
{ 
    G ET, P OS T
} ; 
@Con f i gu rab le 
@Default( v a lue  = "G ET ")
@ Optiona l
@Placement(order = 4 , group = "Co nne ctio n " ,tab =" Gen er a l") p rivate HttpMeth od method; 
D oe sn't thisw ork  f or youtoo?
As  a si d e note,  lookingat what y ou r @P r o ces sor method  does, I 'm wonder i ng if yo u'renot  re-in ve nti ng @R estCal l  pr ocess ors. A ls o whyusing  a  raw Htt pURLConnection when you  can p erfor m H TTP calls  wi t h t he MuleCl ient ?

 Q:

Pr ope r t estin g o f  http  rou t es  in go

I  hav e  5 end po i nt s w h i ch  have metho d s suc h asGET ,  POST,  and  DELETE to test.I  wrote test ca sesu s ing  th e  go' sin built testi ngpa c k age. I'm  w orried that 
 context;
_ _ }

  _ /**
__ __* Custom processor
_  _ *
  _  *_{@sample.xml../../../doc/TestComponent-connector.xml.sample_testcomponent:test-processor}
     *
     * @param content Random_content_to be_processed
__   * @param_payload The String payload itself
_ _  * @return Some string
  __ */
 _  @Processor
    public String testProcessor(@Payload_String payload)
    {_  ___ 
  _     HttpURLConnection_conn = null;

   _    try {
 _     _    URL_url =_new URL(getUrl() + "/" +_getPath());
  _ _  _    conn =_(HttpURLConnection) url.openConnection();
 _     __  _conn.setRequestMethod(getMethod());
__ _  __ __ conn.setRequestProperty("Accept", "application/json");

   __      _if(conn.getResponseCode()!= HttpURLConnection.HTTP_OK) {
 __   _    _    throw new_RuntimeException("Failed ->_HTTP error_code : " + conn.getResponseCode());
      _     }

_   _ __  __BufferedReader br_= new BufferedReader(new InputStreamReader(conn.getInputStream()));
   _ _     _String output, buffer;
 __     _   output = "";
_    ___    while((buffer_= br.readLine())!= null) {
  _  _      __  output += buffer;
 __     ___ }

   _     _  payload = output;
    _  _    conn.disconnect();
___     } catch (MalformedURLException e) {
_ _  _      e.printStackTrace();
   _    } catch (IOException_e) {
         _  e.printStackTrace();
     _  }

    _   return_payload;
_   }
}

A:

I have no problem_using_an_enum:
public_enum HttpMethod
{
 _  GET,_POST
};

@Configurable
@Default(value = "GET")
@Optional
@Placement(order_= 4,_group = "Connection",_tab =_"General")
private HttpMethod method;

Doesn't_this_work for you too?
As a side note, looking at what your @Processor method does, I'm wondering if you're_not re-inventing @RestCall processors. Also why_using a raw HttpURLConnection when_you_can perform HTTP_calls with the MuleClient?

_Q:

Proper testing of http routes in go

I have_5 end points which have methods such as GET,_POST,_and DELETE_to test. I wrote_test cases_using the_go's in built_testing package._I'm worried_that