Package github.priyatam.springrest.domain

Examples of github.priyatam.springrest.domain.Policy


            // shortcut exit - no further processing necessary
            return null;
        }

        // Load Policy
        Policy policy = persistenceHelper.loadPolicy(policyNum);
        if (policy == null) {
            logger.warn("No Policy found");
            return new ResponseEntity<Policy>(null, new HttpHeaders(), HttpStatus.NOT_FOUND);
        }
View Full Code Here


        logger.debug("Received notification that policy creation is completed");
        String policyNum = resourceHelper.parseKey(resourceHelper.getPermLocation(futureKey));

        // Lookup
        Policy policy = persistenceHelper.loadPolicy(policyNum);
        if (policy == null) {
            logger.error("Can't read policy with key: " + policyNum);
            return new ResponseEntity<Policy>(null, new HttpHeaders(), HttpStatus.INTERNAL_SERVER_ERROR);
        }
View Full Code Here

    public void stubRestCalls() throws IOException {
        mockServer.expect(requestTo("/policy/pol-1"))
            .andRespond(withSuccess(mockPolicy(), MediaType.APPLICATION_JSON));

        // Use RestTemplate ...
        Policy policy = restTemplate.getForObject("/policy/{policyNum}", Policy.class, "pol-1");
        Assert.assertNotNull(policy);
       
        mockServer.verify();
    }
View Full Code Here

       
        mockServer.verify();
    }

    String mockPolicy() throws IOException {
        Policy p = createPolicyFull("pol-1000", "vin-1000", "lic-1000");
        String str = mapper.writeValueAsString(p);
        return str;
    }
View Full Code Here

  }

  @Test
    @Ignore //FIXME
  public void savePolicy() throws Exception {
    Policy policy = MockDataHelper.createPolicyFull("lic-test1", "vin-test1", "acc1");
    mockMvc.perform(
          post("/policy")
            .header("Content-Type", "application/json")
            .content(mapper.writeValueAsBytes(policy)))
          .andExpect(status().isAccepted())
View Full Code Here

TOP

Related Classes of github.priyatam.springrest.domain.Policy

Copyright © 2018 www.massapicom. 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.