Allow POST dr_sub using FeedName
[dmaap/dbcapi.git] / src / main / java / org / onap / dmaap / dbcapi / service / DR_SubService.java
index 2fd75d0..9d233a5 100644 (file)
@@ -65,11 +65,11 @@ public class DR_SubService extends BaseLoggingClass {
                
        public List<DR_Sub> getAllDr_Subs() {
                logger.debug( "enter getAllDR_Subs()");
-               return new ArrayList<DR_Sub>(dr_subs.values());
+               return new ArrayList<>(dr_subs.values());
        }
        
        public ArrayList<DR_Sub> getDr_SubsByFeedId( String pubId ) {
-               ArrayList<DR_Sub> someSubs = new ArrayList<DR_Sub>();
+               ArrayList<DR_Sub> someSubs = new ArrayList<>();
                for( DR_Sub sub : dr_subs.values() ) {
                        if ( pubId.equals(  sub.getFeedId()  )) {
                                someSubs.add( sub );
@@ -98,7 +98,7 @@ public class DR_SubService extends BaseLoggingClass {
                String resp = prov.doPostDr_Sub( sub, apiError );
                if ( "Yes".equals(unit_test) ) {
                        resp = simulateResp( sub, "POST" );
-                       apiError.setCode(200);
+                       apiError.setCode(201);
                }
                logger.debug( "addDr_Sub resp=" + resp );
 
@@ -110,7 +110,7 @@ public class DR_SubService extends BaseLoggingClass {
                        snew.setLastMod();
                        addEgressRoute( snew, apiError );
                        dr_subs.put( snew.getSubId(), snew );   
-                       apiError.setCode(200);
+                       apiError.setCode(201);
                } else {
                        apiError.setCode(400);
                }