Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Orhan Obut
    @orhanobut
    guys we need full unit test for wasp
    Alessandro Balocco
    @AlexBalo
    Where is Yekmer?
    :D
    There he is :)
    Ray Ch
    @iraycd
    Hi, @orhanobut, What is the status of Wasp.Image?
    Orhan Obut
    @orhanobut
    hi, Wasp.Image is working now.
    but currently some todos are still waiting
    Ray Ch
    @iraycd

    How to mock from JSON File?

        @Mock(path="mocks/product/products.json")
        @GET("/products")
        void getLatestProduct(
                CallBack<List<Product>> callBack
        );

    I not able understand how services is implemented.

    Orhan Obut
    @orhanobut
    they are under asset folder right?
    assets
    Ray Ch
    @iraycd
    Yeah. They are under assets folder.
    The example for mock is not clear. I didn't understand or am I missing something?
    Ray Ch
    @iraycd
    Should I include something while Initialize method, like setMock()?
    Orhan Obut
    @orhanobut
    can you add
    Ray Ch
    @iraycd
    My service is something like this.
    
            ProductService productService = new Wasp.Builder(this)
                    .setEndpoint("http://192.168.1.158:8134")
                    .build()
                    .create(ProductService.class);
    
            productService.getLatestProduct(new CallBack<List<Product>>() {
                @Override
                public void onSuccess(List<Product> products) {
                    for(Product product:products) {
                        Log.d("Product",product.getTitle());
                    }
                    Log.d(TAG, "Successful");
                }
    
                @Override
                public void onError(WaspError waspError) {
                    Log.d(TAG, waspError.getErrorMessage());
                }
            });
    Orhan Obut
    @orhanobut
    .setNetworkMode(NetworkMode.MOCK)
    before build()
    Ray Ch
    @iraycd
    Yeah, exactly that is what I was looking for. You didn't include that in any example.
    Orhan Obut
    @orhanobut
    we made some changes, some of them are not in the documentation unfortunately. Really need to update it soon
    Ray Ch
    @iraycd
    I can understand.
    Orhan Obut
    @orhanobut
    did it solve the problem?
    Ray Ch
    @iraycd
    Yeah.
    Ray Ch
    @iraycd
    How do I get Headers on success method with callback?
    Anthony Garera
    @AmGarera
    Where do you initialize the builder/wasp?
    Said Tahsin Dane
    @tasomaniac
    Hi all, I am trying to set a custom certificate with WASP.
    I am getting the following errorjava.io.IOException: Hostname ourhostname.com not verified:
    I saw WASP is setting an EmptyHostnameValidator, and it is supposed to accept all the hostnames.
    What could be the error?
    Said Tahsin Dane
    @tasomaniac
    
            public static Service service = new Wasp.Builder(App.instance)
                    .setEndpoint(Service.BaseURL)
                    .trustCertificates(!BuildConfig.DEBUG ? R.raw.test_cert_2 : R.raw.prod_cert, !BuildConfig.DEBUG ? TEST_KEY_STORE_PASS : PROD_KEY_STORE_PASS)
                    .build()
                    .create(Service.class);
    Here is my implementation.
    I am putting a breakpoint and verify function in SSLUtils.getEmptyHostnameVerifier() function is never called.
    Said Tahsin Dane
    @tasomaniac
    I've implemented my own WaspHttpStackwith custom SslSocketFactory and HostnameVerifier and it workd.
    Something weird is happening in the default implementation.
    Orhan Obut
    @orhanobut
    I remember we had this issue but it has been fixed as I recall but Emmar was taking care of this, I think he can answer this in more precisely, and hi :)
    Emmar Kardeşlik
    @kardeslik
    hi @tasomaniac
    EmptyHostnameVerifier is only used for "trusting all certificates" case.
    If you provide any certificate, then it assumed that your certificate belongs to the host you are trying to reach. That is why we do not assign EmptyHostnameVerifier in that case.
    Orhan Obut
    @orhanobut
    I think that makes sense to have a valid hostname when we provide the certificate
    Said Tahsin Dane
    @tasomaniac
    yeah that makes sense. :smile:
    oh I see now. I looked at the code and I thought you are setting EmptyHostnameVerifier in both cases.
    So, no bug then, working as intended. Unfortunately I didn't create the certificate.
    I will sort it out. Thank you.
    Orhan Obut
    @orhanobut
    good to hear that! :+1:
    Said Tahsin Dane
    @tasomaniac
    :+1: thank you for the support.
    Said Tahsin Dane
    @tasomaniac
    Hi folks, It's me again.
    I am strangely having difficulties building the project.
    * What went wrong:
    A problem occurred evaluating project ':wasp'.
    > Failed to apply plugin [id 'com.android.library']
       > Your project contains 2 or more modules with the same identification com.orhanobut:wasp
         at ":" and ":wasp".
         You must use different identification (either name or group) for each modules.
    I am getting this error. And quick Google search gives me nothing.
    It is really strange.
    Orhan Obut
    @orhanobut
    that’s kind of strange error, let me check here as well
    Orhan Obut
    @orhanobut
    are you trying to build the project from scratch or did you add to another project as module?
    Said Tahsin Dane
    @tasomaniac
    I just check-out the repo and run . /gradlew build