All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.codearte.accurest.samples.camel.BookDeleter.groovy Maven / Gradle / Ivy

There is a newer version: 1.1.1
Show newest version
package io.codearte.accurest.samples.camel

import groovy.transform.CompileStatic
import groovy.util.logging.Slf4j
import org.apache.camel.Exchange
import org.springframework.stereotype.Component

import java.util.concurrent.atomic.AtomicBoolean

@CompileStatic
@Slf4j
@Component
class BookDeleter {

	/**
	   Scenario for "should generate tests triggered by a message":
	     client side: if sends a message to input.messageFrom then message will be sent to output.messageFrom
	     server side: will send a message to input, verify the message contents and await upon receiving message on the output messageFrom
	 */
	void bookDeleted(Exchange exchange) {
		BookDeleted bookDeleted = exchange.in.getBody(BookDeleted)
		log.info("Deleting book [$bookDeleted]")
		bookSuccessfulyDeleted.set(true)
		log.info("Book successfuly deleted [$bookSuccessfulyDeleted]")
	}

	AtomicBoolean bookSuccessfulyDeleted = new AtomicBoolean(false)
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy