@Override
    public CRTask deserialize(JsonElement json,
                              Type type,
                              JsonDeserializationContext context) throws JsonParseException {
        return determineJsonElementForDistinguishingImplementers(json, context, TYPE, ARTIFACT_ORIGIN);
    }
@Test
    public void shouldThrowExceptionForFetchIfOriginIsInvalid() {
        JsonObject jsonObject = new JsonObject();
        jsonObject.addProperty("type", "fetch");
        jsonObject.addProperty(TypeAdapter.ARTIFACT_ORIGIN, "fsg");

        assertThatThrownBy(() -> taskTypeAdapter.deserialize(jsonObject, type, jsonDeserializationContext))
                .isInstanceOf(JsonParseException.class)
                .hasMessageContaining("Invalid artifact origin 'fsg' for fetch task.");
    }