Examples of YamlParser


Examples of by.stub.yaml.YamlParser

      final URL yamlUrl = StubbedDataManagerTest.class.getResource("/yaml/two.external.files.yaml");
      final InputStream stubsDatanputStream = yamlUrl.openStream();
      final String yaml = StringUtils.inputStreamToString(stubsDatanputStream);
      final String parentDirectory = new File(yamlUrl.getPath()).getParent();

      final List<StubHttpLifecycle> stubHttpLifecycles = new YamlParser().parse(parentDirectory, yaml);
      stubbedDataManager.resetStubHttpLifecycles(stubHttpLifecycles);

      final Map<File, Long> externalFiles = stubbedDataManager.getExternalFiles();

      assertThat(externalFiles.size()).isEqualTo(2);
View Full Code Here

Examples of by.stub.yaml.YamlParser

      final URL yamlUrl = StubbedDataManagerTest.class.getResource("/yaml/one.external.files.yaml");
      final InputStream stubsDatanputStream = yamlUrl.openStream();
      final String yaml = StringUtils.inputStreamToString(stubsDatanputStream);
      final String parentDirectory = new File(yamlUrl.getPath()).getParent();

      final List<StubHttpLifecycle> stubHttpLifecycles = new YamlParser().parse(parentDirectory, yaml);
      stubbedDataManager.resetStubHttpLifecycles(stubHttpLifecycles);

      final Map<File, Long> externalFiles = stubbedDataManager.getExternalFiles();

      assertThat(externalFiles.size()).isEqualTo(1);
View Full Code Here

Examples of by.stub.yaml.YamlParser

      final URL yamlUrl = StubbedDataManagerTest.class.getResource("/yaml/same.external.files.yaml");
      final InputStream stubsDatanputStream = yamlUrl.openStream();
      final String yaml = StringUtils.inputStreamToString(stubsDatanputStream);
      final String parentDirectory = new File(yamlUrl.getPath()).getParent();

      final List<StubHttpLifecycle> stubHttpLifecycles = new YamlParser().parse(parentDirectory, yaml);
      stubbedDataManager.resetStubHttpLifecycles(stubHttpLifecycles);

      final Map<File, Long> externalFiles = stubbedDataManager.getExternalFiles();

      assertThat(externalFiles.size()).isEqualTo(1);
View Full Code Here

Examples of by.stub.yaml.YamlParser

      final URL yamlUrl = StubbedDataManagerTest.class.getResource("/yaml/request.null.external.files.yaml");
      final InputStream stubsDatanputStream = yamlUrl.openStream();
      final String yaml = StringUtils.inputStreamToString(stubsDatanputStream);
      final String parentDirectory = new File(yamlUrl.getPath()).getParent();

      final List<StubHttpLifecycle> stubHttpLifecycles = new YamlParser().parse(parentDirectory, yaml);
      stubbedDataManager.resetStubHttpLifecycles(stubHttpLifecycles);

      final Map<File, Long> externalFiles = stubbedDataManager.getExternalFiles();

      assertThat(externalFiles.size()).isEqualTo(1);
View Full Code Here

Examples of by.stub.yaml.YamlParser

      final URL yamlUrl = StubbedDataManagerTest.class.getResource("/yaml/response.null.external.files.yaml");
      final InputStream stubsDatanputStream = yamlUrl.openStream();
      final String yaml = StringUtils.inputStreamToString(stubsDatanputStream);
      final String parentDirectory = new File(yamlUrl.getPath()).getParent();

      final List<StubHttpLifecycle> stubHttpLifecycles = new YamlParser().parse(parentDirectory, yaml);
      stubbedDataManager.resetStubHttpLifecycles(stubHttpLifecycles);

      final Map<File, Long> externalFiles = stubbedDataManager.getExternalFiles();

      assertThat(externalFiles.size()).isEqualTo(1);
View Full Code Here

Examples of by.stub.yaml.YamlParser

         .withQuery("paramName2", "paramValue2")
         .newStubbedResponse()
         .withStatus("201")
         .build();

      final List<StubHttpLifecycle> stubHttpLifecycles = new YamlParser().parse(".", String.format("%s%s%s", cycleTwo, BR, cycleThree));
      stubbedDataManager.resetStubHttpLifecycles(stubHttpLifecycles);

      List<StubHttpLifecycle> afterResetHttpCycles = stubbedDataManager.getStubHttpLifecycles();
      assertThat(afterResetHttpCycles.size()).isEqualTo(2);
View Full Code Here

Examples of by.stub.yaml.YamlParser

         .withQuery("paramName1", "paramValue1")
         .newStubbedResponse()
         .withStatus("200")
         .build();

      final List<StubHttpLifecycle> stubHttpLifecycles = new YamlParser().parse(".", cycleOne);
      final StubHttpLifecycle updatingStubHttpLifecycle = stubHttpLifecycles.get(0);

      stubbedDataManager.updateStubHttpLifecycleByIndex(0, updatingStubHttpLifecycle);
      List<StubHttpLifecycle> afterUpdateHttpCycles = stubbedDataManager.getStubHttpLifecycles();
View Full Code Here

Examples of by.stub.yaml.YamlParser

         }
      }
   }

   private void loadYamlToDataStore(final String yaml) throws Exception {
      final List<StubHttpLifecycle> stubHttpLifecycles = new YamlParser().parse(".", yaml);

      stubbedDataManager.resetStubHttpLifecycles(stubHttpLifecycles);
   }
View Full Code Here

Examples of by.stub.yaml.YamlParser

         final String errorMessage = String.format("%s request on URI %s was empty", request.getMethod(), request.getRequestURI());
         HandlerUtils.configureErrorResponse(wrapper, HttpStatus.NO_CONTENT_204, errorMessage);
         return;
      }

      final String updatedCycleUrl = stubbedDataManager.refreshStubbedData(new YamlParser(), put, stubIndexToUpdate);

      wrapper.setStatus(HttpStatus.CREATED_201);
      wrapper.addHeader(HttpHeaders.LOCATION, updatedCycleUrl);
      final String successfulMessage = String.format("Stub request index#%s updated successfully", stubIndexToUpdate);
      wrapper.getWriter().println(successfulMessage);
View Full Code Here

Examples of by.stub.yaml.YamlParser

         final String errorMessage = String.format("%s request on URI %s was empty", request.getMethod(), request.getRequestURI());
         HandlerUtils.configureErrorResponse(wrapper, HttpStatus.NO_CONTENT_204, errorMessage);
         return;
      }

      stubbedDataManager.refreshStubbedData(new YamlParser(), post);

      if (stubbedDataManager.getStubHttpLifecycles().size() == 1) {
         wrapper.addHeader(HttpHeaders.LOCATION, stubbedDataManager.getOnlyStubRequestUrl());
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.