Giter Club home page Giter Club logo

custommetadataapi's People

Contributors

afawcett avatar cropredyhelix avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

custommetadataapi's Issues

Inner class CustomMetadataTest.MockPlatform is not visible for reuse

Given

  • one is using the CustomMetadata Service
  • one has testmethods that execute code that deploys Custom Metadata

When

  • executing the testmethod

Then

  • the testmethod fails because with AsyncException System.AsyncException: Metadata cannot be deployed from within a test

Class CustomMetadataTest conveniently includes public inner class MockPlatform that does useful stuff. However, if you code in your testmethod

CustomMetadataTest.MockPlatform mockPlatform = new CustomMetadataTest.MockPlatform();
mockPlatform.xxx = ... // cloning examples from CustomMetadataTest.whenUpsertingByFieldMapSendsEvent
....

you get compiler exception that CustomMetadataTest Type is not visible.

There are some workarounds:

  • Reimplement CustomMetadataTest.MockPlatform in your own namespace/org (meh)
  • Use !Test.isRunningTest() to decide whether to execute String deployId = CustomMetadata.Operations... (ugh)

Or, the GitHub lib can move class MockPlatform to a outer public class
Or, the GitHub lib could make CustomMetadata public instead of private
Or ... ?

Since you made CustomMetadataTest.MockPlatform public, you must have intended it to be reused in other classes.

Happy to do a PR once I understand your intent.

New context parameter

"On your blog, I suggested adding a custom field "context" to the
Platform Event SObject (someone else on the blog comments suggested
something similar - "topic") so the Platform Event consumer would have some
idea what use case generated the MD deployment action."

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.