metas:
  - apiVersion: v2
    publisher: testpub
    name: duplicated_elements1
    version: testver
    type: VS Code extension
    spec:
      endpoints:
        - name: duplicated_endpoint
          public: true
      containers:
        - image: testImg
          name: container1
          env:
            - name: duplicated_endpoint
              value: duplicated_value
            - name: testEndpoint1
              value: testValue1
          volumes:
            - mountPath: /duplicatedTestPath
              name: testVol1
          commands:
            - name: duplicated_command
              workingDir: projects
              command:
                - ls
          mountSources: false
      workspaceEnv:
        - name: TestEnv1
          value: testValue1
        - name: DUPLICATED_ENV
          value: DUPLICATED_VALUE
      extensions:
        - https://test.extension1
        - https://test.extension2
  - apiVersion: v2
    publisher: testpub
    name: duplicated_elements2
    version: testver
    type: VS Code extension
    spec:
      endpoints:
        - name: duplicated_endpoint
          public: true
      containers:
        - image: testImg
          name: container1
          env:
            - name: testEndpoint2
              value: testValue2
            - name: duplicated_endpoint
              value: duplicated_value
          volumes:
            - mountPath: /duplicatedTestPath
              name: testVol1
          commands:
            - name: duplicated_command
              workingDir: projects
              command:
                - ls
          mountSources: true
      workspaceEnv:
        - name: DUPLICATED_ENV
          value: DUPLICATED_VALUE
        - name: TestEnv2
          value: testValue2
      extensions:
        - https://test.extension2
expected:
  - apiVersion: v2
    id: testpub/duplicated_elements1/testver
    publisher: testpub
    name: duplicated_elements1
    version: testver
    type: theia plugin
    spec:
      endpoints:
        - name: duplicated_endpoint
          public: true
      containers:
        - image: testImg
          name: merged-testImg
          env:
            - name: duplicated_endpoint
              value: duplicated_value
            - name: testEndpoint1
              value: testValue1
            - name: testEndpoint2
              value: testValue2
          volumes:
            - mountPath: /duplicatedTestPath
              name: testVol1
          commands:
            - name: duplicated_command
              workingDir: projects
              command:
                - ls
          mountSources: true
      workspaceEnv:
        - name: TestEnv1
          value: testValue1
        - name: DUPLICATED_ENV
          value: DUPLICATED_VALUE
        - name: TestEnv2
          value: testValue2
      extensions:
        - https://test.extension1
        - https://test.extension2
