{"modulePath":"github.com/devfile/library/v2","version":"v2.4.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package testingutil\n\n## Functions\n\n```go\nfunc CreateFakeContainer(containerName string) corev1.Container\n```\nCreateFakeContainer creates a container with the given containerName\n\n```go\nfunc FakeResourceRequirements(cpu, memory string) (corev1.ResourceRequirements, error)\n```\nFakeResourceRequirements creates a fake resource requirements from cpu and memory\n\n```go\nfunc GenerateDummyContainerComponent(name string, volMounts []v1.VolumeMount, endpoints []v1.Endpoint, envs []v1.EnvVar, annotation v1.Annotation, dedicatedPod *bool) v1.Component\n```\nGenerateDummyContainerComponent returns a dummy container component for testing\n\n```go\nfunc GetDockerImageTestComponent(div DockerImageValues, autobuild *bool, attr attributes.Attributes) v1.Component\n```\nGetDockerImageTestComponent returns a docker image component that is used for testing. The parameters allow customization of the content.  If they are set to nil, then the properties will not be set\n\n```go\nfunc GetDockerImageTestComponentParentOverride(div DockerImageValues) v1.ComponentParentOverride\n```\nGetDockerImageTestComponentParentOverride returns a docker image parent override component that is used for testing. The parameters allow customization of the content.  If they are set to nil, then the properties will not be set\n\n```go\nfunc GetDockerImageTestComponentPluginOverride(div DockerImageValues) v1.ComponentPluginOverride\n```\nGetDockerImageTestComponentPluginOverride returns a docker image parent override component that is used for testing. The parameters allow customization of the content.  If they are set to nil, then the properties will not be set\n\n```go\nfunc GetFakeContainerComponent(name string) v1.Component\n```\nGetFakeContainerComponent returns a fake container component for testing. Deprecated: use GenerateDummyContainerComponent instead\n\n```go\nfunc GetFakeEnv(name, value string) v1.EnvVar\n```\nGetFakeEnv returns a fake env for testing\n\n```go\nfunc GetFakeEnvParentOverride(name, value string) v1.EnvVarParentOverride\n```\nGetFakeEnvParentOverride returns a fake envParentOverride for testing\n\n```go\nfunc GetFakeExecRunCommands() []v1.ExecCommand\n```\nGetFakeExecRunCommands returns fake commands for testing\n\n```go\nfunc GetFakeVolumeComponent(name, size string) v1.Component\n```\nGetFakeVolumeComponent returns a fake volume component for testing\n\n```go\nfunc GetFakeVolumeMount(name, path string) v1.VolumeMount\n```\nGetFakeVolumeMount returns a fake volume mount for testing\n\n```go\nfunc GetFakeVolumeMountParentOverride(name, path string) v1.VolumeMountParentOverride\n```\nGetFakeVolumeMountParentOverride returns a fake volumeMountParentOverride for testing\n\n## Types\n\n```go\ntype DockerImageValues struct {\n\t//maps to Image.ImageName\n\tImageName string\n\t//maps to Image.Dockerfile.DockerfileSrc.Uri\n\tUri string\n\t//maps to Image.Dockerfile.BuildContext\n\tBuildContext string\n\t//maps to Image.Dockerfile.RootRequired\n\tRootRequired *bool\n}\n```\nDockerImageValues struct can be used to set override or main component struct values\n\n```go\ntype FakeK8sClient struct {\n\tclient.Client         // To satisfy interface; override all used methods\n\tDevWorkspaceResources map[string]v1alpha2.DevWorkspaceTemplate\n\tErrors                map[string]string\n\tExpectedNamespace     string\n}\n```\n\n```go\nfunc (client *FakeK8sClient) Get(_ context.Context, namespacedName client.ObjectKey, obj client.Object, _ ...client.GetOption) error\n```\n\n","path":"github.com/devfile/library/v2/pkg/testingutil","name":"testingutil","synopsis":"","isRedistributable":true}
