test_class.declarator: chartJsonConverter
test_class.modifier: private
test_class.original_string: private ChartJsonConverter chartJsonConverter;
test_class.type: ChartJsonConverter
test_class.var_name: chartJsonConverter
test_class.file: plugin-code/src/test/java/com/trivago/cluecumber/rendering/pages/charts/ChartJsonConverterTest.java
test_class.identifier: ChartJsonConverterTest
test_case.body: @Test
      public void getJsonTest() {
          String expected = "{\n" +
                  "  \"data\": {\n" +
                  "    \"labels\": [\n" +
                  "      \"1\",\n" +
                  "      \"2\",\n" +
                  "      \"3\",\n" +
                  "      \"4\",\n" +
                  "      \"5\",\n" +
                  "      \"6\"\n" +
                  "    ],\n" +
                  "    \"datasets\": [\n" +
                  "      {\n" +
                  "        \"data\": [\n" +
                  "          340,\n" +
                  "          0,\n" +
                  "          0,\n" +
                  "          440,\n" +
                  "          340,\n" +
                  "          0\n" +
                  "        ],\n" +
                  "        \"backgroundColor\": [\n" +
                  "          \"rgba(240,0,0,1.000)\"\n" +
                  "        ],\n" +
                  "        \"label\": \"failed\",\n" +
                  "        \"stack\": \"complete\"\n" +
                  "      },\n" +
                  "      {\n" +
                  "        \"data\": [\n" +
                  "          0,\n" +
                  "          340,\n" +
                  "          440,\n" +
                  "          0,\n" +
                  "          0,\n" +
                  "          340\n" +
                  "        ],\n" +
                  "        \"backgroundColor\": [\n" +
                  "          \"rgba(0,240,0,1.000)\"\n" +
                  "        ],\n" +
                  "        \"label\": \"passed\",\n" +
                  "        \"stack\": \"complete\"\n" +
                  "      }\n" +
                  "    ]\n" +
                  "  },\n" +
                  "  \"options\": {\n" +
                  "    \"scales\": {\n" +
                  "      \"xAxes\": [\n" +
                  "        {\n" +
                  "          \"ticks\": {\n" +
                  "            \"min\": 0,\n" +
                  "            \"stepSize\": 0,\n" +
                  "            \"display\": true\n" +
                  "          },\n" +
                  "          \"stacked\": false,\n" +
                  "          \"scaleLabel\": {\n" +
                  "            \"display\": true,\n" +
                  "            \"labelString\": \"Step Number\"\n" +
                  "          },\n" +
                  "          \"stepSize\": 0.0\n" +
                  "        }\n" +
                  "      ],\n" +
                  "      \"yAxes\": [\n" +
                  "        {\n" +
                  "          \"ticks\": {\n" +
                  "            \"min\": 0,\n" +
                  "            \"stepSize\": 0,\n" +
                  "            \"display\": true\n" +
                  "          },\n" +
                  "          \"stacked\": true,\n" +
                  "          \"scaleLabel\": {\n" +
                  "            \"display\": true,\n" +
                  "            \"labelString\": \"Step Runtime\"\n" +
                  "          },\n" +
                  "          \"stepSize\": 0.0\n" +
                  "        }\n" +
                  "      ]\n" +
                  "    }\n" +
                  "  },\n" +
                  "  \"type\": \"bar\"\n" +
                  "}";
  
          Chart chart = new Chart();
  
          Data data = new Data();
  
          List<String> labels = new ArrayList<>();
          labels.add("1");
          labels.add("2");
          labels.add("3");
          labels.add("4");
          labels.add("5");
          labels.add("6");
          data.setLabels(labels);
  
          List<Dataset> datasets = new ArrayList<>();
  
          Dataset dataset1 = new Dataset();
  
          List<Integer> data1 = new ArrayList<>();
          data1.add(340);
          data1.add(0);
          data1.add(0);
          data1.add(440);
          data1.add(340);
          data1.add(0);
          dataset1.setData(data1);
          dataset1.setLabel("failed");
          dataset1.setStack("complete");
          dataset1.setBackgroundColor(new ArrayList<>(Collections.singletonList("rgba(240,0,0,1.000)")));
          datasets.add(dataset1);
  
          Dataset dataset2 = new Dataset();
          List<Integer> data2 = new ArrayList<>();
          data2.add(0);
          data2.add(340);
          data2.add(440);
          data2.add(0);
          data2.add(0);
          data2.add(340);
          dataset2.setData(data2);
          dataset2.setLabel("passed");
          dataset2.setStack("complete");
          dataset2.setBackgroundColor(new ArrayList<>(Collections.singletonList("rgba(0,240,0,1.000)")));
          datasets.add(dataset2);
  
          data.setDatasets(datasets);
  
          chart.setData(data);
  
          Options options = new Options();
          Scales scales = new Scales();
          List<Axis> xAxes = new ArrayList<>();
          Axis xAxis = new Axis();
          Ticks xTicks = new Ticks();
          xAxis.setTicks(xTicks);
          ScaleLabel xScaleLabel = new ScaleLabel();
          xScaleLabel.setDisplay(true);
          xScaleLabel.setLabelString("Step Number");
          xAxis.setScaleLabel(xScaleLabel);
          xAxes.add(xAxis);
          scales.setxAxes(xAxes);
  
          List<Axis> yAxes = new ArrayList<>();
          Axis yAxis = new Axis();
          yAxis.setStacked(true);
          Ticks yTicks = new Ticks();
          yAxis.setTicks(yTicks);
          ScaleLabel yScaleLabel = new ScaleLabel();
          yScaleLabel.setDisplay(true);
          yScaleLabel.setLabelString("Step Runtime");
          yAxis.setScaleLabel(yScaleLabel);
          yAxes.add(yAxis);
          scales.setyAxes(yAxes);
  
          options.setScales(scales);
          chart.setOptions(options);
  
          chart.setType(ChartConfiguration.Type.bar);
  
          assertThat(chartJsonConverter.convertChartToJson(chart), is(expected));
      }
test_case.class_method_signature: ChartJsonConverterTest.getJsonTest()
test_case.full_signature: @Test public void getJsonTest()
test_case.identifier: getJsonTest
test_case.invocations: add add add add add add setLabels add add add add add add setData setLabel setStack setBackgroundColor singletonList add add add add add add add setData setLabel setStack setBackgroundColor singletonList add setDatasets setData setTicks setDisplay setLabelString setScaleLabel add setxAxes setStacked setTicks setDisplay setLabelString setScaleLabel add setyAxes setScales setOptions setType assertThat convertChartToJson is
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void getJsonTest()
focal_class.declarator: gson
focal_class.modifier: private final
focal_class.original_string: private final Gson gson;
focal_class.type: Gson
focal_class.var_name: gson
focal_class.file: plugin-code/src/main/java/com/trivago/cluecumber/rendering/pages/charts/ChartJsonConverter.java
focal_class.identifier: ChartJsonConverter
focal_class.class_method_signature: ChartJsonConverter.ChartJsonConverter()
focal_class.full_signature: @Inject public  ChartJsonConverter()
focal_class.identifier: ChartJsonConverter
focal_class.modifiers: @Inject public
focal_class.parameters: ()
focal_class.signature:  ChartJsonConverter()
focal_class.class_method_signature: ChartJsonConverter.convertChartToJson(final Chart chart)
focal_class.full_signature: public String convertChartToJson(final Chart chart)
focal_class.identifier: convertChartToJson
focal_class.modifiers: public
focal_class.parameters: (final Chart chart)
focal_class.return: String
focal_class.signature: String convertChartToJson(final Chart chart)
focal_method.body: public String convertChartToJson(final Chart chart) {
          return gson.toJson(chart);
      }
focal_method.class_method_signature: ChartJsonConverter.convertChartToJson(final Chart chart)
focal_method.full_signature: public String convertChartToJson(final Chart chart)
focal_method.identifier: convertChartToJson
focal_method.invocations: toJson
focal_method.modifiers: public
focal_method.parameters: (final Chart chart)
focal_method.return: String
focal_method.signature: String convertChartToJson(final Chart chart)