Giter VIP home page Giter VIP logo

Comments (6)

arsenalzp avatar arsenalzp commented on July 23, 2024 4

Hello,
Could you please assign it to me?

from jkube.

rohanKanojia avatar rohanKanojia commented on July 23, 2024 1

On closer inspection, we can replace the loop using Java Stream API. Using Map doesn't seem to be relevant here. We should replace it with Set instead:

Set<String> secretNamesPresentInBuilder = builder.buildItems().stream()
            .filter(Secret.class::isInstance)
            .map(HasMetadata::getMetadata)
            .map(ObjectMeta::getName)
            .collect(Collectors.toSet());

then use secretNamesPresentInBuilder.contains here:

https://github.com/eclipse/jkube/blob/3afc7bf1f8dbe4452826c5ec7ec58de5c9408d53/jkube-kit/enricher/generic/src/main/java/org/eclipse/jkube/enricher/generic/SecretEnricher.java#L126

from jkube.

rohanKanojia avatar rohanKanojia commented on July 23, 2024 1

@arsenalzp : I see DockerRegistrySecretEnricher which is extending this class. There is a test for DockerRegistrySecretEnricherTest. Could you please check if it's testing only Docker Registry Secret related logic or also base class.

Anyway, I don't think there is any harm in adding test for SecretEnricher. Please create a new issue for the proposal, I'll assign it to you.

from jkube.

arsenalzp avatar arsenalzp commented on July 23, 2024

Should I write a test for this class, because test SecretEnricherTest doesn't exist?

from jkube.

rohanKanojia avatar rohanKanojia commented on July 23, 2024

@arsenalzp : This is an abstract class. Are there unit tests for classes extending this class?

from jkube.

arsenalzp avatar arsenalzp commented on July 23, 2024

@arsenalzp : This is an abstract class. Are there unit tests for classes extending this class?

I saw a unit test for ConfigMap enricher, so it does make sense to do the same test for Secret one. It is just a proposal :)

from jkube.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.