@Test public void testBadData() { Response response = resource.provision(new HashMap<String, String>(), null); assertEquals(response.getStatus(), Status.BAD_REQUEST.getStatusCode()); }
@POST @RightsAllowed({Right.INGEST_DATA }) public Response provision(Map<String, String> reqBody, @Context final UriInfo uriInfo) { String orgId = reqBody.get(STATE_EDORG_ID); if (orgId == null) { return Response.status(Status.BAD_REQUEST).entity("Missing required " + STATE_EDORG_ID).build(); } Response r = createEdOrg(orgId); return r; }
OnboardingResource { @POST @RightsAllowed({Right.INGEST_DATA }) public Response provision(Map<String, String> reqBody, @Context final UriInfo uriInfo) { String orgId = reqBody.get(STATE_EDORG_ID); if (orgId == null) { return Response.status(Status.BAD_REQUEST).entity("Missing required " + STATE_EDORG_ID).build(); } Response r = createEdOrg(orgId); return r; } }
OnboardingResource { @POST @RightsAllowed({Right.INGEST_DATA }) public Response provision(Map<String, String> reqBody, @Context final UriInfo uriInfo) { String orgId = reqBody.get(STATE_EDORG_ID); if (orgId == null) { return Response.status(Status.BAD_REQUEST).entity("Missing required " + STATE_EDORG_ID).build(); } Response r = createEdOrg(orgId); return r; } @Autowired  OnboardingResource(@Value("${sli.landingZone.server}") String landingZoneServer); }
OnboardingResource { @POST @RightsAllowed({Right.INGEST_DATA }) public Response provision(Map<String, String> reqBody, @Context final UriInfo uriInfo) { String orgId = reqBody.get(STATE_EDORG_ID); if (orgId == null) { return Response.status(Status.BAD_REQUEST).entity("Missing required " + STATE_EDORG_ID).build(); } Response r = createEdOrg(orgId); return r; } @Autowired  OnboardingResource(@Value("${sli.landingZone.server}") String landingZoneServer); @POST @RightsAllowed({Right.INGEST_DATA }) Response provision(Map<String, String> reqBody, @Context final UriInfo uriInfo); Response createEdOrg(final String orgId); }
OnboardingResource { @POST @RightsAllowed({Right.INGEST_DATA }) public Response provision(Map<String, String> reqBody, @Context final UriInfo uriInfo) { String orgId = reqBody.get(STATE_EDORG_ID); if (orgId == null) { return Response.status(Status.BAD_REQUEST).entity("Missing required " + STATE_EDORG_ID).build(); } Response r = createEdOrg(orgId); return r; } @Autowired  OnboardingResource(@Value("${sli.landingZone.server}") String landingZoneServer); @POST @RightsAllowed({Right.INGEST_DATA }) Response provision(Map<String, String> reqBody, @Context final UriInfo uriInfo); Response createEdOrg(final String orgId); static final String STATE_EDUCATION_AGENCY; static final String STATE_EDORG_ID; static final String EDORG_INSTITUTION_NAME; static final String ADDRESSES; static final String ADDRESS_STREET; static final String ADDRESS_CITY; static final String ADDRESS_STATE_ABRV; static final String ADDRESS_POSTAL_CODE; static final String CATEGORIES; static final String PRELOAD_FILES_ID; }