test_class.declarator: INTERVAL_VALUE = 1.0F
test_class.modifier: private static final
test_class.original_string: private static final Float INTERVAL_VALUE = 1.0F;
test_class.type: Float
test_class.var_name: INTERVAL_VALUE
test_class.declarator: INTERVAL_DURATION = 1000
test_class.modifier: private static final
test_class.original_string: private static final Integer INTERVAL_DURATION = 1000;
test_class.type: Integer
test_class.var_name: INTERVAL_DURATION
test_class.declarator: APPLICATION_JSON_HEADER_VALUE = "application/json"
test_class.modifier: private static final
test_class.original_string: private static final String APPLICATION_JSON_HEADER_VALUE = "application/json";
test_class.type: String
test_class.var_name: APPLICATION_JSON_HEADER_VALUE
test_class.declarator: CONTENT_TYPE_HEADER_NAME = "Content-Type"
test_class.modifier: private static final
test_class.original_string: private static final String CONTENT_TYPE_HEADER_NAME = "Content-Type";
test_class.type: String
test_class.var_name: CONTENT_TYPE_HEADER_NAME
test_class.declarator: DEMAND_RESPONSE_EVENT_URL = "/DemandResponseEvent/"
test_class.modifier: private static final
test_class.original_string: private static final String DEMAND_RESPONSE_EVENT_URL = "/DemandResponseEvent/";
test_class.type: String
test_class.var_name: DEMAND_RESPONSE_EVENT_URL
test_class.declarator: DURATION = "PT5S"
test_class.modifier: private static final
test_class.original_string: private static final String DURATION = "PT5S";
test_class.type: String
test_class.var_name: DURATION
test_class.declarator: NOTIFICATION_DURATION = "P1D"
test_class.modifier: private static final
test_class.original_string: private static final String NOTIFICATION_DURATION = "P1D";
test_class.type: String
test_class.var_name: NOTIFICATION_DURATION
test_class.declarator: TOLERANCE_DURATION = "PT5M"
test_class.modifier: private static final
test_class.original_string: private static final String TOLERANCE_DURATION = "PT5M";
test_class.type: String
test_class.var_name: TOLERANCE_DURATION
test_class.declarator: MODIFICATION = -1L
test_class.modifier: private static final
test_class.original_string: private static final Long MODIFICATION = -1L;
test_class.type: Long
test_class.var_name: MODIFICATION
test_class.declarator: START = 10L
test_class.modifier: private static final
test_class.original_string: private static final Long START = 10L;
test_class.type: Long
test_class.var_name: START
test_class.declarator: VEN1 = "ven1"
test_class.modifier: private static final
test_class.original_string: private static final String VEN1 = "ven1";
test_class.type: String
test_class.var_name: VEN1
test_class.declarator: VEN2 = "ven2"
test_class.modifier: private static final
test_class.original_string: private static final String VEN2 = "ven2";
test_class.type: String
test_class.var_name: VEN2
test_class.declarator: GROUP1 = "group1"
test_class.modifier: private static final
test_class.original_string: private static final String GROUP1 = "group1";
test_class.type: String
test_class.var_name: GROUP1
test_class.declarator: UNKNOWN_MARKETCONTEXT_NAME = "mouaiccool"
test_class.modifier: private static final
test_class.original_string: private static final String UNKNOWN_MARKETCONTEXT_NAME = "mouaiccool";
test_class.type: String
test_class.var_name: UNKNOWN_MARKETCONTEXT_NAME
test_class.declarator: MARKETCONTEXT_NAME = "http://oadr.avob.com"
test_class.modifier: private static final
test_class.original_string: private static final String MARKETCONTEXT_NAME = "http://oadr.avob.com";
test_class.type: String
test_class.var_name: MARKETCONTEXT_NAME
test_class.declarator: GROUP_PARAM = "group"
test_class.modifier: private static final
test_class.original_string: private static final String GROUP_PARAM = "group";
test_class.type: String
test_class.var_name: GROUP_PARAM
test_class.declarator: VEN_PARAM = "ven"
test_class.modifier: private static final
test_class.original_string: private static final String VEN_PARAM = "ven";
test_class.type: String
test_class.var_name: VEN_PARAM
test_class.declarator: LEVEL_SIGNAL_TYPE = "level"
test_class.modifier: private static final
test_class.original_string: private static final String LEVEL_SIGNAL_TYPE = "level";
test_class.type: String
test_class.var_name: LEVEL_SIGNAL_TYPE
test_class.declarator: SIMPLE_SIGNAL_NAME = "SIMPLE"
test_class.modifier: private static final
test_class.original_string: private static final String SIMPLE_SIGNAL_NAME = "SIMPLE";
test_class.type: String
test_class.var_name: SIMPLE_SIGNAL_NAME
test_class.declarator: SIGNAL_UNIT_TYPE = "NONE"
test_class.modifier: private static final
test_class.original_string: private static final String SIGNAL_UNIT_TYPE = "NONE";
test_class.type: String
test_class.var_name: SIGNAL_UNIT_TYPE
test_class.declarator: wac
test_class.modifier: @Autowired
  	private
test_class.original_string: @Autowired
  	private WebApplicationContext wac;
test_class.type: WebApplicationContext
test_class.var_name: wac
test_class.declarator: springSecurityFilterChain
test_class.modifier: @Autowired
  	private
test_class.original_string: @Autowired
  	private Filter springSecurityFilterChain;
test_class.type: Filter
test_class.var_name: springSecurityFilterChain
test_class.declarator: demandResponseEventService
test_class.modifier: @Resource
  	private
test_class.original_string: @Resource
  	private DemandResponseEventService demandResponseEventService;
test_class.type: DemandResponseEventService
test_class.var_name: demandResponseEventService
test_class.declarator: venService
test_class.modifier: @Resource
  	private
test_class.original_string: @Resource
  	private VenService venService;
test_class.type: VenService
test_class.var_name: venService
test_class.declarator: venGroupService
test_class.modifier: @Resource
  	private
test_class.original_string: @Resource
  	private VenGroupService venGroupService;
test_class.type: VenGroupService
test_class.var_name: venGroupService
test_class.declarator: venMarketContextService
test_class.modifier: @Resource
  	private
test_class.original_string: @Resource
  	private VenMarketContextService venMarketContextService;
test_class.type: VenMarketContextService
test_class.var_name: venMarketContextService
test_class.declarator: dozerMapper
test_class.modifier: @Resource
  	private
test_class.original_string: @Resource
  	private DtoMapper dozerMapper;
test_class.type: DtoMapper
test_class.var_name: dozerMapper
test_class.declarator: adminSession = SecurityMockMvcRequestPostProcessors.user("admin").roles("ADMIN")
test_class.modifier: private
test_class.original_string: private UserRequestPostProcessor adminSession = SecurityMockMvcRequestPostProcessors.user("admin").roles("ADMIN");
test_class.type: UserRequestPostProcessor
test_class.var_name: adminSession
test_class.declarator: venSession = SecurityMockMvcRequestPostProcessors.user(VEN1).roles("VEN")
test_class.modifier: private
test_class.original_string: private UserRequestPostProcessor venSession = SecurityMockMvcRequestPostProcessors.user(VEN1).roles("VEN");
test_class.type: UserRequestPostProcessor
test_class.var_name: venSession
test_class.declarator: userSession = SecurityMockMvcRequestPostProcessors.user(VEN1).roles("USER")
test_class.modifier: private
test_class.original_string: private UserRequestPostProcessor userSession = SecurityMockMvcRequestPostProcessors.user(VEN1).roles("USER");
test_class.type: UserRequestPostProcessor
test_class.var_name: userSession
test_class.declarator: vens = new ArrayList<>()
test_class.modifier: private
test_class.original_string: private List<Ven> vens = new ArrayList<>();
test_class.type: List<Ven>
test_class.var_name: vens
test_class.declarator: events = new ArrayList<>()
test_class.modifier: private
test_class.original_string: private List<DemandResponseEvent> events = new ArrayList<>();
test_class.type: List<DemandResponseEvent>
test_class.var_name: events
test_class.declarator: event1 = null
test_class.modifier: private
test_class.original_string: private DemandResponseEvent event1 = null;
test_class.type: DemandResponseEvent
test_class.var_name: event1
test_class.declarator: marketContext = null
test_class.modifier: private
test_class.original_string: private VenMarketContext marketContext = null;
test_class.type: VenMarketContext
test_class.var_name: marketContext
test_class.declarator: group = null
test_class.modifier: private
test_class.original_string: private VenGroup group = null;
test_class.type: VenGroup
test_class.var_name: group
test_class.declarator: mockMvc
test_class.modifier: private
test_class.original_string: private MockMvc mockMvc;
test_class.type: MockMvc
test_class.var_name: mockMvc
test_class.declarator: mapper = new ObjectMapper()
test_class.modifier: private
test_class.original_string: private ObjectMapper mapper = new ObjectMapper();
test_class.type: ObjectMapper
test_class.var_name: mapper
test_class.file: OpenADRServerVTNCommon/src/test/java/com/avob/openadr/server/common/vtn/controller/DemandResponseControllerTest.java
test_class.identifier: DemandResponseControllerTest
test_case.body: @Test
  	public void createTest() throws Exception {
  
  		// perform check
  		MvcResult andReturn = this.mockMvc
  				.perform(MockMvcRequestBuilders.post(DEMAND_RESPONSE_EVENT_URL + "/search")
  						.content(mapper.writeValueAsString(DemandResponseEventFilter.builder()
  								.addVenId(DemandResponseControllerTest.VEN1).build()))
  						.header("Content-Type", "application/json").with(adminSession))
  				.andExpect(MockMvcResultMatchers.status().is(HttpStatus.OK_200)).andReturn();
  
  		List<DemandResponseEventReadDto> readValue = convertMvcResultToDemandResponseDtoList(andReturn);
  		assertNotNull(readValue);
  		assertEquals(2, readValue.size());
  
  		for (DemandResponseEventReadDto dto : readValue) {
  			assertEquals(DemandResponseControllerTest.MODIFICATION, dto.getDescriptor().getModificationNumber());
  			assertNotNull(dto.getCreatedTimestamp());
  			assertEquals(DemandResponseControllerTest.DURATION, dto.getActivePeriod().getDuration());
  			assertEquals(DemandResponseControllerTest.MARKETCONTEXT_NAME, dto.getDescriptor().getMarketContext());
  			assertEquals(DemandResponseControllerTest.START, dto.getActivePeriod().getStart());
  			assertEquals(DemandResponseEventSimpleValueEnum.SIMPLE_SIGNAL_PAYLOAD_HIGH.getValue(),
  					dto.getSignals().get(0).getCurrentValue());
  		}
  		// create and don't publish
  		DemandResponseEventCreateDto toCreate = createValidEvent();
  		byte[] content = mapper.writeValueAsBytes(toCreate);
  		andReturn = this.mockMvc
  				.perform(MockMvcRequestBuilders.post(DEMAND_RESPONSE_EVENT_URL).content(content)
  						.header(CONTENT_TYPE_HEADER_NAME, APPLICATION_JSON_HEADER_VALUE).with(adminSession))
  				.andExpect(MockMvcResultMatchers.status().is(HttpStatus.CREATED_201)).andReturn();
  
  		DemandResponseEventReadDto res = convertMvcResultToDemandResponseDto(andReturn);
  
  		assertNotNull(res);
  		assertNotNull(res.getId());
  		Long toDeleteId = res.getId();
  		assertEquals(DemandResponseControllerTest.MODIFICATION, res.getDescriptor().getModificationNumber());
  		assertNotNull(res.getCreatedTimestamp());
  		assertNotNull(res.getLastUpdateTimestamp());
  		assertEquals(DemandResponseControllerTest.DURATION, res.getActivePeriod().getDuration());
  		assertEquals(DemandResponseControllerTest.MARKETCONTEXT_NAME, res.getDescriptor().getMarketContext());
  		assertEquals(DemandResponseControllerTest.START, res.getActivePeriod().getStart());
  		assertEquals(DemandResponseEventSimpleValueEnum.SIMPLE_SIGNAL_PAYLOAD_HIGH.getValue(),
  				res.getSignals().get(0).getCurrentValue());
  		assertTrue(DemandResponseEventStateEnum.ACTIVE.equals(res.getDescriptor().getState()));
  
  		// perform check
  		andReturn = this.mockMvc
  				.perform(MockMvcRequestBuilders.post(DEMAND_RESPONSE_EVENT_URL + "/search")
  						.content(mapper.writeValueAsString(DemandResponseEventFilter.builder()
  								.addVenId(DemandResponseControllerTest.VEN1).build()))
  						.header("Content-Type", "application/json").with(adminSession))
  				.andExpect(MockMvcResultMatchers.status().is(HttpStatus.OK_200)).andReturn();
  
  		readValue = convertMvcResultToDemandResponseDtoList(andReturn);
  		assertNotNull(readValue);
  		assertEquals(3, readValue.size());
  
  		for (DemandResponseEventReadDto dto : readValue) {
  			assertEquals(DemandResponseControllerTest.MODIFICATION, dto.getDescriptor().getModificationNumber());
  			assertNotNull(dto.getCreatedTimestamp());
  			assertEquals(DemandResponseControllerTest.DURATION, dto.getActivePeriod().getDuration());
  			assertEquals(DemandResponseControllerTest.MARKETCONTEXT_NAME, dto.getDescriptor().getMarketContext());
  			assertEquals(DemandResponseControllerTest.START, dto.getActivePeriod().getStart());
  			assertEquals(DemandResponseEventSimpleValueEnum.SIMPLE_SIGNAL_PAYLOAD_HIGH.getValue(),
  					dto.getSignals().get(0).getCurrentValue());
  		}
  
  		// perform invalid create: null market context
  		toCreate = createValidEvent();
  		toCreate.getDescriptor().setMarketContext(null);
  		String contentStr = mapper.writeValueAsString(toCreate);
  		this.mockMvc
  				.perform(MockMvcRequestBuilders.post(DEMAND_RESPONSE_EVENT_URL).content(contentStr)
  						.header(CONTENT_TYPE_HEADER_NAME, APPLICATION_JSON_HEADER_VALUE).with(adminSession))
  				.andExpect(MockMvcResultMatchers.status().is(HttpStatus.BAD_REQUEST_400));
  
  		// perform invalid create: null profile
  		toCreate = createValidEvent();
  		toCreate.getDescriptor().setOadrProfile(null);
  		contentStr = mapper.writeValueAsString(toCreate);
  		this.mockMvc
  				.perform(MockMvcRequestBuilders.post(DEMAND_RESPONSE_EVENT_URL).content(contentStr)
  						.header(CONTENT_TYPE_HEADER_NAME, APPLICATION_JSON_HEADER_VALUE).with(adminSession))
  				.andExpect(MockMvcResultMatchers.status().is(HttpStatus.BAD_REQUEST_400));
  
  		// perform invalid create: null response required
  		toCreate = createValidEvent();
  		toCreate.getDescriptor().setResponseRequired(null);
  		contentStr = mapper.writeValueAsString(toCreate);
  		this.mockMvc
  				.perform(MockMvcRequestBuilders.post(DEMAND_RESPONSE_EVENT_URL).content(contentStr)
  						.header(CONTENT_TYPE_HEADER_NAME, APPLICATION_JSON_HEADER_VALUE).with(adminSession))
  				.andExpect(MockMvcResultMatchers.status().is(HttpStatus.BAD_REQUEST_400));
  
  		// perform invalid create: unknown market context
  		toCreate = createValidEvent();
  		toCreate.getDescriptor().setMarketContext(UNKNOWN_MARKETCONTEXT_NAME);
  		contentStr = mapper.writeValueAsString(toCreate);
  		this.mockMvc
  				.perform(MockMvcRequestBuilders.post(DEMAND_RESPONSE_EVENT_URL).content(contentStr)
  						.header(CONTENT_TYPE_HEADER_NAME, APPLICATION_JSON_HEADER_VALUE).with(adminSession))
  				.andExpect(MockMvcResultMatchers.status().is(HttpStatus.BAD_REQUEST_400));
  
  		// perform invalid create: modification number present
  		toCreate = createValidEvent();
  		toCreate.getDescriptor().setMarketContext(UNKNOWN_MARKETCONTEXT_NAME);
  		toCreate.getDescriptor().setModificationNumber(0L);
  		contentStr = mapper.writeValueAsString(toCreate);
  		this.mockMvc
  				.perform(MockMvcRequestBuilders.post(DEMAND_RESPONSE_EVENT_URL).content(contentStr)
  						.header(CONTENT_TYPE_HEADER_NAME, APPLICATION_JSON_HEADER_VALUE).with(adminSession))
  				.andExpect(MockMvcResultMatchers.status().is(HttpStatus.BAD_REQUEST_400));
  
  		// perform invalid create: invalid priority
  		toCreate = createValidEvent();
  		toCreate.getDescriptor().setPriority(-1L);
  		contentStr = mapper.writeValueAsString(toCreate);
  		this.mockMvc
  				.perform(MockMvcRequestBuilders.post(DEMAND_RESPONSE_EVENT_URL).content(contentStr)
  						.header(CONTENT_TYPE_HEADER_NAME, APPLICATION_JSON_HEADER_VALUE).with(adminSession))
  				.andExpect(MockMvcResultMatchers.status().is(HttpStatus.BAD_REQUEST_400));
  
  		// perform invalid create: no signal configured
  		toCreate = createValidEvent();
  		toCreate.getSignals().clear();
  		contentStr = mapper.writeValueAsString(toCreate);
  		this.mockMvc
  				.perform(MockMvcRequestBuilders.post(DEMAND_RESPONSE_EVENT_URL).content(contentStr)
  						.header(CONTENT_TYPE_HEADER_NAME, APPLICATION_JSON_HEADER_VALUE).with(adminSession))
  				.andExpect(MockMvcResultMatchers.status().is(HttpStatus.BAD_REQUEST_400));
  
  		// perform invalid create: start MUST be set
  		toCreate = createValidEvent();
  		toCreate.getActivePeriod().setStart(null);
  		contentStr = mapper.writeValueAsString(toCreate);
  		this.mockMvc
  				.perform(MockMvcRequestBuilders.post(DEMAND_RESPONSE_EVENT_URL).content(contentStr)
  						.header(CONTENT_TYPE_HEADER_NAME, APPLICATION_JSON_HEADER_VALUE).with(adminSession))
  				.andExpect(MockMvcResultMatchers.status().is(HttpStatus.BAD_REQUEST_400));
  
  		// perform invalid create: duration MUST be set
  		toCreate = createValidEvent();
  		toCreate.getActivePeriod().setDuration(null);
  		contentStr = mapper.writeValueAsString(toCreate);
  		this.mockMvc
  				.perform(MockMvcRequestBuilders.post(DEMAND_RESPONSE_EVENT_URL).content(contentStr)
  						.header(CONTENT_TYPE_HEADER_NAME, APPLICATION_JSON_HEADER_VALUE).with(adminSession))
  				.andExpect(MockMvcResultMatchers.status().is(HttpStatus.BAD_REQUEST_400));
  
  		// perform invalid create: duration MUST be a valid xml duration
  		toCreate = createValidEvent();
  		toCreate.getActivePeriod().setDuration("1h");
  		contentStr = mapper.writeValueAsString(toCreate);
  		this.mockMvc
  				.perform(MockMvcRequestBuilders.post(DEMAND_RESPONSE_EVENT_URL).content(contentStr)
  						.header(CONTENT_TYPE_HEADER_NAME, APPLICATION_JSON_HEADER_VALUE).with(adminSession))
  				.andExpect(MockMvcResultMatchers.status().is(HttpStatus.BAD_REQUEST_400));
  
  		// clean
  		this.mockMvc.perform(MockMvcRequestBuilders.delete(DEMAND_RESPONSE_EVENT_URL + toDeleteId).with(adminSession))
  				.andExpect(MockMvcResultMatchers.status().is(HttpStatus.OK_200));
  
  		// create and publish
  		// expect modificationNumber = 0 because event published
  		toCreate = createValidEvent();
  		toCreate.setPublished(true);
  		content = mapper.writeValueAsBytes(toCreate);
  		andReturn = this.mockMvc
  				.perform(MockMvcRequestBuilders.post(DEMAND_RESPONSE_EVENT_URL).content(content)
  						.header(CONTENT_TYPE_HEADER_NAME, APPLICATION_JSON_HEADER_VALUE).with(adminSession))
  				.andExpect(MockMvcResultMatchers.status().is(HttpStatus.CREATED_201)).andReturn();
  
  		res = convertMvcResultToDemandResponseDto(andReturn);
  
  		assertNotNull(res);
  		assertNotNull(res.getId());
  		toDeleteId = res.getId();
  		assertNotNull(res.getCreatedTimestamp());
  		assertNotNull(res.getLastUpdateTimestamp());
  		assertEquals(DemandResponseControllerTest.DURATION, res.getActivePeriod().getDuration());
  		assertEquals(DemandResponseControllerTest.MARKETCONTEXT_NAME, res.getDescriptor().getMarketContext());
  		assertEquals(DemandResponseControllerTest.START, res.getActivePeriod().getStart());
  		assertEquals(DemandResponseEventSimpleValueEnum.SIMPLE_SIGNAL_PAYLOAD_HIGH.getValue(),
  				res.getSignals().get(0).getCurrentValue());
  		assertTrue(DemandResponseEventStateEnum.ACTIVE.equals(res.getDescriptor().getState()));
  		assertTrue(res.getDescriptor().getModificationNumber().equals(0L));
  
  		// clean
  		this.mockMvc.perform(MockMvcRequestBuilders.delete(DEMAND_RESPONSE_EVENT_URL + toDeleteId).with(adminSession))
  				.andExpect(MockMvcResultMatchers.status().is(HttpStatus.OK_200));
  
  	}
test_case.class_method_signature: DemandResponseControllerTest.createTest()
test_case.full_signature: @Test public void createTest()
test_case.identifier: createTest
test_case.invocations: andReturn andExpect perform with header content post writeValueAsString build addVenId builder is status convertMvcResultToDemandResponseDtoList assertNotNull assertEquals size assertEquals getModificationNumber getDescriptor assertNotNull getCreatedTimestamp assertEquals getDuration getActivePeriod assertEquals getMarketContext getDescriptor assertEquals getStart getActivePeriod assertEquals getValue getCurrentValue get getSignals createValidEvent writeValueAsBytes andReturn andExpect perform with header content post is status convertMvcResultToDemandResponseDto assertNotNull assertNotNull getId getId assertEquals getModificationNumber getDescriptor assertNotNull getCreatedTimestamp assertNotNull getLastUpdateTimestamp assertEquals getDuration getActivePeriod assertEquals getMarketContext getDescriptor assertEquals getStart getActivePeriod assertEquals getValue getCurrentValue get getSignals assertTrue equals getState getDescriptor andReturn andExpect perform with header content post writeValueAsString build addVenId builder is status convertMvcResultToDemandResponseDtoList assertNotNull assertEquals size assertEquals getModificationNumber getDescriptor assertNotNull getCreatedTimestamp assertEquals getDuration getActivePeriod assertEquals getMarketContext getDescriptor assertEquals getStart getActivePeriod assertEquals getValue getCurrentValue get getSignals createValidEvent setMarketContext getDescriptor writeValueAsString andExpect perform with header content post is status createValidEvent setOadrProfile getDescriptor writeValueAsString andExpect perform with header content post is status createValidEvent setResponseRequired getDescriptor writeValueAsString andExpect perform with header content post is status createValidEvent setMarketContext getDescriptor writeValueAsString andExpect perform with header content post is status createValidEvent setMarketContext getDescriptor setModificationNumber getDescriptor writeValueAsString andExpect perform with header content post is status createValidEvent setPriority getDescriptor writeValueAsString andExpect perform with header content post is status createValidEvent clear getSignals writeValueAsString andExpect perform with header content post is status createValidEvent setStart getActivePeriod writeValueAsString andExpect perform with header content post is status createValidEvent setDuration getActivePeriod writeValueAsString andExpect perform with header content post is status createValidEvent setDuration getActivePeriod writeValueAsString andExpect perform with header content post is status andExpect perform with delete is status createValidEvent setPublished writeValueAsBytes andReturn andExpect perform with header content post is status convertMvcResultToDemandResponseDto assertNotNull assertNotNull getId getId assertNotNull getCreatedTimestamp assertNotNull getLastUpdateTimestamp assertEquals getDuration getActivePeriod assertEquals getMarketContext getDescriptor assertEquals getStart getActivePeriod assertEquals getValue getCurrentValue get getSignals assertTrue equals getState getDescriptor assertTrue equals getModificationNumber getDescriptor andExpect perform with delete is status
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void createTest()
focal_class.declarator: LOGGER = LoggerFactory.getLogger(DemandResponseController.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger LOGGER = LoggerFactory.getLogger(DemandResponseController.class);
focal_class.type: Logger
focal_class.var_name: LOGGER
focal_class.declarator: dtoMapper
focal_class.modifier: @Resource
  	private
focal_class.original_string: @Resource
  	private DtoMapper dtoMapper;
focal_class.type: DtoMapper
focal_class.var_name: dtoMapper
focal_class.declarator: demandResponseEventService
focal_class.modifier: @Autowired
  	private
focal_class.original_string: @Autowired
  	private DemandResponseEventService demandResponseEventService;
focal_class.type: DemandResponseEventService
focal_class.var_name: demandResponseEventService
focal_class.declarator: demandResponseEventCreateDtoValidator
focal_class.modifier: @Resource
  	private
focal_class.original_string: @Resource
  	private DemandResponseEventCreateDtoValidator demandResponseEventCreateDtoValidator;
focal_class.type: DemandResponseEventCreateDtoValidator
focal_class.var_name: demandResponseEventCreateDtoValidator
focal_class.declarator: demandResponseEventUpdateDtoValidator
focal_class.modifier: @Resource
  	private
focal_class.original_string: @Resource
  	private DemandResponseEventUpdateDtoValidator demandResponseEventUpdateDtoValidator;
focal_class.type: DemandResponseEventUpdateDtoValidator
focal_class.var_name: demandResponseEventUpdateDtoValidator
focal_class.file: OpenADRServerVTNCommon/src/main/java/com/avob/openadr/server/common/vtn/controller/DemandResponseController.java
focal_class.identifier: DemandResponseController
focal_class.class_method_signature: DemandResponseController.initBinderCreate(WebDataBinder binder)
focal_class.full_signature: @InitBinder("demandResponseEventCreateDto") protected void initBinderCreate(WebDataBinder binder)
focal_class.identifier: initBinderCreate
focal_class.modifiers: @InitBinder("demandResponseEventCreateDto") protected
focal_class.parameters: (WebDataBinder binder)
focal_class.return: void
focal_class.signature: void initBinderCreate(WebDataBinder binder)
focal_class.class_method_signature: DemandResponseController.initBinderUpdate(WebDataBinder binder)
focal_class.full_signature: @InitBinder("demandResponseEventUpdateDto") protected void initBinderUpdate(WebDataBinder binder)
focal_class.identifier: initBinderUpdate
focal_class.modifiers: @InitBinder("demandResponseEventUpdateDto") protected
focal_class.parameters: (WebDataBinder binder)
focal_class.return: void
focal_class.signature: void initBinderUpdate(WebDataBinder binder)
focal_class.class_method_signature: DemandResponseController.search(@RequestBody List<DemandResponseEventFilter> filters,
  			@RequestParam(value = "start", required = false) Long start,
  			@RequestParam(value = "end", required = false) Long end,
  			@RequestParam(value = "page", required = false) Integer page,
  			@RequestParam(value = "size", required = false) Integer size, HttpServletResponse response)
focal_class.full_signature: @RequestMapping(value = "/search", method = RequestMethod.POST) @ResponseBody public List<DemandResponseEventReadDto> search(@RequestBody List<DemandResponseEventFilter> filters,
  			@RequestParam(value = "start", required = false) Long start,
  			@RequestParam(value = "end", required = false) Long end,
  			@RequestParam(value = "page", required = false) Integer page,
  			@RequestParam(value = "size", required = false) Integer size, HttpServletResponse response)
focal_class.identifier: search
focal_class.modifiers: @RequestMapping(value = "/search", method = RequestMethod.POST) @ResponseBody public
focal_class.parameters: (@RequestBody List<DemandResponseEventFilter> filters,
  			@RequestParam(value = "start", required = false) Long start,
  			@RequestParam(value = "end", required = false) Long end,
  			@RequestParam(value = "page", required = false) Integer page,
  			@RequestParam(value = "size", required = false) Integer size, HttpServletResponse response)
focal_class.return: List<DemandResponseEventReadDto>
focal_class.signature: List<DemandResponseEventReadDto> search(@RequestBody List<DemandResponseEventFilter> filters,
  			@RequestParam(value = "start", required = false) Long start,
  			@RequestParam(value = "end", required = false) Long end,
  			@RequestParam(value = "page", required = false) Integer page,
  			@RequestParam(value = "size", required = false) Integer size, HttpServletResponse response)
focal_class.class_method_signature: DemandResponseController.create(@Valid @RequestBody DemandResponseEventCreateDto event,
  			HttpServletResponse response, BindingResult result)
focal_class.full_signature: @RequestMapping(value = "/", method = RequestMethod.POST) @ResponseBody public DemandResponseEventReadDto create(@Valid @RequestBody DemandResponseEventCreateDto event,
  			HttpServletResponse response, BindingResult result)
focal_class.identifier: create
focal_class.modifiers: @RequestMapping(value = "/", method = RequestMethod.POST) @ResponseBody public
focal_class.parameters: (@Valid @RequestBody DemandResponseEventCreateDto event,
  			HttpServletResponse response, BindingResult result)
focal_class.return: DemandResponseEventReadDto
focal_class.signature: DemandResponseEventReadDto create(@Valid @RequestBody DemandResponseEventCreateDto event,
  			HttpServletResponse response, BindingResult result)
focal_class.class_method_signature: DemandResponseController.update(@PathVariable(value = "id") Long id,
  			@Valid @RequestBody DemandResponseEventUpdateDto event, HttpServletResponse response,
  			BindingResult result)
focal_class.full_signature: @RequestMapping(value = "/{id}", method = RequestMethod.PUT) @ResponseBody public DemandResponseEventReadDto update(@PathVariable(value = "id") Long id,
  			@Valid @RequestBody DemandResponseEventUpdateDto event, HttpServletResponse response,
  			BindingResult result)
focal_class.identifier: update
focal_class.modifiers: @RequestMapping(value = "/{id}", method = RequestMethod.PUT) @ResponseBody public
focal_class.parameters: (@PathVariable(value = "id") Long id,
  			@Valid @RequestBody DemandResponseEventUpdateDto event, HttpServletResponse response,
  			BindingResult result)
focal_class.return: DemandResponseEventReadDto
focal_class.signature: DemandResponseEventReadDto update(@PathVariable(value = "id") Long id,
  			@Valid @RequestBody DemandResponseEventUpdateDto event, HttpServletResponse response,
  			BindingResult result)
focal_class.class_method_signature: DemandResponseController.publish(@PathVariable(value = "id") Long id, HttpServletResponse response)
focal_class.full_signature: @RequestMapping(value = "/{id}/publish", method = RequestMethod.POST) @ResponseBody public DemandResponseEventReadDto publish(@PathVariable(value = "id") Long id, HttpServletResponse response)
focal_class.identifier: publish
focal_class.modifiers: @RequestMapping(value = "/{id}/publish", method = RequestMethod.POST) @ResponseBody public
focal_class.parameters: (@PathVariable(value = "id") Long id, HttpServletResponse response)
focal_class.return: DemandResponseEventReadDto
focal_class.signature: DemandResponseEventReadDto publish(@PathVariable(value = "id") Long id, HttpServletResponse response)
focal_class.class_method_signature: DemandResponseController.active(@PathVariable(value = "id") Long id, HttpServletResponse response)
focal_class.full_signature: @RequestMapping(value = "/{id}/active", method = RequestMethod.POST) @ResponseBody public DemandResponseEventReadDto active(@PathVariable(value = "id") Long id, HttpServletResponse response)
focal_class.identifier: active
focal_class.modifiers: @RequestMapping(value = "/{id}/active", method = RequestMethod.POST) @ResponseBody public
focal_class.parameters: (@PathVariable(value = "id") Long id, HttpServletResponse response)
focal_class.return: DemandResponseEventReadDto
focal_class.signature: DemandResponseEventReadDto active(@PathVariable(value = "id") Long id, HttpServletResponse response)
focal_class.class_method_signature: DemandResponseController.cancel(@PathVariable(value = "id") Long id, HttpServletResponse response)
focal_class.full_signature: @RequestMapping(value = "/{id}/cancel", method = RequestMethod.POST) @ResponseBody public DemandResponseEventReadDto cancel(@PathVariable(value = "id") Long id, HttpServletResponse response)
focal_class.identifier: cancel
focal_class.modifiers: @RequestMapping(value = "/{id}/cancel", method = RequestMethod.POST) @ResponseBody public
focal_class.parameters: (@PathVariable(value = "id") Long id, HttpServletResponse response)
focal_class.return: DemandResponseEventReadDto
focal_class.signature: DemandResponseEventReadDto cancel(@PathVariable(value = "id") Long id, HttpServletResponse response)
focal_class.class_method_signature: DemandResponseController.read(@PathVariable(value = "id") Long id, HttpServletResponse response)
focal_class.full_signature: @RequestMapping(value = "/{id}", method = RequestMethod.GET) @ResponseBody public DemandResponseEventReadDto read(@PathVariable(value = "id") Long id, HttpServletResponse response)
focal_class.identifier: read
focal_class.modifiers: @RequestMapping(value = "/{id}", method = RequestMethod.GET) @ResponseBody public
focal_class.parameters: (@PathVariable(value = "id") Long id, HttpServletResponse response)
focal_class.return: DemandResponseEventReadDto
focal_class.signature: DemandResponseEventReadDto read(@PathVariable(value = "id") Long id, HttpServletResponse response)
focal_class.class_method_signature: DemandResponseController.delete(@PathVariable(value = "id") Long id, HttpServletResponse response)
focal_class.full_signature: @RequestMapping(value = "/{id}", method = RequestMethod.DELETE) @ResponseBody public void delete(@PathVariable(value = "id") Long id, HttpServletResponse response)
focal_class.identifier: delete
focal_class.modifiers: @RequestMapping(value = "/{id}", method = RequestMethod.DELETE) @ResponseBody public
focal_class.parameters: (@PathVariable(value = "id") Long id, HttpServletResponse response)
focal_class.return: void
focal_class.signature: void delete(@PathVariable(value = "id") Long id, HttpServletResponse response)
focal_class.class_method_signature: DemandResponseController.readVenDemandResponseEvent(@PathVariable(value = "id") Long id,
  			HttpServletResponse response)
focal_class.full_signature: @RequestMapping(value = "/{id}/venResponse", method = RequestMethod.GET) @ResponseBody public List<VenDemandResponseEventDto> readVenDemandResponseEvent(@PathVariable(value = "id") Long id,
  			HttpServletResponse response)
focal_class.identifier: readVenDemandResponseEvent
focal_class.modifiers: @RequestMapping(value = "/{id}/venResponse", method = RequestMethod.GET) @ResponseBody public
focal_class.parameters: (@PathVariable(value = "id") Long id,
  			HttpServletResponse response)
focal_class.return: List<VenDemandResponseEventDto>
focal_class.signature: List<VenDemandResponseEventDto> readVenDemandResponseEvent(@PathVariable(value = "id") Long id,
  			HttpServletResponse response)
focal_class.class_method_signature: DemandResponseController.readVenDemandResponseEvent(@PathVariable(value = "id") Long id,
  			@PathVariable(value = "username") String username, HttpServletResponse response)
focal_class.full_signature: @RequestMapping(value = "/{id}/venResponse/{username}", method = RequestMethod.GET) @ResponseBody public VenDemandResponseEventDto readVenDemandResponseEvent(@PathVariable(value = "id") Long id,
  			@PathVariable(value = "username") String username, HttpServletResponse response)
focal_class.identifier: readVenDemandResponseEvent
focal_class.modifiers: @RequestMapping(value = "/{id}/venResponse/{username}", method = RequestMethod.GET) @ResponseBody public
focal_class.parameters: (@PathVariable(value = "id") Long id,
  			@PathVariable(value = "username") String username, HttpServletResponse response)
focal_class.return: VenDemandResponseEventDto
focal_class.signature: VenDemandResponseEventDto readVenDemandResponseEvent(@PathVariable(value = "id") Long id,
  			@PathVariable(value = "username") String username, HttpServletResponse response)
focal_method.body: @RequestMapping(value = "/", method = RequestMethod.POST)
  	@ResponseBody
  	public DemandResponseEventReadDto create(@Valid @RequestBody DemandResponseEventCreateDto event,
  			HttpServletResponse response, BindingResult result) {
  
  		if (result.hasErrors()) {
  			response.setStatus(HttpStatus.BAD_REQUEST_400);
  			return null;
  		}
  
  		DemandResponseEvent save = demandResponseEventService.create(event);
  
  		response.setStatus(HttpStatus.CREATED_201);
  
  		LOGGER.info("create DR event: " + save.toString());
  
  		return dtoMapper.map(save, DemandResponseEventReadDto.class);
  
  	}
focal_method.class_method_signature: DemandResponseController.create(@Valid @RequestBody DemandResponseEventCreateDto event,
  			HttpServletResponse response, BindingResult result)
focal_method.full_signature: @RequestMapping(value = "/", method = RequestMethod.POST) @ResponseBody public DemandResponseEventReadDto create(@Valid @RequestBody DemandResponseEventCreateDto event,
  			HttpServletResponse response, BindingResult result)
focal_method.identifier: create
focal_method.invocations: hasErrors setStatus create setStatus info toString map
focal_method.modifiers: @RequestMapping(value = "/", method = RequestMethod.POST) @ResponseBody public
focal_method.parameters: (@Valid @RequestBody DemandResponseEventCreateDto event,
  			HttpServletResponse response, BindingResult result)
focal_method.return: DemandResponseEventReadDto
focal_method.signature: DemandResponseEventReadDto create(@Valid @RequestBody DemandResponseEventCreateDto event,
  			HttpServletResponse response, BindingResult result)